kafka 0.8.2无法在redhat上启动服务器

noj0wjuj  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(375)

嗨,我正在redhat服务器上运行kafka服务器:

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release:        6.6
Codename:       Santiago

服务器已安装java:

java version "1.7.0_79"
OpenJDK Runtime Environment (suse-2.5.5.3.el6_6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

我启动zookeeper没有任何问题,但当试图启动Kafka bin/kafka-server-start.sh config/server.properties 它会提示一个错误:

[2015-08-27 11:03:01,542] INFO Verifying properties (kafka.utils.VerifiablePrope                                                                                        rties)
[2015-08-27 11:03:01,585] INFO Property broker.id is overridden to 0 (kafka.util                                                                                        s.VerifiableProperties)
[2015-08-27 11:03:01,585] INFO Property log.cleaner.enable is overridden to fals                                                                                        e (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,585] INFO Property log.dirs is overridden to /tmp/kafka-log                                                                                        s (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,586] INFO Property log.retention.check.interval.ms is overr                                                                                        idden to 300000 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,586] INFO Property log.retention.hours is overridden to 168                                                                                         (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,586] INFO Property log.segment.bytes is overridden to 10737                                                                                        41824 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,586] INFO Property num.io.threads is overridden to 8 (kafka                                                                                        .utils.VerifiableProperties)
[2015-08-27 11:03:01,586] INFO Property num.network.threads is overridden to 3 (                                                                                        kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,587] INFO Property num.partitions is overridden to 1 (kafka                                                                                        .utils.VerifiableProperties)
[2015-08-27 11:03:01,587] INFO Property num.recovery.threads.per.data.dir is ove                                                                                        rridden to 1 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,587] INFO Property port is overridden to 9092 (kafka.utils.                                                                                        VerifiableProperties)
[2015-08-27 11:03:01,587] INFO Property socket.receive.buffer.bytes is overridde                                                                                        n to 102400 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,587] INFO Property socket.request.max.bytes is overridden t                                                                                        o 104857600 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,588] INFO Property socket.send.buffer.bytes is overridden t                                                                                        o 102400 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,588] INFO Property zookeeper.connect is overridden to local                                                                                        host:2181 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,588] INFO Property zookeeper.connection.timeout.ms is overr                                                                                        idden to 6000 (kafka.utils.VerifiableProperties)
[2015-08-27 11:03:01,656] INFO [Kafka Server 0], starting (kafka.server.KafkaSer                                                                                        ver)
[2015-08-27 11:03:01,658] INFO [Kafka Server 0], Connecting to zookeeper on loca                                                                                        lhost:2181 (kafka.server.KafkaServer)
[2015-08-27 11:03:01,668] INFO Starting ZkClient event thread. (org.I0Itec.zkcli                                                                                        ent.ZkEventThread)
[2015-08-27 11:03:01,678] INFO Client environment:zookeeper.version=3.4.6-156996                                                                                        5, built on 02/20/2014 09:09 GMT (org.apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,678] INFO Client environment:host.name=<NA> (org.apache.zoo                                                                                        keeper.ZooKeeper)
[2015-08-27 11:03:01,678] INFO Client environment:java.version=1.7.0_79 (org.apa                                                                                        che.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,678] INFO Client environment:java.vendor=Oracle Corporation                                                                                         (org.apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,678] INFO Client environment:java.home=/usr/lib/jvm/java-1.                                                                                        7.0-openjdk-1.7.0.79.x86_64/jre (org.apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:java.class.path=:/opt/kafka_2.                                                                                        9.1-0.8.2.1/bin/../core/build/dependant-libs-2.10.4*/*.jar:/opt/kafka_2.9.1-0.8.                                                                                        2.1/bin/../examples/build/libs//kafka-examples*.jar:/opt/kafka_2.9.1-0.8.2.1/bin                                                                                        /../contrib/hadoop-consumer/build/libs//kafka-hadoop-consumer*.jar:/opt/kafka_2.                                                                                        9.1-0.8.2.1/bin/../contrib/hadoop-producer/build/libs//kafka-hadoop-producer*.ja                                                                                        r:/opt/kafka_2.9.1-0.8.2.1/bin/../clients/build/libs/kafka-clients*.jar:/opt/kaf                                                                                        ka_2.9.1-0.8.2.1/bin/../libs/jopt-simple-3.2.jar:/opt/kafka_2.9.1-0.8.2.1/bin/..                                                                                        /libs/kafka_2.9.1-0.8.2.1.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/kafka_2.9.1-0                                                                                        .8.2.1-javadoc.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/kafka_2.9.1-0.8.2.1-scal                                                                                        adoc.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/kafka_2.9.1-0.8.2.1-sources.jar:/o                                                                                        pt/kafka_2.9.1-0.8.2.1/bin/../libs/kafka_2.9.1-0.8.2.1-test.jar:/opt/kafka_2.9.1                                                                                        -0.8.2.1/bin/../libs/kafka-clients-0.8.2.1.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../l                                                                                        ibs/log4j-1.2.16.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/lz4-1.2.0.jar:/opt/kaf                                                                                        ka_2.9.1-0.8.2.1/bin/../libs/metrics-core-2.2.0.jar:/opt/kafka_2.9.1-0.8.2.1/bin                                                                                        /../libs/scala-library-2.9.1.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/slf4j-api-                                                                                        1.7.6.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/slf4j-log4j12-1.6.1.jar:/opt/kafk                                                                                        a_2.9.1-0.8.2.1/bin/../libs/snappy-java-1.1.1.6.jar:/opt/kafka_2.9.1-0.8.2.1/bin                                                                                        /../libs/zkclient-0.3.jar:/opt/kafka_2.9.1-0.8.2.1/bin/../libs/zookeeper-3.4.6.j                                                                                        ar:/opt/kafka_2.9.1-0.8.2.1/bin/../core/build/libs/kafka_2.10*.jar (org.apache.z                                                                                        ookeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:java.library.path=/usr/java/pa                                                                                        ckages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper                                                                                        )
[2015-08-27 11:03:01,679] INFO Client environment:java.io.tmpdir=/tmp (org.apach                                                                                        e.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:java.compiler=<NA> (org.apache                                                                                        .zookeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:os.name=Linux (org.apache.zook                                                                                        eeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:os.arch=amd64 (org.apache.zook                                                                                        eeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:os.version=2.6.32-504.23.4.el6                                                                                        .x86_64 (org.apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:user.name=root (org.apache.zoo                                                                                        keeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:user.home=/root (org.apache.zo                                                                                        okeeper.ZooKeeper)
[2015-08-27 11:03:01,679] INFO Client environment:user.dir=/opt/kafka_2.9.1-0.8.                                                                                        2.1 (org.apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,680] INFO Initiating client connection, connectString=local                                                                                        host:2181 sessionTimeout=6000 watcher=org.I0Itec.zkclient.ZkClient@1d88518f (org                                                                                        .apache.zookeeper.ZooKeeper)
[2015-08-27 11:03:01,700] INFO Opening socket connection to server localhost/127                                                                                        .0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.ap                                                                                        ache.zookeeper.ClientCnxn)
[2015-08-27 11:03:01,705] INFO Socket connection established to localhost/127.0.                                                                                        0.1:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2015-08-27 11:03:01,728] INFO Session establishment complete on server localhos                                                                                        t/127.0.0.1:2181, sessionid = 0x14f6e6478700000, negotiated timeout = 6000 (org.                                                                                        apache.zookeeper.ClientCnxn)
[2015-08-27 11:03:01,730] INFO zookeeper state changed (SyncConnected) (org.I0It                                                                                        ec.zkclient.ZkClient)
[2015-08-27 11:03:01,828] INFO Log directory '/tmp/kafka-logs' not found, creati                                                                                        ng it. (kafka.log.LogManager)
[2015-08-27 11:03:01,839] INFO Loading logs. (kafka.log.LogManager)
[2015-08-27 11:03:01,848] INFO Logs loading complete. (kafka.log.LogManager)
[2015-08-27 11:03:01,849] INFO Starting log cleanup with a period of 300000 ms.                                                                                         (kafka.log.LogManager)
[2015-08-27 11:03:01,853] INFO Starting log flusher with a default period of 922                                                                                        3372036854775807 ms. (kafka.log.LogManager)
[2015-08-27 11:03:01,886] INFO Awaiting socket connections on 0.0.0.0:9092. (kaf                                                                                        ka.network.Acceptor)
[2015-08-27 11:03:01,887] INFO [Socket Server on Broker 0], Started (kafka.netwo                                                                                        rk.SocketServer)
[2015-08-27 11:03:01,964] INFO Will not load MX4J, mx4j-tools.jar is not in the                                                                                         classpath (kafka.utils.Mx4jLoader$)
[2015-08-27 11:03:02,007] INFO 0 successfully elected as leader (kafka.server.Zo                                                                                        okeeperLeaderElector)
[2015-08-27 11:03:02,081] FATAL [Kafka Server 0], Fatal error during KafkaServer                                                                                         startup. Prepare to shutdown (kafka.server.KafkaServer)
java.net.UnknownHostException: SRV101004013: SRV101004013
        at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
        at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:54)
        at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:45)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:124)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:                                                                                        29)
        at kafka.Kafka$.main(Kafka.scala:46)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.UnknownHostException: SRV101004013
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:129                                                                                        3)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
        ... 6 more
[2015-08-27 11:03:02,084] INFO [Kafka Server 0], shutting down (kafka.server.Kaf                                                                                        kaServer)
[2015-08-27 11:03:02,086] INFO [Socket Server on Broker 0], Shutting down (kafka                                                                                        .network.SocketServer)
[2015-08-27 11:03:02,091] INFO [Socket Server on Broker 0], Shutdown completed (                                                                                        kafka.network.SocketServer)
[2015-08-27 11:03:02,092] INFO [Kafka Request Handler on Broker 0], shutting dow                                                                                        n (kafka.server.KafkaRequestHandlerPool)
[2015-08-27 11:03:02,128] INFO [Kafka Request Handler on Broker 0], shut down co                                                                                        mpletely (kafka.server.KafkaRequestHandlerPool)
[2015-08-27 11:03:02,164] INFO New leader is 0 (kafka.server.ZookeeperLeaderElec                                                                                        tor$LeaderChangeListener)
[2015-08-27 11:03:02,346] INFO [Replica Manager on Broker 0]: Shut down (kafka.s                                                                                        erver.ReplicaManager)
[2015-08-27 11:03:02,347] INFO [ReplicaFetcherManager on broker 0] shutting down                                                                                         (kafka.server.ReplicaFetcherManager)
[2015-08-27 11:03:02,348] INFO [ReplicaFetcherManager on broker 0] shutdown comp                                                                                        leted (kafka.server.ReplicaFetcherManager)
[2015-08-27 11:03:02,352] INFO [Replica Manager on Broker 0]: Shut down complete                                                                                        ly (kafka.server.ReplicaManager)
[2015-08-27 11:03:02,352] INFO Shutting down. (kafka.log.LogManager)
[2015-08-27 11:03:02,362] INFO Shutdown complete. (kafka.log.LogManager)
[2015-08-27 11:03:02,366] INFO Terminate ZkClient event thread. (org.I0Itec.zkcl                                                                                        ient.ZkEventThread)
[2015-08-27 11:03:02,368] INFO Session: 0x14f6e6478700000 closed (org.apache.zoo                                                                                        keeper.ZooKeeper)
[2015-08-27 11:03:02,368] INFO EventThread shut down (org.apache.zookeeper.Clien                                                                                        tCnxn)
[2015-08-27 11:03:02,368] INFO [Kafka Server 0], shut down completed (kafka.serv                                                                                        er.KafkaServer)
[2015-08-27 11:03:02,369] FATAL Fatal error during KafkaServerStartable startup.                                                                                         Prepare to shutdown (kafka.server.KafkaServerStartable)
java.net.UnknownHostException: SRV101004013: SRV101004013
        at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
        at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:54)
        at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:45)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:124)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:                                                                                        29)
        at kafka.Kafka$.main(Kafka.scala:46)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.UnknownHostException: SRV101004013
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:129                                                                                        3)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
        ... 6 more
[2015-08-27 11:03:02,372] INFO [Kafka Server 0], shutting down (kafka.server.Kaf                                                                                        kaServer)

我想问题应该出在这个公开的问题上,但我不能确定是否有人发现了同样的问题?有人知道怎么修吗?

iyfjxgzm

iyfjxgzm1#

它无法解析主机srv101004013。一个问题是你是否把这个主机写进了kafka或zk配置文件?你能用解析主机名吗 nslookup 还是简单 ping ? 如果是,您是否在/etc/hosts中有主机?因为inetaddress.getlocalhost()忽略/etc/resolv.conf,而只查看/etc/hosts文件。

相关问题