server.properties配置
broker.id=0
listeners = PLAINTEXT://127.0.0.1:9092
port=9092
advertised.listeners = PLAINTEXT://127.0.0.1:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=C:\Product-Files\apache\kafkas\kafka_2.11-1.0.0\config\tmp\kafka-logs
num.partitions=4
num.recovery.threads.per.data.dir=1
metadata.broker.list=127.0.0.1:9092
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=127.0.0.1:2181
zookeeer.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
zk配置信息
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
#数据目录
dataDir=C:\Product-Files\apache\zookeepers\zookeeper-3.4.10\data
#日志目录
dataLogDir=C:\Product-Files\apache\zookeepers\zookeeper-3.4.10\log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
maxClientCnxns=10
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
[2018-01-02 11:25:56,190] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server '127.0.0.1:2181' with timeout of 6000 ms
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1233)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:157)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:131)
at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:115)
at kafka.utils.ZkUtils$.withMetrics(ZkUtils.scala:92)
at kafka.server.KafkaServer.initZk(KafkaServer.scala:346)
at kafka.server.KafkaServer.startup(KafkaServer.scala:194)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
at kafka.Kafka$.main(Kafka.scala:92)
at kafka.Kafka.main(Kafka.scala)
[2018-01-02 11:25:56,191] INFO EventThread shut down for session: 0x0 (org.apache.zookeeper.ClientCnxn)
[2018-01-02 11:25:56,200] INFO shutting down (kafka.server.KafkaServer)
[2018-01-02 11:25:56,218] INFO shut down completed (kafka.server.KafkaServer)
[2018-01-02 11:25:56,219] FATAL Exiting Kafka. (kafka.server.KafkaServerStartable)
[2018-01-02 11:25:56,225] INFO shutting down (kafka.server.KafkaServer)
2018-01-02 11:35:39,532 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@373] - Exception causing close of session 0x160b4e45e5c0004 due to java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
2018-01-02 11:35:39,537 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1044] - Closed socket connection for client /127.0.0.1:54579 which had sessionid 0x160b4e45e5c0004
2018-01-02 11:35:46,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@358] - Expiring session 0x160b4e45e5c0001, timeout of 6000ms exceeded
2018-01-02 11:35:48,994 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@486] - Processed session termination for sessionid: 0x160b4e45e5c0001
2018-01-02 11:36:10,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@358] - Expiring session 0x160b4e45e5c0004, timeout of 30000ms exceeded
2018-01-02 11:36:10,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@358] - Expiring session 0x160b4e45e5c0002, timeout of 30000ms exceeded
2018-01-02 11:36:10,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@358] - Expiring session 0x160b4e45e5c0003, timeout of 30000ms exceeded
2018-01-02 11:36:10,001 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@486] - Processed session termination for sessionid: 0x160b4e45e5c0004
2018-01-02 11:36:10,001 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@486] - Processed session termination for sessionid: 0x160b4e45e5c0002
2018-01-02 11:36:10,001 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@486] - Processed session termination for sessionid: 0x160b4e45e5c0003