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的更多相关文章

  1. Shell Script Notes

    shell Script学习笔记 <鸟哥的Linux私房菜 3rd Edition>: @1:若变量内容中包含空格字符,则可使用双引号"或单引号'将变量内容结合起来,但不同的是: ...

  2. shell及脚本4——shell script

    一.格式 1.1 开头 必须以 "# !/bin/bash"  开头,告诉系统这是一个bash shell脚本.注意#与!中间有空格. 二.语法 2.1 数值运算 可以用decla ...

  3. shell script

    一.shell script的编写与执行 1.shell script 的编写中还需要用到下面的注意事项: a.命令的执行是从上到下,从左到右地分析与执行 b.命令.参数间的多个空白都会被忽略掉 c. ...

  4. 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 ...

  5. (copy) Shell Script to Check Linux System Health

    source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article ...

  6. shell script练习

    执行脚本的几种方式: 1. sh a.sh 或者  bash a.sh  调用的是 /bin/bash 进程执行的,所以脚本不需要执行权限. 2. 直接使用绝对路径执行, /home/script/a ...

  7. 这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script

    这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script ##转载注明出处:http://www.cnblogs.com/wade-xu/p/4378224.html ...

  8. CentOS Linux下一个tomcat起停,查看日志的shell script

    CentOS 的tomcat安装目录:/usr/local/tomcat vi MyTomcatUitl.sh          创建文件chmod u+x MyTomcatUtil.sh   赋执行 ...

  9. 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 ...

随机推荐

  1. TKey SSO 单点登录系统介绍

    Introduction TKey = Token Key 以 OAuth 2.0 标准为接口设计原则的单点登录系统(SSO) 初衷: 做国内各种登录场景的配件,以完善的学习资料为主核心竞争力 纯粹的 ...

  2. php迭代器模式(iterator pattern)

    ... <?php /* The iterator pattern is used to traverse a container and access its elements. In oth ...

  3. Collections.synchronizedList使用

    1.SynchronizedList类具体代码: static class SynchronizedList<E> extends SynchronizedCollection<E& ...

  4. nginx,apache,tomcat的区别

    nginx与apache 这里说的apche指apache http server ,与nginx都属于http服务器软件,主要处理静态资源. http server关心的是http协议层面的传输和访 ...

  5. dotnetcore docker 简单运行

    今天试用了下mac 版本的dotnetcore sdk,发现还是很方便的,同时官方的容器运行方式,相对小了好多 同时使用多阶段构建的方式运行dotnetcore 安装sdk 下载地址: https:/ ...

  6. EF core 性能调优

    Entity Framework Core performance tuning – a worked example Last Updated: February 25, 2019 | Create ...

  7. Javascript的数据类型(原始类型和引用类型)

    1.ECMAScript3中定义了变量可分为原始值和引用值. 原始值:是保存在栈(stack)中的简单数据段:也就是说他们的值是直接存储在变量访问的位置. 引用值:是保存在堆(heap)中的对象,也就 ...

  8. luogu 2742 二维凸包

    链接 luogu 模板一 上下利用斜率求凸包然后合并. #include <bits/stdc++.h> using namespace std; const int N=10005; c ...

  9. Shared Virtual Memory (SVM) Functions

    Description Shared Virtual Memory (SVM) (Glossary): An address space exposed to both the host and th ...

  10. .NET项目发布到本地IIS完整流程(VS2015)

    概要: 一.安装IIS功能 二.建立发布网站 三.发布应用程序 四.发布后各种问题的解决. [可先看概要四,可避免很多坑] 具体操作: 一.安装IIS功能 选择必要的功能进行安装,重启有效. 二.建立 ...