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 ...
随机推荐
- Dapper: How to get return value ( output value) by call stored procedure
使用Dapper 执行存储过程插入一条数据,同时返回主键 Dapper 的参数类型有以下四种 System.Data.ParameterDirection public enum ParameterD ...
- 初入Linux
初步进入linux世界 [Linux 系统启动过程] Linux的启动其实和windows的启动过程很类似,不过windows我们是无法看到启动信息的,而linux启动时我们会看到许多启动信息,例如某 ...
- jmeter使用正则表达式从上一个http响应数据里提取关键字传递给下一个http请求(二)
通过jmeter从表格批量读取数据(一)(http://www.cnblogs.com/lelexiong/p/8728993.html)介绍了从表格批量读取数据,读取数据之后,如果要提取响应数据里面 ...
- jmeter压测学习2-linux运行jmeter环境
前言 使用jmeter做压测的时候,在windows上不太稳定,所有一直在linux服务器上使用jmeter做压力测试. 本篇记录下linux上搭建jmeter环境,以及运行jmeter脚本,查看报告 ...
- Vue之Action
(1)同步与异步 在 mutation 中混合异步调用会导致你的程序很难调试. 例如,当你调用了两个包含异步回调的 mutation 来改变状态,你怎么知道什么时候回调和哪个先回调呢? 这就是为什么我 ...
- python老师博客
前端基础之HTML http://www.cnblogs.com/yuanchenqi/articles/6835654.html 前端基础之CSS http://www.cnblogs.com/yu ...
- Easy-Mock模拟get接口和post接口实例
1.先创建项目,再新建接口 创建项目入口:首页右下角 + 按钮 创建接口入口如下图: 关于mock的语法这里不做说明,可查看mock.js官方查看更详情的资料. 小tip:在Easy-Mock里面支持 ...
- 学习:窗口创建以及消息处理basic.c
WNDCLASS结构: Windows 的窗口总是基于窗口类来创建的,窗口类同时确定了处理窗口消息的窗口过程(回调函数). 在创建应用程序窗口之前,必须调用 RegisterClass 函数来注册窗口 ...
- 文件搜索命令(命令搜索)which、whereis
一.which命令: 搜索命令所在目录(绝对路径)或者别名信息. 用户可以使用的命令存放在: /bin /usr/bin 管理员使用的命令: /sbin /usr/sbin 1.带有别名的命令: 二. ...
- minio gataway 模式快速提供s3 兼容的文件服务
实际很多场景我们已经有了遗留系统的文件存储方式(ftp,或者共享目录),但是这个方式可能不是很好,对于web 不是很友好 实际上minio 也提供了gateway 的模式,可以方便快速的将遗留系统的存 ...