Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Fix nexus related scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai-Zhang committed Jul 10, 2017
1 parent bb4809f commit 6bdc593
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
19 changes: 11 additions & 8 deletions build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ if [ ! -f "${FLAG_DIR}/snappy_1_1_1" ] \
fi

# sofa-pbrpc
if [ ! -f "${FLAG_DIR}/sofa-pbrpc_1_0_0" ] \
if [ ! -f "${FLAG_DIR}/sofa-pbrpc_1_1_3" ] \
|| [ ! -f "${DEPS_PREFIX}/lib/libsofa-pbrpc.a" ] \
|| [ ! -d "${DEPS_PREFIX}/include/sofa/pbrpc" ]; then
wget --no-check-certificate -O sofa-pbrpc-1.1.2.tar.gz https://github.com/baidu/sofa-pbrpc/archive/v1.1.2.tar.gz
tar zxf sofa-pbrpc-1.1.2.tar.gz
cd sofa-pbrpc-1.1.2
wget --no-check-certificate -O sofa-pbrpc-1.1.3.tar.gz https://github.com/baidu/sofa-pbrpc/archive/v1.1.3.tar.gz
tar zxf sofa-pbrpc-1.1.3.tar.gz
cd sofa-pbrpc-1.1.3
sed -i '/BOOST_HEADER_DIR=/ d' depends.mk
sed -i '/PROTOBUF_DIR=/ d' depends.mk
sed -i '/SNAPPY_DIR=/ d' depends.mk
Expand All @@ -91,7 +91,7 @@ if [ ! -f "${FLAG_DIR}/sofa-pbrpc_1_0_0" ] \
make -j4
make install
cd ..
touch "${FLAG_DIR}/sofa-pbrpc_1_0_0"
touch "${FLAG_DIR}/sofa-pbrpc_1_1_3"
fi

# cmake for gflags
Expand Down Expand Up @@ -188,10 +188,13 @@ if [ ! -f "${FLAG_DIR}/ins" ] \
git clone https://github.com/baidu/ins
cd ins
sed -i "s|^PREFIX=.*|PREFIX=${DEPS_PREFIX}|" Makefile
sed -i "s|^PROTOC=.*|PROTOC=${DEPS_PREFIX}/bin/protoc|" Makefile
export PROTOC=${DEPS_PREFIX}/bin/protoc
export SNAPPY_PATH=${DEPS_PREFIX}
export BOOST_PATH=${DEPS_PREFIX}/boost_1_57_0
make -j4 ins >/dev/null && make -j4 install_sdk >/dev/null
mkdir -p output/bin && cp ins output/bin
export GFLAGS_PATH=${DEPS_PREFIX}
export PROTOBUF_PATH=${DEPS_PREFIX}
export PBRPC_PATH=${DEPS_PREFIX}
make -j4 >/dev/null && make -j4 install_sdk >/dev/null
cd -
touch "${FLAG_DIR}/ins"
fi
Expand Down
18 changes: 9 additions & 9 deletions sandbox/start_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ function assert_process_ok() {
}

# copy files
cp -rf ../thirdsrc/ins/output/bin/ins ./
cp -rf ../thirdsrc/ins/output/bin/nexus ./
cp -rf ../resman ./
cp -rf ../agent ./
cp -rf ../appmaster ./
cp -rf ../appworker ./
cp -rf ../galaxy_client ./
cp -rf ../galaxy_res_client ./

# prepare ins.flag
echo "--cluster_members=$SERVERS" >ins.flag
# prepare nexus.flag
echo "--cluster_members=$SERVERS" >nexus.flag

# 1.start nexus
echo "start nexus"
nohup ./ins --flagfile=ins.flag --server_id=1 >/dev/null 2>&1 &
nohup ./ins --flagfile=ins.flag --server_id=2 >/dev/null 2>&1 &
nohup ./ins --flagfile=ins.flag --server_id=3 >/dev/null 2>&1 &
nohup ./ins --flagfile=ins.flag --server_id=4 >/dev/null 2>&1 &
nohup ./ins --flagfile=ins.flag --server_id=5 >/dev/null 2>&1 &
nohup ./nexus --flagfile=nexus.flag --server_id=1 >/dev/null 2>&1 &
nohup ./nexus --flagfile=nexus.flag --server_id=2 >/dev/null 2>&1 &
nohup ./nexus --flagfile=nexus.flag --server_id=3 >/dev/null 2>&1 &
nohup ./nexus --flagfile=nexus.flag --server_id=4 >/dev/null 2>&1 &
nohup ./nexus --flagfile=nexus.flag --server_id=5 >/dev/null 2>&1 &
sleep 10
assert_process_ok "./ins --flagfile=ins.flag"
assert_process_ok "./nexus --flagfile=nexus.flag"

# prepare galaxy.flag
echo "--logbufsecs=0" >> galaxy.flag
Expand Down
6 changes: 3 additions & 3 deletions sandbox/stop_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ killall resman
killall agent

# 5.stop nexus
killall ins
killall nexus

rm -rf ./ins ./appmaster ./appworker ./resman ./agent ./galaxy_client ./galaxy_res_client
rm -rf /ins.flag ./galaxy.flag
rm -rf ./nexus ./appmaster ./appworker ./resman ./agent ./galaxy_client ./galaxy_res_client
rm -rf ./nexus.flag ./galaxy.flag
rm -rf ./binlog *.log *.INFO* *.WARNING*
rm -rf ./data ./gc_dir/ ./work_dir/

0 comments on commit 6bdc593

Please sign in to comment.