开启 kafka

使用他吧

cd /home/bot/opt/kafka || exit 1
echo "zookeeper stop..."
RUN_TASKS_COMMAND="bin/zookeeper-server-stop.sh"
eval "$RUN_TASKS_COMMAND"
echo "zookeeper stop done"

echo "zookeeper start..."
RUN_TASKS_COMMAND="bin/zookeeper-server-start.sh config/zookeeper.properties"
eval "$RUN_TASKS_COMMAND >  /dev/null 2>&1 &"
sleep 3
task_pid=$!
echo "zookeeper pid is $task_pid"
echo "zookeeper start done"

netstat -antup|grep "$task_pid"

# ----------------------------------

cd /home/bot/opt/kafka || exit 1
echo "kafka stop..."
RUN_TASKS_COMMAND="bin/kafka-server-stop.sh"
eval "$RUN_TASKS_COMMAND"
echo "kafka stop done"

echo "kafka start..."
RUN_TASKS_COMMAND="bin/kafka-server-start.sh config/server.properties"
eval "$RUN_TASKS_COMMAND >  /dev/null 2>&1 &"
sleep 3
task_pid=$!
echo "kafka pid is $task_pid"
echo "kafka start done"

netstat -antup|grep "$task_pid"

你可能感兴趣的:(kafka)