diff --git a/be/src/agent/agent_server.cpp b/be/src/agent/agent_server.cpp index 53adfa8ac3cbcf..ba7216bb0ab79f 100644 --- a/be/src/agent/agent_server.cpp +++ b/be/src/agent/agent_server.cpp @@ -74,11 +74,11 @@ AgentServer::AgentServer(ExecEnv* exec_env, } // create tmp dir - boost::filesystem::path tmp_path(config::agent_tmp_dir); - if (boost::filesystem::exists(tmp_path)) { - boost::filesystem::remove_all(tmp_path); - } - boost::filesystem::create_directories(config::agent_tmp_dir); +// boost::filesystem::path tmp_path(config::agent_tmp_dir); +// if (boost::filesystem::exists(tmp_path)) { +// boost::filesystem::remove_all(tmp_path); +// } +// boost::filesystem::create_directories(config::agent_tmp_dir); // init task worker pool _create_table_workers = new TaskWorkerPool( diff --git a/be/src/olap/olap_rootpath.cpp b/be/src/olap/olap_rootpath.cpp index ba18e3acb3a204..a102b3a56d6a7c 100644 --- a/be/src/olap/olap_rootpath.cpp +++ b/be/src/olap/olap_rootpath.cpp @@ -111,7 +111,7 @@ OLAPStatus OLAPRootPath::init() { return OLAP_ERR_MALLOC_ERROR; } - _unused_flag_path = string(getenv("PALO_HOME")) + UNUSED_PREFIX; + _unused_flag_path = string(getenv("LOG_DIR")) + UNUSED_PREFIX; if (!check_dir_existed(_unused_flag_path)) { if ((res = create_dir(_unused_flag_path)) != OLAP_SUCCESS) { OLAP_LOG_WARNING("fail to create unused flag path.[path='%s']", diff --git a/be/src/runtime/tmp_file_mgr.cc b/be/src/runtime/tmp_file_mgr.cc index 340024b54a8797..705b70e4780f98 100644 --- a/be/src/runtime/tmp_file_mgr.cc +++ b/be/src/runtime/tmp_file_mgr.cc @@ -59,7 +59,7 @@ TmpFileMgr::TmpFileMgr() : _num_active_scratch_dirs_metric(NULL), _active_scratch_dirs_metric(NULL) {} Status TmpFileMgr::init(MetricGroup* metrics) { - std::string tmp_dirs_spec = config::query_scratch_dirs; + std::string tmp_dirs_spec = config::storage_root_path; vector all_tmp_dirs; // Empty string should be interpreted as no scratch if (!tmp_dirs_spec.empty()) { diff --git a/be/src/service/palo_main.cpp b/be/src/service/palo_main.cpp index 92f089b94aa133..1ae8e7e48a05c1 100644 --- a/be/src/service/palo_main.cpp +++ b/be/src/service/palo_main.cpp @@ -73,7 +73,7 @@ int main(int argc, char** argv) { using std::string; // open pid file, obtain file lock and save pid - string pid_file = string(getenv("PALO_HOME")) + "/bin/be.pid"; + string pid_file = string(getenv("PID_DIR")) + "/be.pid"; int fd = open(pid_file.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (fd < 0) { fprintf(stderr, "fail to create pid file."); diff --git a/bin/start_be.sh b/bin/start_be.sh index 285035ff8ef237..d9a908d56d4d29 100755 --- a/bin/start_be.sh +++ b/bin/start_be.sh @@ -24,8 +24,10 @@ export PALO_HOME=`cd "$curdir/.."; pwd` # # UDF_RUNTIME_DIR # LOG_DIR +# PID_DIR export UDF_RUNTIME_DIR=${PALO_HOME}/lib/udf-runtime export LOG_DIR=${PALO_HOME}/log +export PID_DIR=`cd "$curdir"; pwd` while read line; do envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` @@ -35,11 +37,17 @@ while read line; do fi done < $PALO_HOME/conf/be.conf -mkdir -p $LOG_DIR -mkdir -p ${UDF_RUNTIME_DIR} +if [ ! -d $LOG_DIR ]; then + mkdir -p $LOG_DIR +fi + +if [ ! -d $UDF_RUNTIME_DIR ]; then + mkdir -p ${UDF_RUNTIME_DIR} +fi + rm -f ${UDF_RUNTIME_DIR}/* -pidfile=$curdir/be.pid +pidfile=$PID_DIR/be.pid if [ -f $pidfile ]; then if flock -nx $pidfile -c "ls > /dev/null 2>&1"; then diff --git a/bin/start_fe.sh b/bin/start_fe.sh index 866ebf12fd8eff..6f801d0511c05d 100755 --- a/bin/start_fe.sh +++ b/bin/start_fe.sh @@ -24,8 +24,10 @@ export PALO_HOME=`cd "$curdir/.."; pwd` # # JAVA_OPTS # LOG_DIR +# PID_DIR export JAVA_OPTS="-Xmx1024m" export LOG_DIR="$PALO_HOME/log" +export PID_DIR=`cd "$curdir"; pwd` while read line; do envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` @@ -52,10 +54,11 @@ for f in $PALO_HOME/lib/kudu-client/*.jar; do done export CLASSPATH=${CLASSPATH}:${PALO_HOME}/lib +if [ ! -d $LOG_DIR ]; then + mkdir -p $LOG_DIR +fi -mkdir -p $LOG_DIR - -pidfile=$curdir/fe.pid +pidfile=$PID_DIR/fe.pid if [ -f $pidfile ]; then if kill -0 `cat $pidfile` > /dev/null 2>&1; then diff --git a/bin/stop_be.sh b/bin/stop_be.sh index dacae7889caf37..afec60e0299681 100755 --- a/bin/stop_be.sh +++ b/bin/stop_be.sh @@ -18,7 +18,18 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` -pidfile=$curdir/be.pid +export PALO_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` + +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $PALO_HOME/conf/be.conf + +pidfile=$PID_DIR/be.pid if [ -f $pidfile ]; then pid=`cat $pidfile` diff --git a/bin/stop_fe.sh b/bin/stop_fe.sh index bd09d8a5a701e8..7229702b90ccca 100755 --- a/bin/stop_fe.sh +++ b/bin/stop_fe.sh @@ -18,7 +18,18 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` -pidfile=$curdir/fe.pid +export PALO_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` + +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $PALO_HOME/conf/fe.conf + +pidfile=$PID_DIR/fe.pid if [ -f $pidfile ]; then pid=`cat $pidfile` diff --git a/fs_brokers/apache_hdfs_broker/bin/start_hdfs_broker.sh b/fs_brokers/apache_hdfs_broker/bin/start_hdfs_broker.sh index 29a90c0f6cc486..d8c16bbeabcd0c 100755 --- a/fs_brokers/apache_hdfs_broker/bin/start_hdfs_broker.sh +++ b/fs_brokers/apache_hdfs_broker/bin/start_hdfs_broker.sh @@ -19,6 +19,7 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` export BROKER_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` # # JAVA_OPTS @@ -40,7 +41,15 @@ for f in $BROKER_HOME/lib/*.jar; do done export CLASSPATH=${CLASSPATH}:${BROKER_HOME}/lib -pidfile=$curdir/apache_hdfs_broker.pid +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $BROKER_HOME/conf/apache_hdfs_broker.conf + +pidfile=$PID_DIR/apache_hdfs_broker.pid if [ -f $pidfile ]; then if kill -0 `cat $pidfile` > /dev/null 2>&1; then diff --git a/fs_brokers/apache_hdfs_broker/bin/stop_hdfs_broker.sh b/fs_brokers/apache_hdfs_broker/bin/stop_hdfs_broker.sh index 3c1552d3331496..90f234bad73f7b 100755 --- a/fs_brokers/apache_hdfs_broker/bin/stop_hdfs_broker.sh +++ b/fs_brokers/apache_hdfs_broker/bin/stop_hdfs_broker.sh @@ -18,7 +18,18 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` -pidfile=$curdir/apache_hdfs_broker.pid +export BROKER_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` + +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $BROKER_HOME/conf/apache_hdfs_broker.conf + +pidfile=$PID_DIR/apache_hdfs_broker.pid if [ -f $pidfile ]; then pid=`cat $pidfile` diff --git a/fs_brokers/baidu_bos_broker/bin/start_bos_broker.sh b/fs_brokers/baidu_bos_broker/bin/start_bos_broker.sh index b1a18735c034fc..c1310058dc6572 100755 --- a/fs_brokers/baidu_bos_broker/bin/start_bos_broker.sh +++ b/fs_brokers/baidu_bos_broker/bin/start_bos_broker.sh @@ -19,6 +19,7 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` export BROKER_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` # # JAVA_OPTS @@ -40,7 +41,15 @@ for f in $BROKER_HOME/lib/*.jar; do done export CLASSPATH=${CLASSPATH}:${BROKER_HOME}/lib -pidfile=$curdir/bos_broker.pid +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $BROKER_HOME/conf/baidu_bos_broker.conf + +pidfile=$PID_DIR/bos_broker.pid if [ -f $pidfile ]; then if kill -0 `cat $pidfile` > /dev/null 2>&1; then diff --git a/fs_brokers/baidu_bos_broker/bin/stop_bos_broker.sh b/fs_brokers/baidu_bos_broker/bin/stop_bos_broker.sh index c6edaee904050b..aa3535f0755aa4 100755 --- a/fs_brokers/baidu_bos_broker/bin/stop_bos_broker.sh +++ b/fs_brokers/baidu_bos_broker/bin/stop_bos_broker.sh @@ -18,7 +18,18 @@ curdir=`dirname "$0"` curdir=`cd "$curdir"; pwd` -pidfile=$curdir/bos_broker.pid +export BROKER_HOME=`cd "$curdir/.."; pwd` +export PID_DIR=`cd "$curdir"; pwd` + +while read line; do + envline=`echo $line | sed 's/[[:blank:]]*=[[:blank:]]*/=/g' | sed 's/^[[:blank:]]*//g' | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="` + envline=`eval "echo $envline"` + if [[ $envline == *"="* ]]; then + eval 'export "$envline"' + fi +done < $BROKER_HOME/conf/baidu_bos_broker.conf + +pidfile=$PID_DIR/bos_broker.pid if [ -f $pidfile ]; then pid=`cat $pidfile`