标签:message span 火墙 端口 scp reload desc amp kafka
tar -zxvf kafka_2.10-0.10.2.1.tgz
cd kafka_2.10-0.10.2.1
mkdir logs
cd config
cp server.properties server.properties.20190124
server.properties
broker.id=0
log.dirs=/opt/deploy/kafka_2.10-0.10.2.1/logs
zookeeper.connect=ip:端口,ip:端口,ip:端口
host.name=ip
message.max.byte=5242880
default.replication.factor=2
replica.fetch.max.bytes=5242880
delete.topic.enable=true
开启防火墙(每一台机器都需要开通)
firewall-cmd --add-port=9092/tcp --permanent
firewall-cmd --reload
copy到其他服务器上:
scp -r /opt/deploy/kafka_2.10-0.10.2.1 user@ip:/opt/deploy/
scp -r /opt/deploy/kafka_2.10-0.10.2.1 user@ip:/opt/deploy/
修改其他机器的server.properties:
host1改
broker.id=1
host2改
broker.id=2
./bin/kafka-server-start.sh -daemon config/server.properties &
创建主题:
./kafka-topics.sh --create --zookeeper ip:端口 --replication-factor 2 --partitions 3 --topic ttest
查看主题:
./kafka-topics.sh --describe --zookeeper ip:端口 --topic ttest
开启生产者:
./kafka-console-producer.sh --broker-list ip:端口,ip:端口,ip:端口 --topic ttest
开启消费者:
./kafka-console-consumer.sh --zookeeper ip:端口 --topic ttest --from-beginning
标签:message span 火墙 端口 scp reload desc amp kafka
原文地址:https://www.cnblogs.com/koudaiyoutang/p/10622423.html