Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort out the fs_brokers dir #98

Merged
merged 2 commits into from
Sep 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
sort out the fs_broker dir
  • Loading branch information
morningman-cmy committed Sep 15, 2017
commit dcf35dfa8ce9485195946b81380b5d4fcdf707dd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ curdir=`cd "$curdir"; pwd`
export BROKER_HOME=`cd "$curdir/.."; pwd`
export PID_DIR=`cd "$curdir"; pwd`

#
# JAVA_OPTS
# BROKER_LOG_DIR
export JAVA_OPTS="-Xmx1024m -Dfile.encoding=UTF-8"
export BROKER_LOG_DIR="$BROKER_HOME/log"
# export JAVA_HOME="/usr/java/jdk1.8.0_131"
Expand Down Expand Up @@ -62,12 +59,6 @@ if [ ! -d $BROKER_LOG_DIR ]; then
mkdir -p $BROKER_LOG_DIR
fi

if [ ! -f /bin/limit3 ]; then
LIMIT=
else
LIMIT="/bin/limit3 -c 0 -n 65536"
fi

nohup $LIMIT $JAVA $JAVA_OPTS com.baidu.palo.broker.hdfs.BrokerBootstrap "$@" >$BROKER_LOG_DIR/apache_hdfs_broker.out 2>&1 </dev/null &

echo $! > $pidfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export BROKER_HOME=$ROOT

# Every time, build deps
DEPS_DIR=${BROKER_HOME}/deps
cd ${DEPS_DIR} && sh build_deps.sh
cd ${DEPS_DIR} && sh build.sh
cd ${BROKER_HOME}

# export all variable need by other module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ public static void main(String[] args) {
System.setProperty("BROKER_LOG_DIR", System.getenv("BROKER_LOG_DIR"));
PropertyConfigurator.configure(brokerHome + "/conf/log4j.properties");
Logger logger = Logger.getLogger(BrokerBootstrap.class);
logger.debug("starting apache hdfs broker....");
logger.info("starting apache hdfs broker....");
new BrokerConfig().init(brokerHome + "/conf/apache_hdfs_broker.conf");

TProcessor tprocessor = new TPaloBrokerService.Processor<TPaloBrokerService.Iface>(
new HDFSBrokerServiceImpl());
ThriftServer server = new ThriftServer(BrokerConfig.broker_ipc_port, tprocessor);
server.start();
logger.info("starting apache hdfs broker....succeed");
while (true) {
Thread.sleep(2000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ curdir=`cd "$curdir"; pwd`
export BROKER_HOME=`cd "$curdir/.."; pwd`
export PID_DIR=`cd "$curdir"; pwd`

#
# JAVA_OPTS
# LOG_DIR
export JAVA_OPTS="-Xmx1024m -Dfile.encoding=UTF-8"
export LOG_DIR="$BROKER_HOME/log"
export BROKER_LOG_DIR="$BROKER_HOME/log"
# export JAVA_HOME="/usr/java/jdk1.8.0_131"
# java
if [ "$JAVA_HOME" = "" ]; then
Expand All @@ -49,7 +46,7 @@ while read line; do
fi
done < $BROKER_HOME/conf/baidu_bos_broker.conf

pidfile=$PID_DIR/bos_broker.pid
pidfile=$PID_DIR/baidu_bos_broker.pid

if [ -f $pidfile ]; then
if kill -0 `cat $pidfile` > /dev/null 2>&1; then
Expand All @@ -58,16 +55,10 @@ if [ -f $pidfile ]; then
fi
fi

if [ ! -d $LOG_DIR ]; then
mkdir -p $LOG_DIR
fi

if [ ! -f /bin/limit3 ]; then
LIMIT=
else
LIMIT="/bin/limit3 -c 0 -n 65536"
if [ ! -d $BROKER_LOG_DIR ]; then
mkdir -p $BROKER_LOG_DIR
fi

nohup $LIMIT $JAVA $JAVA_OPTS com.baidu.palo.broker.bos.BrokerBootstrap "$@" >$LOG_DIR/bos_broker.out 2>&1 </dev/null &
nohup $LIMIT $JAVA $JAVA_OPTS com.baidu.palo.broker.bos.BrokerBootstrap "$@" >$BROKER_LOG_DIR/baidu_bos_broker.out 2>&1 </dev/null &

echo $! > $pidfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ while read line; do
fi
done < $BROKER_HOME/conf/baidu_bos_broker.conf

pidfile=$PID_DIR/bos_broker.pid
pidfile=$PID_DIR/baidu_bos_broker.pid

if [ -f $pidfile ]; then
pid=`cat $pidfile`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export BROKER_HOME=$ROOT

# Every time, build deps
DEPS_DIR=${BROKER_HOME}/deps
cd ${DEPS_DIR} && sh build_deps.sh
cd ${DEPS_DIR} && sh build.sh
cd ${BROKER_HOME}

# export all variable need by other module
export PATH=${DEPS_DIR}/bin:$PATH
ANT_HOME=${DEPS_DIR}/ant
export PATH=${ANT_HOME}/bin:$PATH
ant release
ant output
exit
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,24 @@ DEPSDIR=`dirname "$0"`
DEPSDIR=`cd ${DEPSDIR}; pwd`

CURDIR=`pwd`
if [ ! -f ${DEPSDIR}/bin/thrift ]
if [ ! -f ${DEPSDIR}/bin/bce-java-sdk-0.9.1-internal.jar ]
then
echo "***********************************"
echo " Downloading dependency libraries "
echo "***********************************"
cd ${DEPSDIR}
# Check out depends
# extract archive
tar xzf baidu_bos_broker_deps.tar.gz
tar xzf baidu_bos_broker_java_libraries.tar.gz
echo "Unpacking dependency libraries...Done "
else
echo "Depends already exists."
fi

if [ ! -f bin/thrift ];then
echo "thrift is not found."
echo "You need to copy thrift binary file from 'thirdparty/installed/bin/thrift' to $CURDIR"
exit 1
fi

cd ${CURDIR}