首页 > 编程语言 >【Kafka】ZooKeeper启动失败报错java.net.BindException_ Address already in use_ bind

【Kafka】ZooKeeper启动失败报错java.net.BindException_ Address already in use_ bind

时间:2023-09-11 14:04:23浏览次数:50  
标签:use already java 04 zookeeper server 报错 apache org

问题描述

Kafka 2.8.1 ZooKeeper启动失败。

zookeeper-server-start.bat ../../config/zookeeper.properties
[2023-09-04 18:21:49,497] INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2023-09-04 18:21:49,498] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.net.BindException: Address already in use: bind
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Net.java:555)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:81)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:687)
        at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:144)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:107)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:65)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)

原因分析

2181端口被占用。

打开cmd。

netstat -ano |findstr 2181

无结果返回,找不到占用2181端口的程序。


解决方案

修改config/zookeeper.properties

找到:

clientPort=2181

改为:

clientPort=21810

重新启动ZooKeeper,启动成功。

[2023-09-04 18:32:51,963] INFO binding to port 0.0.0.0/0.0.0.0:21810 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2023-09-04 18:32:51,979] INFO zookeeper.snapshotSizeFactor = 0.33 (org.apache.zookeeper.server.ZKDatabase)
[2023-09-04 18:32:51,981] INFO Reading snapshot \tmp\zookeeper\version-2\snapshot.0 (org.apache.zookeeper.server.persistence.FileSnap)
[2023-09-04 18:32:51,988] INFO Snapshotting: 0x0 to \tmp\zookeeper\version-2\snapshot.0 (org.apache.zookeeper.server.persistence.FileTxnSnapLog)
[2023-09-04 18:32:51,999] INFO PrepRequestProcessor (sid:0) started, reconfigEnabled=false (org.apache.zookeeper.server.PrepRequestProcessor)
[2023-09-04 18:32:52,004] INFO Using checkIntervalMs=60000 maxPerMinute=10000 (org.apache.zookeeper.server.ContainerManager)

记得修改config/server.properties,不然Kafka Server无法连接。

找到:

zookeeper.connect=localhost:2181

改为:

zookeeper.connect=localhost:2181

标签:use,already,java,04,zookeeper,server,报错,apache,org
From: https://blog.51cto.com/HEX9CF/7435636

相关文章

  • rdma-mr内核接口rxe_reg_user_mr
    描述:注册用户内存区域【通过IB_USER_VERBS_CMD_REG_MR】根据type流程:a)    类型转换为rxe类型b)   验证mr_typec)    申请rxe_mem:mr=rxe_alloc(&rxe->mr_pool);d)   为mr分配索引:rxe_add_index(mr)e)    对对象进行引用:rxe_add_ref(pd)f)     构成......
  • ClickHouse使用之二 ——整合mysql,实现数据库创建查询导出
    1.mysql创建一个用于clickhouse的账号mysql_clickhouse并且授权CREATEUSER'mysql_clickhouse'@'%'IDENTIFIEDBY'Password123!';GRANTALLPRIVILEGESON*.*TO‘mysql_clickhouse’@‘%';2. 使用mysql引擎创建一个clickhouse的外部表存在一个mysql的数据库:host:......
  • PostgreSQL数据库从入门到精通系列之五:深入理解lsn_proc、lsn_commit、lsn、txId、ts_
    PostgreSQL数据库从入门到精通系列之五:深入理解lsn_proc、lsn_commit、lsn、txId、ts_usec一、深入理解lsn_proc二、深入理解lsn_commit三、深入理解lsn四、深入理解txId五、深入理解ts_usec一、深入理解lsn_proc在PostgreSQL中,lsn_proc是一个内置函数,用于将逻辑日志位置(LSN)转换......
  • ClickHouse的Join算法
    ClickHouse的Join算法ClickHouse是一款开源的列式分析型数据库(OLAP),专为需要超低延迟分析查询大量数据的场景而生。为了实现分析应用可能达到的最佳性能,分析型数据库(OLAP)通常将表组合在一起形成一个大宽表,这个过程称为数据反规范化(datadenormalization)。大宽表通过避免JOIN连接来......
  • 运行vue项目一直报错的问题的解决
    问题描述(上图为网图,自己的没来得及截图)问题解决第一个原因:vue版本过低;使用下面的语句进行版本升级:[email protected]但是我试了没啥用;第二个原因:node版本过低;使用下面的语句进行版本升级:--若是已经有更高级的版本,可以直接更换:nvmlistnvmuse版本--若是没有,就自己......
  • debezium报错:no longer available on the server. Reconfigure the connector to use
    debezium报错:nolongeravailableontheserver.Reconfiguretheconnectortouseasnapshotwhenneede完整报错如下:-“trace”:"io.debezium.DebeziumException:TheconnectoristryingtoreadbinlogstartingatSourceInfo[currentGtid=null,currentBinlogFilename......
  • debezium报错:Caused by: io.debezium.DebeziumException:whose schema isn‘t known t
    debezium报错:Causedby:io.debezium.DebeziumException:whoseschemaisn’tknowntothisconnector“trace”:"org.apache.kafka.connect.errors.ConnectException:Anexceptionoccurredinthechangeeventproducer.Thisconnectorwillbestopped.Causedby:io.......
  • flume报错:java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
    flume报错:java.lang.NoClassDefFoundError:org/apache/hadoop/conf/ConfigurationFailedtostartagentbecausedependencieswerenotfoundinclasspath.Errorfollows.java.lang.NoClassDefFoundError:org/apache/hadoop/conf/Configurationatorg.apache.flume.sink......
  • Zeppelin起Spark任务报错:RECEIVED SIGNAL TERM
    Zeppelin起Spark任务报错:RECEIVEDSIGNALTERM解决方法如下所示:调大spark任务资源exportSPARK_SUBMIT_OPTIONS="--driver-memory4G--executor-memory4G--driver-cores2--executor-cores2--num-executors20--confspark.sql.shuffle.partitions=1000--confspark.......
  • 【RocketMQ】启动NameServer和Broker报错Unrecognized VM option ‘UseConcMarkSweepG
    问题描述启动RocketMQNameServer和RocketMQBroker报错。mqnamesrv.cmdUnrecognizedVMoption'UseConcMarkSweepGC'Error:CouldnotcreatetheJavaVirtualMachine.Error:Afatalexceptionhasoccurred.Programwillexit.mqbroker.cmd[0.004s][warning][gc]......