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

Hello,

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

Versions

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.

 

Prerequisite

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 http://www.oracle.com/technetwork/java/javase/downloads/index.html I am using jre 8 from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

 

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

https://github.com/Orange-OpenSource/YACassandraPDO/wiki

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.

Regards.

Installing YAF php framework and getting /usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory on Centos 6+

Hi Guys, Yaf framework appears to be the fastest framework around, logically so because its built with C and compiled in a PHP extension. While installing Yaf, I ran into a problem where it seems like make was complaining about pcre.h missing … [Continue reading]

Config file “/etc/amavisd.conf” does not exist

Hi guys, A quick tip If you get this error either trying to showkeys  or any other action using amavisd You can quickly fix that Generally amavisd.conf file reside under /etc/ but on many distros it can be found … [Continue reading]

Linux Find files newer than certain date and time

Yeah I know generally we pretty much always want to find older files but there are some use cases where finding newer files than a certain date time is a requirement. Ok being no where near to your Linux expertise, I will show you how I do it, you … [Continue reading]

Google MarkerClusterer Handling Multiple Markers On Same Geo Location

When you are dealing with addresses on Google Maps there are times when you have multiple addresses for a same location. For example if you live in a building with 200+ apartments, building address remains the same but you also add apartment number … [Continue reading]

How to clear DNS Cache in Windows small business server 2011 or windows 2008 r2

Clear DNS cache

G'day While I do not write on Windows server too often but here is that once in a blue moon article or you can assume a quick tip on how to clear DNS cache, Reason can be any but sometimes we have to do it. Locally we will just … [Continue reading]

5 best jQuery radio button and checkbox styling plugins

iCheck

Sometimes its good to utilize great work done by different authors working in different fields rather than reinventing the wheel again and again. There are awesome Git projects that people are working collaboratively to produce something really … [Continue reading]

ExtJS Grid Multi-line rows

Extjs multiline grid example

Yes, I heard you saying why there is no option or setting to force cell to wrap. Good news is that its very easy to achieve this. Without me wasting much of you valuable time lets jump straight to the point. Lets form a grid first. ExtJS Grid … [Continue reading]

PHP convert timezones

Hi Guys, Just a quick tip here. There are times when you would like to convert a Timezone (say America/New_York) to another Timezone (say UTC) With classes such as DateTime and DateTimeZone available from php 5.2+ this task has become piece … [Continue reading]

Google Maps How to do a KML Layer overlay fill

Google Maps KML layer in action

Hi Guys, Now that I am experimenting with Google Maps I thinks its about time to write a few articles. This is the first one in the series to follow in coming weeks. This post covers how to draw a KML Layer overlay using Google Maps. Good thing … [Continue reading]