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 ...
随机推荐
- JSR303/JSR-349,hibernate validation,spring validation 之间的关系
JSR303是一项标准,JSR-349是其的升级版本,添加了一些新特性,他们规定一些校验规范即校验注解,如@Null,@NotNull,@Pattern,他们位于javax.validation.co ...
- wordpress去掉自定义菜单的外层div
wordpress调用自定义菜单时自动会在外层加一个<div class="menu-nav-container">,如下图所示,nav是后台定义的菜单名称,如果想把这 ...
- Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest
Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) 把commons-ileu ...
- SparkStreaming 性能、稳定、容错与语义
怎样提高Spark Streaming的性能 1.创建多个接收器 待定:: 2.调节每一个batch interval的数据块的数量,其实就是调整上面第二个问题中提到的配置spark.stream ...
- LeetCode 737. Sentence Similarity II
原题链接在这里:https://leetcode.com/problems/sentence-similarity-ii/ 题目: Given two sentences words1, words2 ...
- where与having 的区别
二者的区别在于作用对象不同. where子句作用于基本表或视图,从中选择满足条件的一行或多行元祖. having短语作用于组,从中选择满足条件的组.这些组应该由group by 短句来进行分组.
- [RN] React Native Fetch请求设置超时
一.实现思路 根据Promise.race的特性,我们在Promise.race里面添加两个任务,一个是正常的网络请求任务A,另外一个便是网络延时任务B,网络延时可以利用setTimeout方法实现. ...
- PHP常用的魔术方法及规则
1. __construct 具有构造函数的类会在每次创建新对象时先调用此方法;初始化工作执行.2. __desstruct 对象的所有引用都被删除或者当对象被显式销毁时执行.3.__call()在对 ...
- DIP大作业---图像分割
数字图像处理课程的大作业,要求如下: 图像分割就是把图像分成若干个特定的.具有独特性质的区域并提出感兴趣目标的技术和过程.它是由图像处理到图像分析的关键步骤.现有的图像分割方法主要分以下几类:基于阈值 ...
- 洛谷 P5614题解
吐槽:数据好像有点水,直接枚举到200可以得80 points. 另:我还是太弱了,比赛的时候只有90 points,#7死卡不过去,最后发现是没有判断 \(z_1\) 和 \(z_2\) 的范围-- ...