[ https://issues.apache.org/jira/browse/ZOOKEEPER-3322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16856380#comment-16856380 ]
maoling commented on ZOOKEEPER-3322: ------------------------------------ this issue had been solved by the master branch by parsing the clientPort in the *zkServer.sh* {code:java} echo "Usage: $0 [--config <conf-dir>] {start|start-foreground|stop|restart|status|print-cmd}" >&2 esac*) echo "Usage: $0 [--config <conf-dir>] {start|start-foreground|stop|restart|status|print-cmd}" >&2 esac dynamicConfigFile=`$GREP "^[[:space:]]*dynamicConfigFile" "$ZOOCFG" | sed -e 's/.*=//'` clientPortAndAddress=`$GREP "^[[:space:]]*server.$myid=.*;.*" "$dynamicConfigFile" | sed -e 's/.*=//' | sed -e 's/.*;//'` fi if [ ! "$clientPortAndAddress" ] ; then echo "Client port not found. Terminating." exit 1 fi if [[ "$clientPortAndAddress" =~ ^.*:[0-9]+ ]] ; then clientPortAddress=`echo "$clientPortAndAddress" | sed -e 's/:.*//'` fi clientPort=`echo "$clientPortAndAddress" | sed -e 's/.*://'` if [ ! "$clientPort" ] ; then echo "Client port not found. Terminating." exit 1 fi fi echo "Client port found: $clientPort. Client address: $clientPortAddress." STAT=`"$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" "-Dzookeeper.log.file=${ZOO_LOG_FILE}" \ -cp "$CLASSPATH" $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \ $clientPortAddress $clientPort srvr 2> /dev/null \ | $GREP Mode` if [ "x$STAT" = "x" ] then echo "Error contacting service. It is probably not running." exit 1 else echo $STAT exit 0 fi{code} > ./zkServer.sh status failed when reconfig don't write the clientPort into the > zoo.cfg > ------------------------------------------------------------------------------------- > > Key: ZOOKEEPER-3322 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3322 > Project: ZooKeeper > Issue Type: Bug > Reporter: maoling > Assignee: maoling > Priority: Major > > look at my zoo.cfg which don't have the clientPort value when using the > reconfig. > *cat ../conf/zoo.cfg* > reconfigEnabled=true > dataDir=../../zkdata2 > syncLimit=5 > dataLogDir=../../zkdataLog2 > initLimit=10 > tickTime=2000 > dynamicConfigFile=/data/software/zookeeper/zookeeper-test2/conf/zoo.cfg.dynamic.1f00000000 > but look at the cmd:"./zkServer.sh status",it needs this clientPort value > STAT=`"$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" > "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" > "-Dzookeeper.log.file=${ZOO_LOG_FILE}" \ > -cp "$CLASSPATH" $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \ > $clientPortAddress $clientPort srvr 2> /dev/null \ > otw, ./zkServer.sh status will fail. -- This message was sent by Atlassian JIRA (v7.6.3#76005)