请教!kafka集群启动失败 卡在[Kafka Server 1], started (kafka.server.KafkaServer)不动了

ゞ 爽! 发表于: 2018-06-16   最后更新时间: 2018-06-16 11:09:41   3,842 游览

刚开始学习,百度了好多问题都没有找到解决方案,希望大家指导一下.

我有3台虚拟机分别是 hadoop1(192.168.32.131),hadoop2(x.132),hadoop3(x.133)
我的kafka版本是kafka_2.11-0.9.0.1内部zk版本是3.4.6
kafkaserver.properties的改动如下,其他都是默认:

broker.id=0(三台机器分别是0,1,2)
port=9092
zookeeper.connect=hadoop1:2181,hadoop2:2181,hadoop3:2181
host.name=hadoop1(分别为本机地址)
advertised.host.name=192.168.32.131(分别为本机ip)
我的zk(3.4.6版本)集群启动正常,搭建storm的时候还用到zk集群了.
zoo.cfg 部分配置如下:
#(主机名, 心跳端口、数据端口)
server.1=hadoop1:2888:3888
server.2=hadoop2:2888:3888
server.3=hadoop3:2888:3888

myid分别是1,2,3
下面是启动信息
[root@hadoop2 kafka_2.11-0.9.0.1]# bin/kafka-server-start.sh  config/server.properties
[2018-06-16 10:50:28,637] INFO KafkaConfig values: 
    advertised.host.name = 192.168.32.132
    metric.reporters = []
    quota.producer.default = 9223372036854775807
    offsets.topic.num.partitions = 50
    log.flush.interval.messages = 9223372036854775807
    auto.create.topics.enable = true
    controller.socket.timeout.ms = 30000
    log.flush.interval.ms = null
    principal.builder.class = class org.apache.kafka.common.security.auth.DefaultPrincipalBuilder
    replica.socket.receive.buffer.bytes = 65536
    min.insync.replicas = 1
    replica.fetch.wait.max.ms = 500
    num.recovery.threads.per.data.dir = 1
    ssl.keystore.type = JKS
    default.replication.factor = 1
    ssl.truststore.password = null
    log.preallocate = false
    sasl.kerberos.principal.to.local.rules = [DEFAULT]
    fetch.purgatory.purge.interval.requests = 1000
    ssl.endpoint.identification.algorithm = null
    replica.socket.timeout.ms = 30000
    message.max.bytes = 1000012
    num.io.threads = 8
    offsets.commit.required.acks = -1
    log.flush.offset.checkpoint.interval.ms = 60000
    delete.topic.enable = false
    quota.window.size.seconds = 1
    ssl.truststore.type = JKS
    offsets.commit.timeout.ms = 5000
    quota.window.num = 11
    zookeeper.connect = hadoop1:2181,hadoop2:2181,hadoop3:2181
    authorizer.class.name = 
    num.replica.fetchers = 1
    log.retention.ms = null
    log.roll.jitter.hours = 0
    log.cleaner.enable = true
    offsets.load.buffer.size = 5242880
    log.cleaner.delete.retention.ms = 86400000
    ssl.client.auth = none
    controlled.shutdown.max.retries = 3
    queued.max.requests = 500
    offsets.topic.replication.factor = 3
    log.cleaner.threads = 1
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    socket.request.max.bytes = 104857600
    ssl.trustmanager.algorithm = PKIX
    zookeeper.session.timeout.ms = 6000
    log.retention.bytes = -1
    sasl.kerberos.min.time.before.relogin = 60000
    zookeeper.set.acl = false
    connections.max.idle.ms = 600000
    offsets.retention.minutes = 1440
    replica.fetch.backoff.ms = 1000
    inter.broker.protocol.version = 0.9.0.X
    log.retention.hours = 168
    num.partitions = 1
    broker.id.generation.enable = true
    listeners = null
    ssl.provider = null
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    log.roll.ms = null
    log.flush.scheduler.interval.ms = 9223372036854775807
    ssl.cipher.suites = null
    log.index.size.max.bytes = 10485760
    ssl.keymanager.algorithm = SunX509
    security.inter.broker.protocol = PLAINTEXT
    replica.fetch.max.bytes = 1048576
    advertised.port = null
    log.cleaner.dedupe.buffer.size = 134217728
    replica.high.watermark.checkpoint.interval.ms = 5000
    log.cleaner.io.buffer.size = 524288
    sasl.kerberos.ticket.renew.window.factor = 0.8
    zookeeper.connection.timeout.ms = 6000
    controlled.shutdown.retry.backoff.ms = 5000
    log.roll.hours = 168
    log.cleanup.policy = delete
    host.name = hadoop2
    log.roll.jitter.ms = null
    max.connections.per.ip = 2147483647
    offsets.topic.segment.bytes = 104857600
    background.threads = 10
    quota.consumer.default = 9223372036854775807
    request.timeout.ms = 30000
    log.index.interval.bytes = 4096
    log.dir = /tmp/kafka-logs
    log.segment.bytes = 1073741824
    log.cleaner.backoff.ms = 15000
    offset.metadata.max.bytes = 4096
    ssl.truststore.location = null
    group.max.session.timeout.ms = 30000
    ssl.keystore.password = null
    zookeeper.sync.time.ms = 2000
    port = 9092
    log.retention.minutes = null
    log.segment.delete.delay.ms = 60000
    log.dirs = /root/apps/kafka/logs
    controlled.shutdown.enable = true
    compression.type = producer
    max.connections.per.ip.overrides = 
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    log.cleaner.io.max.bytes.per.second = 1.7976931348623157E308
    auto.leader.rebalance.enable = true
    leader.imbalance.check.interval.seconds = 300
    log.cleaner.min.cleanable.ratio = 0.5
    replica.lag.time.max.ms = 10000
    num.network.threads = 3
    ssl.key.password = null
    reserved.broker.max.id = 1000
    metrics.num.samples = 2
    socket.send.buffer.bytes = 102400
    ssl.protocol = TLS
    socket.receive.buffer.bytes = 102400
    ssl.keystore.location = null
    replica.fetch.min.bytes = 1
    unclean.leader.election.enable = true
    group.min.session.timeout.ms = 6000
    log.cleaner.io.buffer.load.factor = 0.9
    offsets.retention.check.interval.ms = 600000
    producer.purgatory.purge.interval.requests = 1000
    metrics.sample.window.ms = 30000
    broker.id = 1
    offsets.topic.compression.codec = 0
    log.retention.check.interval.ms = 300000
    advertised.listeners = null
    leader.imbalance.per.broker.percentage = 10
 (kafka.server.KafkaConfig)
