Thrudb on Ubuntu - installation guide

I've been playing with Thrudb project for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 last several days. Basically Thrudb is a set of simple services built on top of Facebook’s Thrift framework that provides indexing and document storage services for building and scaling websites. Its purpose is to offer web developers flexible, fast and easy-to-use services that can enhance or replace traditional data storage and access layers. It’ is also an alternative to Amazon’s recently announced SimpleDB which Jake, Thrudb's creator, has provided some commentary on.

Below are step-by-step instructions to go from zero to running Thrudb on your Ubuntu box. It's mostly based on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 excellent guide from YourSharade with some small modifications to meet cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 current Thrudb source code.

1. Initial Setup

Alright, we’re ready to start installing. Most of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 dependencies are available with apt-get, but some we’ll have to build from source. The first thing we need for thrudb is thrift, which itself has quite a few dependencies.

First let’s make a directory to put our files in:

$ mkdir buildthrudb
$ cd buildthrudb

Next we’ll update apt-get and install our build tools and thrift dependencies:

$ sudo apt-get update
$ sudo apt-get -y install subversion g++ make flex bison python-dev libboost-dev libevent-dev automake pkg-config libtool

Also, since we’ll need it later, let’s update CPAN, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Perl module install tool now:

$ sudo perl -MCPAN -e "install Bundle::CPAN"

CPAN takes 10 minutes or so to update. When prompted about “manual configuration”, enter no. Eventually you’ll get 3 more prompts, to which cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 defaults are fine (Update configuration for libnet: no, Perl expression: exit, YAML.pm warning: y). Just hit return at each prompt.

2. Thrift

Now let’s grab thrift from SVN:

$ svn co http://svn.facebook.com/svnroot/thrift/trunk/ thrift
$ cd thrift

Then build and install it (don’t worry about cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 bootstrap.sh warnings):

$ cd thrift
$ ./bootstrap.sh
$ ./configure
$ make
$ sudo make install

Again, this will take a few minutes.

3. Thrift Client Libraries

Now that thrift is installed, we need to install cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 client libraries for whichever language(s) that we’re planning on using. The C++ and Python libraries are installed by default, but this guide will focus on Java, Ruby, Perl as examples. If you get ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r client libraries working, leave a comment with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 steps taken and I’ll amend this post.

For Java, first we need to update Java and ant:

$ sudo apt-get -y install sun-java5-jdk ant

This will take anocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r 5 minutes or so. When prompted with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Java license, hit twice. Now we’ll build and install with:

$ cd lib/java
$ sudo ant install
$ cd ../..

This will install cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 thrift JAR file to /usr/local/lib/libthrift.jar. For cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Perl client libraries, we have anocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r dependency to install:

$ sudo perl -MCPAN -e "install Bit::Vector"

Enter yes at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first prompt, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n accept cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 defaults for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 dozen or so prompts that follow. Now we can build and install:

$ cd lib/perl
$ perl Makefile.PL
$ make
$ sudo make install
$ cd ../..

For cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Ruby client libraries:

$ cd lib/rb/
$ sudo ruby setup.rb install

