start & stop kafka cluster shell script
kafka_start_cluster.sh
#!/bin/bash
brokers="kafka-server-1 kafka-server-2 kafka-server-3"
KAFKA HOME="/usr/local/software/kafka/kafka2.11-2.1.0"
echo "I NFO : Begin to start kafka cluster ... " for broker in $brokers
do
echo " INFO:Start kafka on { $broker} ssh $broker -C " source /etc/profile ; sh ${KAFKA_HOME}/bin/kafka-server-start.sh -daemon ${KAFKA_HOME}/config/server.properties"
if [ $? -eq ]; then
echo " INFO:[${broker}] Start successfully "
fi done echo " I NFO:Kafka cluster starts successfully !"
kafka_stop_cluster.sh
#!/bin/bash brokers="kafka-server-1 kafka-server-2 kafka-server-3"
KAFKA_HOME="/usr/local/software/kafka/kafka_2.11- 2.1.0"
echo " INFO:Begin to shut down kafka cluster ... " for broker in $brokers
do
echo " INFO:Shut down kafka on ${broker} . . . " ssh $broker -c "source etc/profile;sh ${KAFKA_HOME}/bin/kafka-server-stop.sh"
if [ $? -eq ] ; then
echo " INFO: [${broker)] Shut down completed "
fi
done echo " INFO:Kafka cluster shuts down completed!"
start & stop kafka cluster shell script的更多相关文章
- Shell Script Notes
shell Script学习笔记 <鸟哥的Linux私房菜 3rd Edition>: @1:若变量内容中包含空格字符,则可使用双引号"或单引号'将变量内容结合起来,但不同的是: ...
- shell及脚本4——shell script
一.格式 1.1 开头 必须以 "# !/bin/bash" 开头,告诉系统这是一个bash shell脚本.注意#与!中间有空格. 二.语法 2.1 数值运算 可以用decla ...
- shell script
一.shell script的编写与执行 1.shell script 的编写中还需要用到下面的注意事项: a.命令的执行是从上到下,从左到右地分析与执行 b.命令.参数间的多个空白都会被忽略掉 c. ...
- How to choose the number of topics/partitions in a Kafka cluster?
This is a common question asked by many Kafka users. The goal of this post is to explain a few impor ...
- (copy) Shell Script to Check Linux System Health
source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article ...
- shell script练习
执行脚本的几种方式: 1. sh a.sh 或者 bash a.sh 调用的是 /bin/bash 进程执行的,所以脚本不需要执行权限. 2. 直接使用绝对路径执行, /home/script/a ...
- 这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script
这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script ##转载注明出处:http://www.cnblogs.com/wade-xu/p/4378224.html ...
- CentOS Linux下一个tomcat起停,查看日志的shell script
CentOS 的tomcat安装目录:/usr/local/tomcat vi MyTomcatUitl.sh 创建文件chmod u+x MyTomcatUtil.sh 赋执行 ...
- Shell script for logging cpu and memory usage of a Linux process
Shell script for logging cpu and memory usage of a Linux process http://www.unix.com/shell-programmi ...
随机推荐
- seaborn---画热力图
1.引用形式: seaborn.heatmap(data, vmin=None, vmax=None, cmap=None, center=None, robust=False, annot=None ...
- Alibaba Java Coding Guidelines,以后我的Java代码规范,就靠它了
前言 对于Java代码规范,业界有统一的标准,不少公司对此都有一定的要求.但是即便如此,庞大的Java使用者由于经验很水平的限制,未必有规范编码的意识,而且即便经验丰富的老Java程序员也无法做到时刻 ...
- 葫芦娃团队项目Beta冲刺-总结
课程名称:软件工程1916|W(福州大学) 作业要求:项目Beta冲刺 团队名称:葫芦娃队 作业目标:总结项目冲刺内容 githup地址:https://https://github.com/Baka ...
- python应用-综合应用题解决
题目: A,B,C,D,E五个人捕鱼,不计其数,然后休息, 早上A第一个醒来,将鱼均分成五份,把多余的一条鱼扔掉,拿走自己的一份, B第二个醒来,也将鱼均分为五份,把多余的一条鱼扔掉,拿走自己的一份. ...
- Java Array、List、Set互相转化
https://blog.csdn.net/u014532901/article/details/78820124
- objc_msgSend method_getTypeEncoding 与 @encode
struct objc_method { SEL _Nonnull method_name OBJC2_UNAVAILABLE; cha ...
- 实现:API实现创建用户并且添加至管理员
参考文章:https://www.cnblogs.com/17bdw/p/6790197.html#_label0 利用的API函数: 1.NetUserAdd 2.NetLocalGroupAddM ...
- OpenCV 学习笔记(1-1)opecv3.41及其扩展库在VS2015下配置
其他正常 opencv_aruco341.lib opencv_bgsegm341.lib opencv_bioinspired341.lib opencv_calib3d341.lib opencv ...
- Technocup 2020 Elimination Round 3题解
传送门 \(A\) 曲明连sb模拟不会做,拖出去埋了算了 //quming #include<bits/stdc++.h> #define R register #define fi fi ...
- gethostname、gethostbyname
gethostname():返回本地主机的标准主机名 原型: #include<unistd.h> int gethostname(char *name, size_t len); 参数说 ...