启动安装的zookeeper和kafka
#!/bin/bash # start zookeeper and kafka service echo "========== Start the task =============" echo "========== Zookeeper Starting =========" #cd /opt/ops/zookeeper/zookeeper-3.4.12/bin nohup /opt/ops/zookeeper/zookeeper-3.4.12/bin/zkServer.sh start >/dev/null 2>&1 & sleep 3 echo "========== Kafka Starting =============" #cd /opt/ops/kafka/kafka_2.12-2.0.0/bin nohup /opt/ops/kafka/kafka_2.12-2.0.0/bin/kafka-server-start.sh /opt/ops/kafka/kafka_2.12-2.0.0/config/server.properties >/dev/null 2>&1 & sleep 5 echo "========== Complete startup tasks =====" ./create-topic.sh echo "========== success create topic 'test' ========="