Please take a look at lib/*/README if you want to install ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r client libraries. Alright, done with thrift.

4. Thrudb Dependencies

Let’s go back to our build dir, and start on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r dependencies for thrudb:

$ cd ..
$ sudo apt-get -y install memcached libexpat1-dev libssl-dev libcurl4-openssl-dev liblog4cxx9-dev uuid-dev libboost-filesystem-dev libmysql++ libdb4.5++-dev

We need Brackup, which has a couple of dependencies. CPAN seems to have trouble installing cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m all in one go, but one at a time seems to work:

$ sudo perl -MCPAN -e "install DBI"
$ sudo perl -MCPAN -e "install DBD::SQLite"
$ sudo perl -MCPAN -e "install Brackup"

These will take a few minutes each. Accept all defaults when prompted.

There are 3 dependencies that we’ll install from source: libmemcached, Spread, and CLucene (since, as of this writing, apt-get has Spread 3.x and we need Spread 4.x; cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 same with CLucene, apt-get has 0.19.x and we need cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 latest from svn).

libmemcached

Now we’ll get, build, and install libmemcached:

$ curl http://download.tangent.org/libmemcached-0.17.tar.gz | tar xzf -
$ cd libmemcached-0.12
$ ./configure
$ make
$ sudo make install
$ cd ..

Spread

Spread requires filling in a form to download it, which will be tricky from cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 command line, but curl to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 rescue (replace cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 values of name, company, and email in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first command with your own information):

$ curl -L -d FILE=spread-src-4.0.0.tar.gz -d name="Thrudb User" -d company="Thrudb User" -d email="unknown@thrudb.org" -d Stage=Download http://www.spread.org/download/spread-src-4.0.0.tar.gz | tar xzf -
$ cd spread-src-4.0.0
$ ./configure
$ make
$ sudo make install
$ cd ..

CLucene

In order to build CLucene, we need libltdl3-dev:

$ sudo apt-get install libltdl3-dev

Now we'll checkout, build, and install cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 latest version of CLucene:

$ svn co https://clucene.svn.sourceforge.net/svnroot/clucene/trunk clucene
$ cd clucene
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Somehow clucene-config.h, which is expected to be in /usr/local/include/CLucene/, but for some reason is actually in /usr/local/lib/CLucene/. To fix this, we just copy cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 file:

$ sudo cp /usr/local/lib/CLucene/clucene-config.h /usr/local/include/CLucene/

Update Shared Libraries

For linking to work right later, we need to update our shared libraries with:

$ sudo /sbin/ldconfig

5. Install Thrudb

Well, if you’ve made it this far, congratulate yourself. We’re now ready to actually install thrudb! First we’ll get it from SVN:

$ svn co http://svn.thrudb.org/thrudb/trunk thrudb
$ cd thrudb

To build and install everything:

$ sudo make

You can build specific portions, thrucommon is required, everything after is if you want it:

$ cd thrucommon
$ ./bootstrap
$ ./configure
$ make all
$ sudo make install

Repeat for each of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 pieces you want, i.e. thrudoc, thrudex, thruqueue, throxy (throxy is not ready yet though).

6. Thrudb Client Libraries and Tutorials

And finally, we just need to build cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 thrudb client libraries (similar to what we did for thrift), and tutorials if we want to test it out.

To build cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 client libraries, you just need to run /usr/local/bin/thrift on Thrudoc.thrift and Thrucene.thrift and specify which language to generate. However, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re’s a handy Makefile in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 tutorial directory that will take care of this for us:

$ cd tutorial
$ make

Start thrudoc and thrucene with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 handy control script:

$ ./thrudbctl start

At last! Unfortunately, since thrudb has been gone under some major changes recently, only Python and Perl tutorials work out of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 box. I'll try to fix ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r tutorials soon, stay tuned!

Let’s run cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Python tutorial:

$ cd python
$ python BookmarkExample.py

You should see something like:

*Indexed file in: 0.20 seconds*

Searching for: tags:(+css +examples)
Found 3 bookmarks
1 title: Dynamic Drive CSS Library- Practical CSS codes and examples
url: (http://www.dynamicdrive.com/style/)
tags: (css examples)
2 title: Dynamic Drive DHTML Scripts -DD Tab Menu (5 styles)
url: (http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm)
tags: (cool css examples menu)
3 title: Uni-Form
url: (http://dnevnikeklektika.com/uni-form/)
tags: (examples CSS)
Took: 0.00 seconds

Searching for: title:(linux)
Found 4 bookmarks
1 title: Debian GNU/Linux System Administration Resources
url: (http://www.debian-administration.org/)
tags: (linux administration tips)
2 title: Linux Scalability
url: (http://www.cs.wisc.edu/condor/condorg/linux_scalability.html)
tags: (linux sysadmin ulimit)
3 title: Set Up Postfix For Relaying Emails Through Anocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r Mailserver | HowtoForge - Linux Howtos and Tutorials
url: (http://www.howtoforge.com/postfix_relaying_through_anocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r_mailserver)
tags: (email linux server)
4 title: ZFS on FUSE/Linux
url: (http://zfs-on-fuse.blogspot.com/)
tags: (zfs linux fuse)
Took: 0.00 seconds

*Index cleared in: 0.06 seconds*

The Perl tutorial needs one more dependency:

$ sudo perl -MCPAN -e "install Class::Accessor"

Again, accept cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 default when prompted. Then run with:

$ cd perl
$ perl BookmarkExample.pl

You should see output similar to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Python example.

7. Next Steps

Congratulations! You now have thrudoc and thrucene running on your own Ubuntu box. From here, you can poke around in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 tutorial directory and have a look at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 *.conf files. You may also want to join discussion list.

Comments