In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Write kafka cluster start and stop scripts
[hadoop@kafka01-55-11 scripts] $cat Kafka clustermakers stop.shedding cards binapping Bash-x#date 20190801#autnor majihuiclush-g all "source / etc/profile; jps | grep Kafka | awk'{print $1}'| xargs kill-9" [hadoop@kafka01-55-11 scripts] $cat kafka_cluster_start.sh #! / bin/bash-x#author majihui#date 20190801clush-g all "source / etc/profile; jps | grep Kafka | awk'{print $1}'| xargs kill-9" sleep 3clush-g all "source / etc/profile / home/hadoop/kafka/bin/kafka-server-start.sh-daemon / home/hadoop/kafka/config/server.properties "
His output log is in
[hadoop@kafka01-55-11 scripts] $ls-l ~ / kafka/logs/total 164When RW Aug RW Aug-1 hadoop hadoop 316 Aug 2 17:25 controller.log-rw-rw-r-- 1 hadoop hadoop 0 Aug 2 17:25 kafka-authorizer.log-rw-rw-r-- 1 hadoop hadoop 0 Aug 2 17:25 kafka-request.log-rw-rw-r-- 1 hadoop hadoop 6123 Aug 2 17:25 kafkaServer-gc.log.0.current-rw- Rw-r-- 1 hadoop hadoop 54058 Aug 2 17:25 kafkaServer.out-rw-rw-r-- 1 hadoop hadoop 54058 Aug 2 17:25 log-cleaner.log-rw-rw-r-- 1 hadoop hadoop 54058 Aug 2 17:25 server.log-rw-rw-r-- 1 hadoop hadoop 33737 Aug 2 17:25 state-change.log [hadoop@kafka01-55-11 scripts] $cat / etc/clustershell/groupsall: kafka01-55-11 kafka02-55-12 kafka03-55-13kafka_slave: kafka02-55-12 kafka03-55-13
Zookeeper start and stop scripts
[hadoop@kafka01-55-11 scripts] $cat zookeeper_cluster_stop.sh #! / bin/bash-x#author:majihui#date:20190801clush-g all "source / etc/profile; zkServer.sh stop" [hadoop@kafka01-55-11 scripts] $cat zookeeper_cluster_start.sh / / this specifies the zookeeper.out output to / data/zookeeper/data/zookeeper.out #! / bin/bash-x#author:majihui#date:20190801clush-g all "source / etc/profile Cd / data/zookeeper/data & & zkServer.sh start | sort "sleep 3clush-g all" source / etc/profile ZkServer.sh status | sort "[hadoop@kafka03-55-13] pwd/data/zookeeper/data [hadoop@kafka03-55-13 data] $lltotal 20 hadoop hadoop 2 Aug 1 01:04 myiddrwxrwxr-x 2 hadoop hadoop 45 Aug 1 01:33 version-2-rw-rw-r-- 1 hadoop hadoop 11623 Aug 1 01:33 zookeeper.out-rw-rw-r-- 1 hadoop hadoop 5 Aug 1 01:33 zookeeper_ server.pid [Hadoop @ kafka01-55- 11 scripts] $cat jps_cluster_check.sh #! / bin/bashclush-g all "source / etc/profile Jps | sort "
The above startup script has been written
Need to combine with clush
[hadoop@kafka01-55-11 scripts] $cat / etc/clustershell/groupsall: kafka01-55-11 kafka02-55-12 kafka03-55-13kafka_slave: kafka02-55-12 kafka03-55-13 [hadoop@kafka01-55-11 scripts] $lltotal 28 scripts RWMART-1 hadoop hadoop 57 Aug 1 15:01 jps_cluster_check.sh-rw-rw-r-- 1 hadoop hadoop 312 Aug 1 14:51 kafka_cluster_start.sh-rw-rw-r-- 1 hadoop hadoop 132 Aug 1 14:43 kafka_cluster_stop.sh-rw-rw-r-- 1 hadoop hadoop 291 Aug 1 14:23 start_kafka_manager.sh-rw-rw-r-- 1 hadoop hadoop 286 Aug 1 14:28 stop_kafka_manager.sh-rw-rw-r-- 1 hadoop hadoop 176 Aug 1 14:57 zookeeper_cluster_start.sh-rw-rw-r-- 1 hadoop hadoop 101 Aug 1 14:56 zookeeper_cluster_ stop.sh [Hadoop @ kafka01-55-11 scripts] $chmod + x * sh [hadoop@kafka01-55-11 scripts] $lltotal 28-rwxrwxr-x 1 hadoop hadoop 57 Aug 1 15:01 jps_cluster_check.sh-rwxrwxr-x 1 hadoop hadoop 312 Aug 1 14:51 kafka_cluster_start.sh-rwxrwxr-x 1 hadoop hadoop 132 Aug 1 14:43 kafka_cluster_stop.sh-rwxrwxr-x 1 hadoop hadoop 291 Aug 1 14:23 start_kafka_manager.sh-rwxrwxr-x 1 hadoop hadoop 286 Aug 1 14:28 stop_kafka_manager.sh-rwxrwxr-x 1 hadoop hadoop 176 Aug 1 14:57 zookeeper_cluster_start.sh-rwxrwxr-x 1 hadoop hadoop 101 Aug 1 14:56 zookeeper_cluster_stop.sh
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.