Install Tokyo Tyrant in Linux

WHAT IS TOKYO TYRANT?

Tokyo Cabinet (TC) is a data repository which is tailored for high speed retrieval. It is not a full fledged DBMS like Mysql or MongoDB . At its core, it is a simple key-value lookup database. Any kind of data , binary or character based, can be a key to any kind of value – again binary or character based. It supports very fast updates and retrieval.

Tokyo Tyrant (TT) is the set of packages which allows external programs to work with TC. It provides a set of functions which allows manipulation and retrieval of data with TC. TT acts a server which interacts with TC.

 

TT can be used with several popular languages. Libraries and APIs exist for Perl, Ruby, Java, PHP, Python, C# and others.

INSTALLATION

This article focuses on installing TT on Linux Mint. Most of the steps should be the same in other versions of Linux, with minor differences in commands or locations of the files. TT does not work in Windows as of now.

 

1.Download The Files

Tokyo Cabinet can be downloaded from here: http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz

Tokyo Tyrant can be downloaded from here: http://fallabs.com/tokyotyrant/tokyotyrant-1.1.41.tar.gz

Unarchive the two archive files into their own directories.

TC depends on zlib and bzip2 , so you need to make sure they are already present in your system.

To install zlib, type

sudo apt-get install zlib1g-dev

To install bzip2, type

sudo apt-get install libbz2-dev

 

2.Compile TC

Change current directory to the TC directory which was created after unarchive. eg.

cd tokyocabinet-1.4.48

Run the configuration script:

sudo  ./configure

 

If you get the error message “error: C compiler cannot create executables” it means the gcc compiler is not installed in the system. You will have to install gcc first. . Most Linux Mint systems do not have it as part of the default installation since not everyone wants to do development. To install gcc type:

sudo apt-get install gcc

In case your gcc is up to date, then you need to update the build-essential package:

sudo apt-get install gcc build-essential

 

At this stage sudo ./configure should run fine.

Run the make file

sudo make

Run its self-diagnostics

make check

Run the final install

sudo make install

 

 

3.Compile TT

Change current directory to the TT directory which was created after unarchive. eg.

cd tokyotyrant-1.1.41

Run the configuration script:

sudo  ./configure

 

If you get the error message “error: C compiler cannot create executables” it means the gcc compiler is not installed in the system. You will have to install gcc first. . Most Linux Mint systems do not have it as part of the default installation since not everyone wants to do development. To install gcc type:

sudo apt-get install gcc

In case your gcc is up to date, then you need to update the build-essential package:

sudo apt-get install gcc build-essential

 

At this stage sudo ./configure should run fine.

Run the make file

sudo make

Run install

sudo make install

 

TEST THE INSTALLATION

Open a new terminal window and type

ttserver

This will start the tokyotyrant server

Open another terminal window and go to the tokyotyrant directory eg.

cd tokyotyrant-1.1.41

Type

make check

This will run some diagnostics. Once checking has completed you can stop the ttserver by pressing Ctrl C

 

FINAL WORD

To get more information and help for TokyoTyrant you can go to http://fallabs.com/tokyotyrant/spex.html#serverprog

 

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*