Install Alibaba Tair

This passage mainly introduces how to install Tair, Alibaba’s own distributed key-value storage system. Because of several errors existing in Tair’s source code and out-of-date introduction documentation, we may get into trouble when installing and deploying this system in our own environment. I’ve successfully installed it on my CentOS 7 and will show the whole process here, wishing it can help those who has trapped into a dilemma.


Tair is a distributed key-value storage system delveloped by Alibaba’s Taobao team, the biggest e-commerce platform in China. Tair focuses more on distributed storage and offers features like fault tolerance, pluggable storage, etc. More information can be found here.


Tair is written in C++. Like other C++ programs, it needs to be compiled using different platforms’ compilers before it can be run on corresponding platforms. However, the introduction documentation on the official site is kind of out-of-date and there are some bugs residing in the source code. Hence, installing Tair may be a troublesome work. For me, I solved these problems after several trying and am willing to share my experience with others who’s planning to install it and have a try. Perhaps there may be some little differences on different Linux platforms (What? You’re using Windows? Come on! Serious?), the general process is the same.


Environment

I deploy Tair on CentOS 7. You may choose other Linux distributions but it must be a Linux since Tair uses some Linux-only libraries like epoll. Otherwise you’ll need to do a source code porting first, which can be difficult and time-consuming.

Installation

I. Install svn, g++, automake, libtool, boost-devel and zlib-devel before you proceed to compile Tair and its supporting libraries. You can use a software package management tool on your platform to facilitate your installation, like yum on CentOS.

1
$ yum install svn gcc-c++ automake libtool boost-devel zlib-devel -y

You may need to add sudo in front of the yum command for system permission.

II. Download the source code of Tair’s supporting libraries tbsys and tbnet.

1
$ svn checkout http://code.taobao.org/svn/tb-common-utils/trunk/ tb-common-utils

III. Modify CLogger::CLogger& to CLogger& in the tblog.cpp file (You may skip this step if this bug has been corrected).

IV. Download Tair’s source code.

1
$ svn checkout http://code.taobao.org/svn/tair/trunk/ tair

Beware that there do exist a space between the last “/“ and last tair in the above url. This is definitely not a typo! And you should use svn to get this source code instead of cloning its Github repository. The latter one contains some problems (at least before I write this passage).

V. Configure and make the supporting libraries. First you need to export TBLIB_ROOT to tell the script where you want to put the generated libraries. These libraries will be used in Tair’s compilation later.

1
$ export TBLIB_ROOT=/your/path/to/tair-lib

Then you can configure and make it using the provided build.sh script. If everything is OK, you will see the genearted libraries have now existed in the directory where TBLIB_ROOT points to.

VI. Go to your Tair’s source code directory, make and install Tair as below.

1
2
3
4
$ ./bootstrap.sh
$ ./configure
$ make
$ make install

Now you’ll see a directory called tair_bin locating at your user’s directory. That’s where tair’s binary code resides. Congratulations!

Conclusion

Now you have a runnable Tair on your machine. But in order to run your Tair, you still need to configure your Tair first. For this part, you can refer to this official documentation. Good luck!

文章目录
  1. 1. Environment
  2. 2. Installation
  3. 3. Conclusion
|