我在相关节点上运行了zookeeper守护程序,正在尝试启动kafka代理,但出现以下错误:
FATAL [Kafka Server 13], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.lang.NumberFormatException: For input string: "2181""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.parseInt(Integer.java:527)
at org.apache.zookeeper.client.ConnectStringParser.<init>(ConnectStringParser.java:72)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:443)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:64)
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:876)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84)
at kafka.server.KafkaServer.initZk(KafkaServer.scala:157)
at kafka.server.KafkaServer.startup(KafkaServer.scala:82)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:29)
at kafka.Kafka$.main(Kafka.scala:46)
at kafka.Kafka.main(Kafka.scala)
我的服务器.properties
broker.id=13
port=9092
host.name=node013
num.network.threads=3
num.io.threads=8
zookeeper.connect="node014:2181,node135:2181,node136:2181"
zookeeper.connection.timeout.ms=6000
和zookeeper.properties
dataDir=/tmp/zookeeper
clientPort=2181
maxClientCnxns=0
我已经试过了,但是没有弄清楚为什么错误日志在端口属性中显示了额外的。知道是什么导致了这个问题吗?
2条答案
按热度按时间gg58donl1#
在你的
server.properties
文件,需要删除双引号。应该是的ttp71kqs2#
这个异常可以通过删除端口“2181”和命令行选项“-list”之间的空格来解决。
$/Kafka主题——Zookeeperlocalhost:2181 --在线程“main”java.lang.numberformatexception中列出异常:对于输入字符串:“2181” " 在java.lang.numberformatexception.forinputstring(numberformatexception。java:65)在java.lang.integer.parseint(integer。java:580)在java.lang.integer.parseint(integer。java:615)在org.apache.zookeeper.client.connectstringparser。java:72)在org.apache.zookeeper.zookeeper。java:443)在ApacheZookeeper。java:380)在org.i0itec.zkclient.zkconnection.connect(zkconnection。java:70)在org.i0itec.zkclient.zkclient.connect(zkclient。java:1228)在org.i0itec.zkclient.zkclient。java:157)在org.i0itec.zkclient.zkclient。java:131)在kafka.utils.zkutils$.createzkclientandconnection(zkutils。scala:103)在kafka.utils.zkutils$.apply(zkutils。scala:85)在kafka.admin.topiccommand$.main(topiccommand。scala:58)位于kafka.admin.topiccommand.main(topiccommand.scala)