Installing Apache thrift, Cassandra 2.x and YACassandra-PDO on CentOS 6.5+


Well after a long time this is my in length article, the reason I am writing is because of all the stuff I have been gone through building thrift and cassandra-pdo on centOS 6.5


I will be writing about installing latest version of thrift that at time of writing and RnD was 0.9.1, CentOS is version 6.5 64 bit, php 5.3.3,  Apache/2.2.15, Cassandra is at version 2.06 which is most stable version for production at the time of writing.



Most of the commands will need elevated privileges. You should prefix sudo with every command, I am doing it on test VM so doing it as privileged user root

Packages wget, nano are available if not then yum install them as shown below. Of course if you use vi or other util other than wget to download files then skip this

Ok so lets get started.

When I started building thrift, or cassandra pdo I was getting all sort of errors such as


Install Cassandra

Installing cassandra is the simplest one, We will be installing it from rpm provided by datastax

Open datastax.repo for editing with following command

paste following content in editor

 Install cassandra

Above command will also install openJDK but cassandra guys recommend that we should use latest java from Oracle so lets do that now

Get into opt directory You can actually choose to be any other directory of your liking

Get RPM path for latest jre  from I am using jre 8 from


output of java –version would be  something like

Lets now install Development tools

Lets now install all pre-requisites to install thrift without issues

Before you proceed you would need autoconf version of atleast 2.65 but we will install latest version of it anyway

Build and install apache thrift

Now lets get thrift source from Github as shown below and we will install it too

Ok if you don’t see any error at this step we are doing very well and we can proceed with getting and installing YACassandraPDO from github as shown below.

Still no error, awesome, lets proceed with including our compiled package with PHP.

add this line to pdo_cassandra.ini

Restart Apache

Start Cassandra service

Now you are free to query your cassandra nodes as shown below

More  info on connections and queries can be found here

Also note that CQL3 is kinda supported with this php PDO driver. if you get php pdo is not found exception while connecting to a cassandra node make sure you have php-pdo installed

Of course you can leave your comment and possibly someone would be able to help if not me. I look forward to get any feedback or above instructions can be improved. I will make requested edits.

Trying something new isn’t easy sometimes but when it works its a nice feeling…

I hope this article helps you or atleast give you some pointers.



  1. Paul Evans says

    We have a project that needs designing that uses speach recognition, can you help?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.