开发者社区> 问答> 正文

kafka远程部署完后启动,远程断开kafka也自动断开?报错

 求助!!!

使用kafka和zookeeper搭建集群,zookeeper已经搭建OK,kafka配置参数也已经完成,所有的过程都是远程连接服务器部署安装。部署完成后zookeeper和kafka都能够启动运行正常 ,但是当远程连接一断开,再次远程登录kafka就会自动断开,启动kafka使用的是

bin/kafka-server-start.sh -daemon config/server.properties

kafka版本:kafka_2.10-0.10.2.0

在配置kafka的server.properties的参数是按照如下:

broker.id=1
    port=9092
    host.name=192.168.3.1
    log.dirs=/home/user/home/www/kafka_2.10-0.10.1.0/logs(此处由实际的路径设置)
    zookeeper.connect=192.168.3.1:2181,192.168.3.2:2181,192.168.3.3:2181

报错信息来自kafkaServer.out 

[2017-04-18 05:38:06,023] INFO [Kafka Server 1], shut down completed (kafka.server.KafkaServer)
[2017-04-18 05:38:06,023] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
java.io.FileNotFoundException: /home/ubuntu/home/www/kafka_2.10-0.10.2.0/logs/__consumer_offsets-49/00000000000000000000.index (No such file or directory)
        at java.io.RandomAccessFile.open0(Native Method)
        at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
        at kafka.log.AbstractIndex$$anonfun$resize$1.apply(AbstractIndex.scala:102)
        at kafka.log.AbstractIndex$$anonfun$resize$1.apply(AbstractIndex.scala:101)
        at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
        at kafka.log.AbstractIndex.resize(AbstractIndex.scala:101)
        at kafka.log.AbstractIndex$$anonfun$trimToValidSize$1.apply$mcV$sp(AbstractIndex.scala:163)
        at kafka.log.AbstractIndex$$anonfun$trimToValidSize$1.apply(AbstractIndex.scala:163)
        at kafka.log.AbstractIndex$$anonfun$trimToValidSize$1.apply(AbstractIndex.scala:163)
        at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
        at kafka.log.AbstractIndex.trimToValidSize(AbstractIndex.scala:162)
        at kafka.log.LogSegment.recover(LogSegment.scala:250)
        at kafka.log.Log$$anonfun$loadSegments$4.apply(Log.scala:231)
        at kafka.log.Log$$anonfun$loadSegments$4.apply(Log.scala:188)
        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
        at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
        at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
        at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
        at kafka.log.Log.loadSegments(Log.scala:188)
        at kafka.log.Log.<init>(Log.scala:116)
        at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$3$$anonfun$apply$10$$anonfun$apply$1.apply$mcV$sp(LogManager.scala:157)
        at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:57)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
[2017-04-18 05:38:06,024] INFO [Kafka Server 1], shutting down (kafka.server.KafkaServer)

 

非常感谢!!!

展开
收起
爱吃鱼的程序员 2020-06-08 15:26:50 751 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    使用screen或nohup方式启动kafka

    2020-06-08 15:27:10
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第16讲】:Spring Boot 2.0 实战Apache Kafka百万级高并发消息中间件与原理解析 立即下载
MaxCompute技术公开课第四季 之 如何将Kafka数据同步至MaxCompute 立即下载
消息队列kafka介绍 立即下载