[2018-06-16 10:50:36,062] INFO starting (kafka.server.KafkaServer)
[2018-06-16 10:50:37,355] INFO Connecting to zookeeper on hadoop1:2181,hadoop2:2181,hadoop3:2181 (kafka.server.KafkaServer)
[2018-06-16 10:50:41,948] INFO Starting ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2018-06-16 10:50:42,477] INFO Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,492] INFO Client environment:host.name=hadoop2 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.version=1.8.0_151 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.home=/root/apps/jdk1.8.0_151/jre (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.class.path=:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/scala-library-2.11.7.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/zookeeper-3.4.6.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/zkclient-0.7.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/metrics-core-2.2.0.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jopt-simple-3.2.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/scala-xml_2.11-1.0.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/scala-parser-combinators_2.11-1.0.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/snappy-java-1.1.1.7.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka_2.11-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka_2.11-0.9.0.1-sources.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka_2.11-0.9.0.1-javadoc.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka_2.11-0.9.0.1-scaladoc.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka_2.11-0.9.0.1-test.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka-tools-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka-log4j-appender-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/argparse4j-0.5.0.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/slf4j-log4j12-1.7.6.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/connect-api-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/log4j-1.2.17.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-annotations-2.5.0.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/connect-file-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/lz4-1.2.0.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/connect-runtime-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/slf4j-api-1.7.6.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-server-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-servlet-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-jaxrs-json-provider-2.5.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-container-servlet-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javax.servlet-api-3.1.0.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-http-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-io-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-security-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-jaxrs-base-2.5.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-module-jaxb-annotations-2.5.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-container-servlet-core-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-common-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-server-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javax.ws.rs-api-2.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jetty-util-9.2.12.v20150709.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javax.inject-2.4.0-b31.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javax.annotation-api-1.2.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-guava-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/hk2-api-2.4.0-b31.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/hk2-locator-2.4.0-b31.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/osgi-resource-locator-1.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-client-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jersey-media-jaxb-2.22.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/validation-api-1.1.0.Final.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/hk2-utils-2.4.0-b31.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/aopalliance-repackaged-2.4.0-b31.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javassist-3.18.1-GA.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/javax.inject-1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/connect-json-0.9.0.1.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-databind-2.5.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/jackson-core-2.5.4.jar:/root/apps/kafka/kafka_2.11-0.9.0.1/bin/../libs/kafka-clients-0.9.0.1.jar (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,493] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:os.version=3.10.0-693.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,494] INFO Client environment:user.dir=/root/apps/kafka/kafka_2.11-0.9.0.1 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,498] INFO Initiating client connection, connectString=hadoop1:2181,hadoop2:2181,hadoop3:2181 sessionTimeout=6000 watcher=org.I0Itec.zkclient.ZkClient@22a637e7 (org.apache.zookeeper.ZooKeeper)
[2018-06-16 10:50:42,720] INFO Waiting for keeper state SyncConnected (org.I0Itec.zkclient.ZkClient)
[2018-06-16 10:50:42,829] INFO Opening socket connection to server hadoop1/192.168.32.131:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2018-06-16 10:50:42,962] INFO Socket connection established to hadoop1/192.168.32.131:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2018-06-16 10:50:43,036] INFO Session establishment complete on server hadoop1/192.168.32.131:2181, sessionid = 0x1640649957a0002, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2018-06-16 10:50:43,041] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
[2018-06-16 10:50:43,377] INFO Loading logs. (kafka.log.LogManager)
[2018-06-16 10:50:43,397] INFO Logs loading complete. (kafka.log.LogManager)
[2018-06-16 10:50:45,721] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2018-06-16 10:50:45,820] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2018-06-16 10:50:46,212] WARN No meta.properties file under dir /root/apps/kafka/logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
[2018-06-16 10:50:47,007] INFO Awaiting socket connections on hadoop2:9092. (kafka.network.Acceptor)
[2018-06-16 10:50:47,025] INFO [Socket Server on Broker 1], Started 1 acceptor threads (kafka.network.SocketServer)
[2018-06-16 10:50:47,700] INFO [ExpirationReaper-1], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-16 10:50:47,700] INFO [ExpirationReaper-1], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-16 10:50:48,007] INFO Creating /controller (is it secure? false) (kafka.utils.ZKCheckedEphemeral)
[2018-06-16 10:50:48,028] INFO Result of znode creation is: OK (kafka.utils.ZKCheckedEphemeral)
[2018-06-16 10:50:48,029] INFO 1 successfully elected as leader (kafka.server.ZookeeperLeaderElector)
[2018-06-16 10:50:48,264] INFO [GroupCoordinator 1]: Starting up. (kafka.coordinator.GroupCoordinator)
[2018-06-16 10:50:48,298] INFO [ExpirationReaper-1], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-16 10:50:48,299] INFO [ExpirationReaper-1], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-16 10:50:48,346] INFO [GroupCoordinator 1]: Startup complete. (kafka.coordinator.GroupCoordinator)
[2018-06-16 10:50:48,408] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 110 milliseconds. (kafka.coordinator.GroupMetadataManager)
[2018-06-16 10:50:48,785] INFO New leader is 1 (kafka.server.ZookeeperLeaderElector$LeaderChangeListener)
[2018-06-16 10:50:49,039] INFO Will not load MX4J, mx4j-tools.jar is not in the classpath (kafka.utils.Mx4jLoader$)
[2018-06-16 10:50:49,041] INFO [ThrottledRequestReaper-Produce], Starting  (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-06-16 10:50:49,041] INFO [ThrottledRequestReaper-Fetch], Starting  (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-06-16 10:50:49,151] INFO Creating /brokers/ids/1 (is it secure? false) (kafka.utils.ZKCheckedEphemeral)
[2018-06-16 10:50:49,178] INFO Result of znode creation is: OK (kafka.utils.ZKCheckedEphemeral)
[2018-06-16 10:50:49,181] INFO Registered broker 1 at path /brokers/ids/1 with addresses: PLAINTEXT -> EndPoint(192.168.32.132,9092,PLAINTEXT) (kafka.utils.ZkUtils)
[2018-06-16 10:50:49,388] INFO Kafka version : 0.9.0.1 (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-16 10:50:49,388] INFO Kafka commitId : 23c69d62a0cabf06 (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-16 10:50:49,391] INFO [Kafka Server 1], started (kafka.server.KafkaServer)
发表于 2018-06-16
添加评论

好像这就是启动成功了,直接回车就出来了.    日了狗.....

半兽人 -> ゞ 爽! 6年前

用守护进程的启动方式。
nohub 或者加 daemon

ゞ 爽! -> 半兽人 6年前

非常感谢回复! 虽然晚了-_-

你的答案

查看kafka相关的其他问题或提一个您自己的问题