cp /export/servers/kafka/config/server.properties /export/servers/kafka/config/server.properties.bak
vi /export/servers/kafka/config/server.properties
注意修改的地方如下:
broker.id=0 这个值是0 1 2 ,
三台机器分别修改host.name=mini4 和 advertised.host.name=192.168.18.14
zookeeper.connect=mini4:2181,mini5:2181,mini6:2181
-----------------------------------------------------------
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0
# The port the socket server listens on
port=9092
# Hostname the broker will bind to. If not set, the server will bind to all interfaces
host.name=mini4
# Hostname the broker will advertise to producers and consumers. If not set, it uses the
# value for "host.name" if configured. Otherwise, it will use the value returned from
# java.net.InetAddress.getCanonicalHostName().
advertised.host.name=192.168.18.14
log.dirs=/export/servers/logs/kafka
# The default number of log partitions per topic. More partitions allow greater
# parallelism for consumption, but this will also result in more files across
# the brokers.
num.partitions=2
zookeeper.connect=mini4:2181,mini5:2181,mini6:2181
----------------------------------------------------------
4)分别在三台机器上启动kafka集群
a 启动:
kafka-server-start.sh /export/servers/kafka/config/server.properties
b 后台启动:
kafka-server-start.sh /export/servers/kafka/config/server.properties 1>/dev/null 2>&1 &
c 停止:kafka-server-stop.sh
9.4.另外被标记为marked for deletion的topic你可以在zookeeper客户端中通过命令获得:
ls /admin/delete_topics/【topic name】,
如果你删除了此处的topic,那么marked for deletion 标记消失
zookeeper 的config中也有有关topic的信息: ls /config/topics/【topic name】暂时不知道有什么用