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 ...
随机推荐
- 2016年的EK工具
什么是Exploit Kit? 预打包了安装程序.控制面板.恶意代码以及相当数量的攻击工具.通常基于PHP的一个软件. Exploit Kit经济体制 价格在成百上千美元: 可以按日/周/月来付租金: ...
- rsa 解密过程
直接扣js代码 $w = {}; if (typeof $w.RSAUtils === 'undefined') var RSAUtils = $w.RSAUtils = {}; var biRadi ...
- mysql 事件计划
一.开启mysql事件计划 首先在sql中查询计划事件的状态:SHOW VARIABLES LIKE 'event_scheduler'如果返回的是off表示当前是关闭状态,如果是on当前已经开启了计 ...
- python应用-craps赌博游戏
from random import randint face1=randint(1,6) face2=randint(1,6) first_point=face1+face2 print('玩家摇出 ...
- Spring Boot 缓存 知识点
每次调用需要缓存功能的方法时,Spring会检查指定参数的指定的目标方法是否已经被调用过:如果有就直接从缓存中获取方法调用后的结果,如果没有就调用方法并缓存结果后返回给用户.下次调用直接从缓存中获取. ...
- flayboard(纯属娱乐,别人做的)
<iframe id="iframe" src="" frameborder="0" width="100%" h ...
- UFUN函数 UF_CURVE函数(UF_CURVE_create_line、UF_CURVE_create_arc、UF_CURVE_ask_arc_data、UF_CURVE_ask_line_data)
UF_initialize(); //CSYS_ask_wcs tag_t wcs_id=NULL_TAG; //CSYS_ask_csys_info ]={0.0}; //CURVE_create_ ...
- timeout/timelimit
timelimit
- bzoj1935: [Shoi2007]Tree 园丁的烦恼lowbit 离散化
链接 bzoj 最好不要去luogu,数据太水 思路 一个询问转化成四个矩阵,求起点\((0,0)到(x,y)\)的矩阵 离线处理,离散化掉y,x不用离散. 一行一行的求,每次处理完一行之后下一行的贡 ...
- A~G)C004
AGC004 A Divide a Cuboi 我不会,谁能教教我/kk https://agc004.contest.atcoder.jp/submissions/7919351 B Colorfu ...