Skip to content

Commit fb4803a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
2 parents ccab372 + 925ca02 commit fb4803a

File tree

4 files changed

+65
-48
lines changed

4 files changed

+65
-48
lines changed

.travis.yml

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
11
language: cpp
22
compiler: gcc
3-
env:
4-
- PROTOBUF_VERSION=2.6.1
53
install:
6-
- sudo apt-get install libboost-dev
7-
8-
- wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
9-
- tar xf protobuf-2.6.1.tar.gz
10-
- ( cd protobuf-$PROTOBUF_VERSION && ./configure && make -j4 && sudo make install && sudo ldconfig )
11-
12-
- git clone https://github.com/google/snappy
13-
- ( cd snappy && sh ./autogen.sh && ./configure && make -j4 && sudo make install )
14-
15-
- git clone https://github.com/BaiduPS/sofa-pbrpc
16-
- ( cd sofa-pbrpc && make -j4 && make install )
17-
18-
- wget http://www.us.apache.org/dist/zookeeper/stable/zookeeper-3.4.6.tar.gz
19-
- tar zxvf zookeeper-3.4.6.tar.gz
20-
- ( cd zookeeper-3.4.6/src/c && ./configure --disable-shared && make -j4 && sudo make install )
21-
22-
- git clone https://github.com/schuhschuh/gflags
23-
- ( cd gflags && cmake -DGFLAGS_NAMESPACE=google && make -j4 && sudo make install )
24-
25-
- git clone https://github.com/google/glog
26-
- ( cd glog && git checkout v0.3.3 && ./configure --disable-shared && make -j4 && sudo make install )
27-
28-
- wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-beta.tar.gz
29-
- tar zxvf libunwind-0.99-beta.tar.gz
30-
- ( cd libunwind-0.99-beta && ./configure CFLAGS=-U_FORTIFY_SOURCE && make -j4 && sudo make install )
31-
32-
- wget https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.2.1.tar.gz
33-
- tar zxvf gperftools-2.2.1.tar.gz
34-
- ( cd gperftools-2.2.1 && ./configure && make -j4 && sudo make install )
35-
36-
before_script:
37-
- sed -i 's/^SOFA_PBRPC_PREFIX=.*/SOFA_PBRPC_PREFIX=.\/sofa-pbrpc\/output/' depends.mk
38-
- sed -i 's/^PROTOBUF_PREFIX=.*/PROTOBUF_PREFIX=\/usr\/local/' depends.mk
39-
- sed -i 's/^SNAPPY_PREFIX=.*/SNAPPY_PREFIX=\/usr\/local/' depends.mk
40-
- sed -i 's/^ZOOKEEPER_PREFIX=.*/ZOOKEEPER_PREFIX=\/usr\/local/' depends.mk
41-
- sed -i 's/^GFLAGS_PREFIX=.*/GFLAGS_PREFIX=\/usr\/local/' depends.mk
42-
- sed -i 's/^GLOG_PREFIX=.*/GLOG_PREFIX=\/usr\/local/' depends.mk
43-
- sed -i 's/^GPERFTOOLS_PREFIX=.*/GPERFTOOLS_PREFIX=\/usr\/local/' depends.mk
44-
- sed -i 's/^BOOST_INCDIR=.*/BOOST_INCDIR=\/usr\/local\/include/' depends.mk
45-
4+
- sh -x build.sh
465
script:
47-
- make -j4
6+
- echo "build done"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb $(DEPS_IN
1414
LDPATH += -L./src/leveldb $(DEPS_LDPATH)
1515
CFLAGS += $(OPT) $(INCPATH)
1616
CXXFLAGS += $(OPT) $(INCPATH)
17-
LDFLAGS += $(LDPATH) -lleveldb $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl
17+
LDFLAGS += $(LDPATH) -rdynamic -lleveldb $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl
1818

1919
PROTO_FILES := $(wildcard src/proto/*.proto)
2020
PROTO_OUT_CC := $(PROTO_FILES:.proto=.pb.cc)

build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ mkdir -p ${DEPS_SOURCE} ${DEPS_PREFIX}
1717
cd ${DEPS_SOURCE}
1818

1919
# boost
20-
wget http://softlayer-sng.dl.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.gz
20+
# wget http://softlayer-sng.dl.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.gz
21+
git clone --depth=1 https://github.com/00k/boost
22+
mv boost/boost_1_57_0.tar.gz .
2123
tar zxf boost_1_57_0.tar.gz
2224
rm -rf ${DEPS_PREFIX}/boost_1_57_0
2325
mv boost_1_57_0 ${DEPS_PREFIX}
2426

2527
# protobuf
26-
#wget --no-check-certificate https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
28+
# wget --no-check-certificate https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
2729
git clone --depth=1 https://github.com/00k/protobuf
2830
mv protobuf/protobuf-2.6.1.tar.gz .
2931
tar zxf protobuf-2.6.1.tar.gz
@@ -34,7 +36,7 @@ make install
3436
cd -
3537

3638
# snappy
37-
#wget --no-check-certificate https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz
39+
# wget --no-check-certificate https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz
3840
git clone --depth=1 https://github.com/00k/snappy
3941
mv snappy/snappy-1.1.1.tar.gz .
4042
tar zxf snappy-1.1.1.tar.gz
@@ -104,7 +106,7 @@ make install
104106
cd -
105107

106108
# gperftools (tcmalloc)
107-
#wget --no-check-certificate https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.2.1.tar.gz
109+
# wget --no-check-certificate https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.2.1.tar.gz
108110
git clone --depth=1 https://github.com/00k/gperftools
109111
mv gperftools/gperftools-2.2.1.tar.gz .
110112
tar zxf gperftools-2.2.1.tar.gz

doc/cluster_setup.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Tera集群搭建
2+
============
3+
4+
## 搭建要求
5+
6+
### 系统要求
7+
* Linux系统集群,至少3个节点
8+
9+
### 软件要求
10+
* zookeeper,推荐使用3.3或3.4的stable版本
11+
* HDFS,推荐使用1.2.1版本
12+
13+
## 准备工作
14+
15+
### zookeeper准备工作
16+
1. 搭建zookeeper
17+
1. 请参考 http://zookeeper.apache.org/doc/r3.4.6/zookeeperStarted.html
18+
2. 配置zookeeper
19+
1. 创建一个zk节点作为tera根节点,其下创建3个子节点:*master-lock,ts,kick*
20+
2. 修改根节点和子节点的属性,对tera集群所有节点开放读写权限
21+
22+
### hdfs准备工作
23+
1. 搭建hdfs
24+
1. 请参考 https://hadoop.apache.org/docs/r1.2.1/index.html
25+
2. 配置hdfs
26+
1. 创建一个hdfs目录作为tera的数据根目录
27+
2. 修改目录属性,对tera集群所有节点开放读写权限
28+
29+
### 搭建步骤
30+
1. 构建tera
31+
* 请参考 BUILD文档
32+
2. 部署tera
33+
* 在集群各节点创建tera根目录:*${tera_install}*,其下创建log、data两个子目录
34+
* 将构建生成的build目录的bin、conf拷贝到${tera_install}下面
35+
3. 配置tera
36+
* 用编辑器打开${tera_install}/conf/tera.flag,对下面四项配置进行修改:
37+
```
38+
tera_tabletnode_path_prefix:hdfs上的tera数据目录,如*/user/tera/test/*
39+
tera_tabletnode_cache_paths:ts的本地数据缓存目录,建议指向Flash/SSD硬盘,如*/home/ssd1;/home/ssd2*
40+
tera_zk_addr_list:zookeeper节点ip:port列表,以逗号隔开,如*${host1}:2180,${host2}:2180*
41+
tera_zk_root_path:zookeeper上的tera根节点,如/tera/test
42+
```
43+
其它配置项一般不需要修改,如有需要,请参考src/tera_flag.cc
44+
4. 启动tera
45+
* 在master节点上,执行以下命令
46+
```
47+
cd ${tera_prefix}/bin
48+
nohup ./tera_main --flagfile=../conf/tera.flag --tera_role=master &> ../log/master.stderr &
49+
```
50+
* 在TabletServer节点上,执行以下命令
51+
```
52+
cd ${tera_prefix}/bin
53+
nohup ./tera_main --flagfile=../conf/tera.flag --tera_role=tabletserver &> ../log/tabletserver.stderr &
54+
```
55+
5. 停止tera
56+
* 用kill命令杀掉tera_main对应的进程即可

0 commit comments

Comments
 (0)