WorkHabit Blogs
WORKHABIT LABSCentOS 5.5 and Thrift/Scribe
Prerequisites:
We’ll be doing some git-retrieval, meaning we need git installed. Being a sysadmin by trade, I’m naturally lazy, so I’m happy to just pull the git package from EPEL.
As for the rest, we’re doing some compiling - so, it’s necessary to make sure gcc-c++/etc. are available.
Please note that, like Crom, I laugh at 32-bit packages. I laugh from my mountain. If you’re using a 32-bit system, please tell myself from six years ago to not fly United through Chicago on the way to Drupal Camp LA. Also, you’ll want to remove the .x86_64 bits from the yum command below:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum -y install gcc-c++ bison flex git automake libevent.x86_64 libevent-devel.x86_64 zlib-devel.x86_64 bzip2-devel.x86_64 python-devel.x86_64 ruby-devel.x86_64 pkgconfig
Boost:
Various instructions across the Internets have told me that CentOS does, in fact, come with Boost. Sadly, without manually compiling a newer version, I was unable to get Thrift/Scribe working. So, let’s compile Boost:
rpm -e --nodeps boost
rpm -e --nodeps boost-devel
rpm -e --nodeps boost-doc
cd /usr/local/src
wget http://sourceforge.net/projects/boost/files/boost/1.42.0/boost_1_42_0.tar.gz/download
tar -zxf boost_1_42_0.tar.gz
cd boost_1_42_0
./bootstrap.sh
./bjam install
Java:
Java is awesome, and part of the reason I’m not merely rebuilding Silas Sewell’s source RPMs. So, yeah, grab a JDK from Sun^H^H^HOracle:
In my case, this is jdk.1.6.0_21, the rpm bin.
chmod ugo+x jdk.bin
./jdk*.bin
(hit enter)
echo 'export JAVA_HOME="/usr/java/jdk1.6.0_21"' > /etc/profile.d/java.sh
echo 'PATH=${JAVA_HOME}/bin:${PATH}' >> /etc/profile.d/java.sh
export JAVA_HOME=/usr/java/jdk1.6.0_21
export PATH=${JAVA_HOME}/bin:${PATH}
Libtool:
We need an updated libtool, alas. So, without further ado:
rpm -e --nodeps libtool
cd /usr/local/src
rpm -qa | grep libtool | rpm -e --nodeps $(xargs)
curl http://ftp.gnu.org/gnu/libtool/libtool-2.2.8.tar.gz | tar zxv
cd libtool-2.2.8/ && ./configure && make && make install && cd ..
Ant:
Next up is Apache Ant.
curl http://www.fightrice.com/mirrors/apache/ant/binaries/apache-ant-1.8.1-bin.tar.gz | tar zxv
mv apache-ant-1.8.1/ /opt/ant
echo 'export ANT_HOME=/opt/ant' > /etc/profile.d/ant.sh
echo 'export PATH=/opt/ant/bin:$PATH' >> /etc/profile.d/ant.sh
export ANT_HOME=/opt/ant
export PATH=/opt/ant/bin:$PATH
THRIFT!
Now we’re getting somewhere. Thrift is a bit tricky. First, grab it and unpackage:
cd /usr/local/src
curl http://mirror.atlanticmetro.net/apache/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz | tar zxv
cd thrift-0.2.0
cp /usr/share/aclocal/pkg.m4 aclocal/
Now, before you continue, grab the acsite.m4 file attached to this post, and drop it directly into /usr/local/src/thrift-0.2.0 (though make sure it’s acsite.m4, and not acsite.m4.txt, when you put it in) - kept having weird issues without this, and the only other solution was to rebuild even more software. We’re doing enough of that already, you know?
Once you’ve dropped in acsite.m4, continue with compilation:
./bootstrap.sh && ./configure --with-csharp=no --with-erlang=no --with-ruby=no
make && make install
cd contrib/fb303/
./bootstrap.sh && ./configure
make && make install && cd ../../../
Suddenly, Scribe! Thousands of them!
This is the easy part, actually…
curl http://cloud.github.com/downloads/facebook/scribe/scribe-2.2.tar.gz | tar zxv
cd scribe
export LD_LIBRARY_PATH="/usr/local/lib"
echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
ldconfig
./bootstrap.sh && ./configure && make && make install
cp ./examples/scribe_cat /usr/local/bin
cp ./examples/scribe_ctrl /usr/local/bin
mkdir /etc/scribed
cp ./examples/example1.conf /etc/scribed/default.conf
echo "SCRIBED_CONFIG=/etc/scribed/default.conf" >> /etc/sysconfig/scribed
Scribe Init Script:
Copy the attached ‘scribe-init.txt’ to /etc/init.d/scribed, then execute the following:
chmod ugo+x /etc/init.d/scribed
chkconfig scribed on
/etc/init.d/scribed start
…And congratulations. You’ve got Scribe running, albeit with the default config.
Credit(tm): Much of the process here comes from the blog of Nathan Milford; his post on setting up Scribe on CentOS 5.5 was used during my first attempts at getting Thrift and Scribe up and running. Ran into some problems, of course, thus this post. I also modified the init script posted on his entry to play more nicely (eg, show colorful OK/FAILED output) with CentOS.
The acsite.m4 file came from a random mailing list post, which I sadly can’t find in my browser history. Props of the mad variety need to be given to the author, who I’ll properly credit if I can dig up the post.
| Attachment | Size |
|---|---|
| acsite.m4.txt | 1.89 KB |
| scribed-init.txt | 1.86 KB |


Post new comment