Tokyo tyrant: How to set up TT server Tokyo tyrant and Tokyo Cabinet

Source: Internet
Author: User
Tags egrep

A tt server has been built over the past two days. It is a cache server written in Japan. The performance is said to be much higher than that of memcached. The specific parameters are unknown.

The first task of the past two days is to build a Linux system. The main reason is that the Linux system is too weak.

1. install it on your own under the root account. The installation is smooth, and everything is okay. It is actually the most basic installation, so there will be no problems.

2. It is impossible to provide root permissions in the test environment. Therefore, you must avoid root permissions for installation, which leads to various problems.

When installing Tokyo Cabinet, the following error occurs:

Configure: Error: bzlib. H is required

Solution 1:

 
  Apt-Get install libbz2-Dev

In this way, I can solve the problem under the root permission, OK, or root will not encounter problems

But what are you willing to do?

Because two dependent packages are missing for installation (not accurate)

1. zlib-1.2.4

2. bzip2-1.0.5

I said on the Internet that I had to go smoothly, but I didn't go to verify it. I only installed it in the above Order.

Zlib installation:

./Configure

Make

Make install

Bzip Installation

Make

Make install

 

Then install Tokyo cabinet.

./Configure

An error may still be reported at this time.Configure: Error: bzlib. H is requiredBut in the specified -- prefix, you may see it, but this error will still be reported, see config. log, the path it is looking for is still in/usr, not me. the position in -- prefix specified in/configure. At this time. /configure, you need to add two more parameters

-- With-zlib: specifies its path. For details, see./configure -- help. You have taken a lot of detours, mainly because you have no help for configure.

After configure, it may still be reported that libbz2.h cannot be found, so you need to continue the parameter -- With-bzip location in configure.

 

When installing Tokyo tyrant, there may still be similar errors, and the location is also specified to solve them.

The installation sequence can be completed according to the documents of Tokyo cabinet and Tokyo tyrant.

 

The following error occurs when you make install.

 

If uname-A | egrep-I 'sunos '>/dev/NULL; \ then \ gcc-g-O2-STD = c99-wall-FPIC-fsigned-Char-O2-shared-wl,-G,-h, libtokyocabinet. so.9-O libtokyocabinet. so.9.6.0 \ tcutil. O tchdb. O tcbdb. O tcfdb. O tctdb. O tcadb. O myconf. O md5.o-L. -L/home/Laurence/TT/TC/lib-L/home/Laurence/lib-L/usr/local/lib-lbz2-LZ-LRT-lpthread-lm-lC; \ else \ gcc-g-O2-STD = c99-wall-FPIC-fsigned-Char-O2-shared-wl,-soname, libtokyocabinet. so.9-O libtokyocabinet. so.9.6.0 \ tcutil. O tchdb. O tcbdb. O tcfdb. O tctdb. O tcadb. O myconf. O md5.o-L. -L/home/Laurence/TT/TC/lib-L/home/Laurence/lib-L/usr/local/lib-lbz2-LZ-LRT-lpthread-lm-lC; \ fi/usr/bin/ld:/usr/local/lib/libbz2.a (bzlib. o): Relocation r_x86_64_32s against 'a local sympost' can not be used when making a shared object; recompile with-FPIC/usr/local/lib/libbz2.a: cocould not read symbols: bad valuecollect2: LD returned 1 exit statusmake: *** [libtokyocabinet. so.9.6.0] Error 1


To facilitate searching, paste it again.

If uname-A | egrep-I 'sunos '>/dev/NULL ;\
Then \
Gcc-g-O2-STD = c99-wall-FPIC-fsigned-Char-O2-shared-wl,-G,-h, libtokyocabinet. so.9-O libtokyocabinet. so.9.6.0 \
Tcutil. O tchdb. O tcbdb. O tcfdb. O tctdb. O tcadb. O myconf. O md5.o-L. -L/home/Laurence/TT/TC/lib-L/home/Laurence/lib-L/usr/local/lib-lbz2-LZ-LRT-lpthread-lm-lC; \
Else \
Gcc-g-O2-STD = c99-wall-FPIC-fsigned-Char-O2-shared-wl,-soname, libtokyocabinet. so.9-O libtokyocabinet. so.9.6.0 \
Tcutil. O tchdb. O tcbdb. O tcfdb. O tctdb. O tcadb. O myconf. O md5.o-L. -L/home/Laurence/TT/TC/lib-L/home/Laurence/lib-L/usr/local/lib-lbz2-LZ-LRT-lpthread-lm-lC; \
Fi
/Usr/bin/ld:/usr/local/lib/libbz2.a (bzlib. o): Relocation r_x86_64_32s against 'a local sympost' can not be used when making a shared object; recompile with-FPIC
/Usr/local/lib/libbz2.a: cocould not read symbols: Bad Value
Collect2: LD returned 1 exit status
Make: *** [libtokyocabinet. so.9.6.0] Error 1

This prompt is obvious. You need to re-compile and add the parameter-FPIC.

How can this problem be solved?

1. zlib-1.2.4

Before make, modify makefile

Cc = gcc-FPIC

Cflags =-O3-FPIC-D_largefile64_source = 1
# Cflags =-o-dmax_wbits = 14-dmax_mem_level = 7
# Cflags =-g-ddebug
# Cflags =-O3-wall-wwrite-strings-wpointer-Arith-wconversion \
#-Wstrict-prototypes-wmissing-prototypes

The first is the outermost layer. I added

Remember to make clean before make or before configure, or delete all the content in the prefix parameter of the specified directory. This is thorough and violent.

 

2. bzip2-1.0.5

Same as above, modify makefile,

# To assist in cross-Compiling
Cc = gcc-FPIC
AR = ar
Ranlib = ranlib
Ldflags =

Bigfiles =-d_file_offset_bits = 64
Cflags =-wall-winline-O2-FPIC-G $ (bigfiles)

Then make and make install

In this way, together with the above, I have not encountered any exception and can start it normally. There are many methods on the Internet, but this method is the best practice to solve the problem I encountered, maybe you haven't encountered any other problems.

 

Issues to be followed up:

1. zlib-1.2.4

2. bzip2-1.0.5

The above two packages are only used for Linux compression.

3.-significance of FPIC Parameters

I have not conducted my own research

Solve the problem by Google

Mainly from: http://henry2009.javaeye.com/blog/462705 this is my master, I basically this solution

And: http://blog.csdn.net/pwlazy/archive/2010/02/20/5313405.aspx solves the problem of installation under my root permission, or has a higher permission is OK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.