2011년 8월 4일 목요일

scribe 설치 방법

1.소스다운
> git clone https://github.com/facebook/scribe.git

1.1 미리 설치해야 할것
- fb303(thrift_source/contrib/fb303 에 있음)
- thrift 0.6.1

1.2 설치전에 소스 수정해야함
- 소스 수정은 컴파일 해보고 안되면 해보면 됨
- thrift 0.6.1
-boost 1.4.7
1.2.1 수정1 : thrift 0.6.0 이상에서 수정 필요.
> cd scribe/src/gen-cpp
> emacs scribe_types.cpp
아래 부분을
int _kResultCodeValues[] = {
ResultCode::OK,
ResultCode::TRY_LATER
};

아래와 같이 수정
int _kResultCodeValues[] = {
0,
1
};

1.2.2 수정2 : boost 가 변경되서 수정해야함
> cd scribe/src
> emacs file.cpp
line 248
_return.push_back(dir_iter->filename());
=> _return.push_back(dir_iter->path().string());


2.설치
> cd scribe
> ./bootscrap.sh
> ./configure
> make && sudo make install

3. python lib 설치
> cd scribe/lib/py
> sudo python setup.py install

4. 기타
- boost 설치후 소스 설치후에 libboost_system.so.1.47.0 share object not found error 발생시
> emacs /etc/ld.so.conf
/usr/local/lib 제일 위에 추가하면 됨.

> ldconfig

thrift 0.6.1 소스 설치 방법

libevent, boost 최신 버젼으로 설치하지 않고 패키지로 설치할 경우는
3.1.2 부터 따라 하시면 될꺼 같습니다.

1. libevent lib 설치
- 소스다운
- cd $libevent_source
- ./configure
- make && sudo make install

2. boost lib 소스 설치
- 최신 소스다운 ( 설치한 소스는 boost 1.47)
- cd $boost_source
-./boostrap.sh
-./b2
-./b2 install

3. thrift 설치
- 소스 다운(0.6.1 설치했음)
3.1 설치전에 필요한 파일들
3.1.1  libevent, boost lib 소스로 설치했을 경우

sudo apt-get install automake libtool flex bison pkg-config g++
3.1.2 libevent, boost lib 패키지로 설치할 경우

sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++
3.2 설치시작
./configure
make && sudo make install

- 추가적으로 python lib 설치시
cd ./lib/py
sudo python setup.py install

4. fb303 설치
cd $thrift_source/contrib/fb303
./configure
make && sudo make install

- fbstatus 에러 발생시
cd ./cpp/gen-cpp
fb303_type.cpp 에서

_kfb_statusValues 부분을 아래와 같이 수정
int _kfb_statusValues[] = {
0,
1,
2,
3,
4,
5
}

- python lib 설치
cd $thrift_source/contrib/fb303/py
sudo python setup.py install