[alex@hadoop102 ~]$ cd /usr/local/bin/
[alex@hadoop102 bin]$ sudo touch kafka-topic-create.sh
[alex@hadoop102 bin]$ sudo chown alex:alex kafka-topic-create.sh
[alex@hadoop102 bin]$ chmod 755 kafka-topic-create.sh
[alex@hadoop102 bin]$ vim kafka-topic-create.sh
#!/bin/bash
kafka_home=/opt/module/kafka_2.11-0.11.0.2
$kafka_home/bin/kafka-topics.sh --zookeeper hadoop102:2181,hadoop103:2181,hadoop104:2181 --create --replication-factor 2 --partitions 6 --topic $1
网友评论