win环境下启动kafka Port already in use: 6688; nested exception is

win环境下启动kafka Port already in use: 6688; nested exception is_第1张图片

背景

   zk启动成功后,接下来启动kafka,再启动kafka后一直说端口被占用。

端口占用解决办法:
netstat -aon|findstr 9092

taskkill -f -pid 7780

杀掉后,再次启动kafka时,问题并未解决

后来修改了批处理文件kafka-run-class.bat中的以下地方

  fi
}

# need to check if called to start server or client 
# in order to correctly decide about JMX_PORT
ISKAFKASERVER="false"
if [[ "$*" =~ "kafka.Kafka" ]]; then
    ISKAFKASERVER="true"
fi

base_dir=$(dirname $0)/..

if [ -z "$SCALA_VERSION" ]; then
@@ -146,7 +153,7 @@ if [ -z "$KAFKA_JMX_OPTS" ]; then
fi

# JMX port to use
if [  $JMX_PORT ]; then
if [  $JMX_PORT ] && [ -z "$ISKAFKASERVER" ]; then
  KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
fi

但是我是直接修改了

win环境下启动kafka Port already in use: 6688; nested exception is_第2张图片

图中jmx_port是问题的引发点,我直接注释掉,后启用zk和kafka后,除

并成功启动zk和kafka

你可能感兴趣的:(BigDate,运维监控,测试平台,kafka,分布式)