#!/bin/bash
zk_home=/home/app/zookeeper
kafka_home=/home/app/kafka
kafka_manager_home=/home/app/kafka/kafka-manager-2.0.0.2
zipkin_home=/home/app/zipkin
zkStart(){
echo ">>>zookeeper 2181 starting..."
cd ${zk_home}/2181/ && zookeeper-3.4.14/bin/zkServer.sh start
sleep 3
echo ">>>zookeeper 2182 starting..."
cd ${zk_home}/2182/ && zookeeper-3.4.14/bin/zkServer.sh start
sleep 3
echo ">>>zookeeper 2183 starting..."
cd ${zk_home}/2183/ && zookeeper-3.4.14/bin/zkServer.sh start
sleep 3
jps | grep QuorumPeerMain
}
kafkaStart(){
echo ">>>kafka 9092 starting..."
cd ${kafka_home}/9092/kafka_2.12-2.2.0/bin/ && ./kafka-server-start.sh -daemon ../config/server.properties
sleep 3
echo ">>>kafka 9093 starting..."
cd ${kafka_home}/9093/kafka_2.12-2.2.0/bin/ && ./kafka-server-start.sh -daemon ../config/server.properties
sleep 3
echo ">>>kafka 9094 starting..."
cd ${kafka_home}/9094/kafka_2.12-2.2.0/bin/ && ./kafka-server-start.sh -daemon ../config/server.properties
sleep 3
jps | grep Kafka
}
kafkaManagerStart(){
echo ">>>kafka-maneger 9090 starting..."
rm -rf ${kafka_manager_home}/RUNNING_PID
nohup ${kafka_manager_home}/bin/kafka-manager -Dconfig.file=${kafka_manager_home}/conf/application.conf -Dhttp.port=9090 >/dev/null 2>&1 &
sleep 3
jps | grep ProdServerStart
}
zipkinStart() {
echo ">>>zipkin-server 9411 starting..."
zipkin_opts="-DKAFKA_TOPIC=zipkin -DKAFKA_BOOTSTRAP_SERVERS=10.30.2.222:9092,10.30.2.222:9093,10.30.2.222:9094 -DSTORAGE_TYPE=elasticsearch -DES_HOSTS=http://10.30.2.222:9200/"
nohup java ${zipkin_opts} -jar ${zipkin_home}/zipkin-server-2.12.9-exec.jar >/dev/null 2>&1 &
sleep 3
ps -ef|grep zipkin-server | grep -v grep
}
case $1 in
zookeeper)
zkStart
;;
kafka)
kafkaStart
;;
kafka-manager)
kafkaManagerStart
;;
zipkin)
zipkinStart
;;
all)
zkStart
kafkaStart
kafkaManagerStart
zipkinStart
;;
esac
centos7 批量启动程序的shell样例
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- start "" ".exe-path"开机点击bat批量自启程序 windows bat 批量启动程序 start
- 一、adb启动 应用程序 (1)查看app包名:进入android操作系统 在root@android:/ # 后...
- 1. 上传文件 假设AspNet Core项目名为xxx,开发完成后发布到文件夹,然后把整个PublishOutp...
- 虽然有一些自动化安装的工具,但是功能越多,越专业的工具,可能也需要越高的学习成本,而我们并非专业运维,但是又必须做...