kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instan

Posted --->别先生<---

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instan相关的知识,希望对你有一定的参考价值。

1、刚才未启动zookeeper集群的时候,直接启动kafka脚本程序,kafka报错了,但是进程号启动起来来,再次启动出现如下所示的问题,这里先将进程号杀死,再启动脚本程序。

  1 [[email protected] script_hadoop]$ kafka-start.sh 
  2 start kafkaServer...
  3 [2018-05-22 09:37:26,926] INFO Verifying properties (kafka.utils.VerifiableProperties)
  4 [2018-05-22 09:37:27,003] INFO Property broker.id is overridden to 1 (kafka.utils.VerifiableProperties)
  5 [2018-05-22 09:37:27,004] INFO Property log.cleaner.enable is overridden to false (kafka.utils.VerifiableProperties)
  6 [2018-05-22 09:37:27,004] INFO Property log.dirs is overridden to /tmp/kafka-logs (kafka.utils.VerifiableProperties)
  7 [2018-05-22 09:37:27,004] INFO Property log.retention.check.interval.ms is overridden to 60000 (kafka.utils.VerifiableProperties)
  8 [2018-05-22 09:37:27,005] INFO Property log.retention.hours is overridden to 168 (kafka.utils.VerifiableProperties)
  9 [2018-05-22 09:37:27,005] INFO Property log.segment.bytes is overridden to 536870912 (kafka.utils.VerifiableProperties)
 10 [2018-05-22 09:37:27,005] INFO Property num.io.threads is overridden to 8 (kafka.utils.VerifiableProperties)
 11 [2018-05-22 09:37:27,006] INFO Property num.network.threads is overridden to 2 (kafka.utils.VerifiableProperties)
 12 [2018-05-22 09:37:27,007] INFO Property num.partitions is overridden to 2 (kafka.utils.VerifiableProperties)
 13 [2018-05-22 09:37:27,007] INFO Property port is overridden to 9092 (kafka.utils.VerifiableProperties)
 14 [2018-05-22 09:37:27,008] INFO Property socket.receive.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
 15 [2018-05-22 09:37:27,008] INFO Property socket.request.max.bytes is overridden to 104857600 (kafka.utils.VerifiableProperties)
 16 [2018-05-22 09:37:27,009] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
 17 [2018-05-22 09:37:27,009] INFO Property zookeeper.connect is overridden to slaver1:2181,slaver2:2181,slaver3:2181 (kafka.utils.VerifiableProperties)
 18 [2018-05-22 09:37:27,010] INFO Property zookeeper.connection.timeout.ms is overridden to 1000000 (kafka.utils.VerifiableProperties)
 19 [2018-05-22 09:37:27,039] INFO [Kafka Server 1], starting (kafka.server.KafkaServer)
 20 [2018-05-22 09:37:27,041] INFO [Kafka Server 1], Connecting to zookeeper on slaver1:2181,slaver2:2181,slaver3:2181 (kafka.server.KafkaServer)
 21 [2018-05-22 09:37:27,102] INFO Starting ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
 22 [2018-05-22 09:37:27,139] INFO Client environment:zookeeper.version=3.3.3-1203054, built on 11/17/2011 05:47 GMT (org.apache.zookeeper.ZooKeeper)
 23 [2018-05-22 09:37:27,139] INFO Client environment:host.name=slaver1 (org.apache.zookeeper.ZooKeeper)
 24 [2018-05-22 09:37:27,139] INFO Client environment:java.version=1.7.0_79 (org.apache.zookeeper.ZooKeeper)
 25 [2018-05-22 09:37:27,139] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
 26 [2018-05-22 09:37:27,139] INFO Client environment:java.home=/home/hadoop/soft/jdk1.7.0_79/jre (org.apache.zookeeper.ZooKeeper)
 27 [2018-05-22 09:37:27,140] INFO Client environment:java.class.path=:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/dependant-libs-2.8.0/*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../perf/build/libs//kafka-perf_2.8.0*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../clients/build/libs//kafka-clients*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../examples/build/libs//kafka-examples*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-consumer/build/libs//kafka-hadoop-consumer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-producer/build/libs//kafka-hadoop-producer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/jopt-simple-3.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/kafka_2.9.2-0.8.1.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/log4j-1.2.15.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-annotation-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-core-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/scala-library-2.9.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-api-1.7.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-nop-1.7.6.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/snappy-java-1.0.5.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zkclient-0.3.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zookeeper-3.3.4.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/libs/kafka_2.8.0*.jar (org.apache.zookeeper.ZooKeeper)
 28 [2018-05-22 09:37:27,140] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
 29 [2018-05-22 09:37:27,140] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
 30 [2018-05-22 09:37:27,140] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
 31 [2018-05-22 09:37:27,140] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
 32 [2018-05-22 09:37:27,140] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
 33 [2018-05-22 09:37:27,141] INFO Client environment:os.version=2.6.32-358.el6.x86_64 (org.apache.zookeeper.ZooKeeper)
 34 [2018-05-22 09:37:27,141] INFO Client environment:user.name=hadoop (org.apache.zookeeper.ZooKeeper)
 35 [2018-05-22 09:37:27,141] INFO Client environment:user.home=/home/hadoop (org.apache.zookeeper.ZooKeeper)
 36 [2018-05-22 09:37:27,141] INFO Client environment:user.dir=/home/hadoop (org.apache.zookeeper.ZooKeeper)
 37 [2018-05-22 09:37:27,143] INFO Initiating client connection, connectString=slaver1:2181,slaver2:2181,slaver3:2181 sessionTimeout=6000 [email protected] (org.apache.zookeeper.ZooKeeper)
 38 [2018-05-22 09:37:27,223] INFO Opening socket connection to server slaver3/192.168.19.133:2181 (org.apache.zookeeper.ClientCnxn)
 39 [2018-05-22 09:37:27,247] INFO Socket connection established to slaver3/192.168.19.133:2181, initiating session (org.apache.zookeeper.ClientCnxn)
 40 [2018-05-22 09:37:27,271] INFO Session establishment complete on server slaver3/192.168.19.133:2181, sessionid = 0x363857e11950000, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
 41 [2018-05-22 09:37:27,275] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
 42 [2018-05-22 09:37:27,425] FATAL Fatal error during KafkaServerStable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
 43 kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.
 44     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:95)
 45     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:92)
 46     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
 47     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
 48     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
 49     at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33)
 50     at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
 51     at scala.collection.mutable.WrappedArray.map(WrappedArray.scala:33)
 52     at kafka.log.LogManager.lockLogDirs(LogManager.scala:92)
 53     at kafka.log.LogManager.<init>(LogManager.scala:55)
 54     at kafka.server.KafkaServer.createLogManager(KafkaServer.scala:275)
 55     at kafka.server.KafkaServer.startup(KafkaServer.scala:72)
 56     at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
 57     at kafka.Kafka$.main(Kafka.scala:46)
 58     at kafka.Kafka.main(Kafka.scala)
 59 [2018-05-22 09:37:27,437] INFO [Kafka Server 1], shutting down (kafka.server.KafkaServer)
 60 [2018-05-22 09:37:27,452] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
 61 [2018-05-22 09:37:27,460] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn)
 62 [2018-05-22 09:37:27,461] INFO Session: 0x363857e11950000 closed (org.apache.zookeeper.ZooKeeper)
 63 [2018-05-22 09:37:27,463] INFO [Kafka Server 1], shut down completed (kafka.server.KafkaServer)
 64 [2018-05-22 09:37:27,558] INFO [Kafka Server 1], shutting down (kafka.server.KafkaServer)
 65 [2018-05-22 09:37:30,444] INFO Verifying properties (kafka.utils.VerifiableProperties)
 66 [2018-05-22 09:37:30,525] INFO Property broker.id is overridden to 2 (kafka.utils.VerifiableProperties)
 67 [2018-05-22 09:37:30,526] INFO Property log.cleaner.enable is overridden to false (kafka.utils.VerifiableProperties)
 68 [2018-05-22 09:37:30,526] INFO Property log.dirs is overridden to /tmp/kafka-logs (kafka.utils.VerifiableProperties)
 69 [2018-05-22 09:37:30,527] INFO Property log.retention.check.interval.ms is overridden to 60000 (kafka.utils.VerifiableProperties)
 70 [2018-05-22 09:37:30,527] INFO Property log.retention.hours is overridden to 168 (kafka.utils.VerifiableProperties)
 71 [2018-05-22 09:37:30,527] INFO Property log.segment.bytes is overridden to 536870912 (kafka.utils.VerifiableProperties)
 72 [2018-05-22 09:37:30,528] INFO Property num.io.threads is overridden to 8 (kafka.utils.VerifiableProperties)
 73 [2018-05-22 09:37:30,529] INFO Property num.network.threads is overridden to 2 (kafka.utils.VerifiableProperties)
 74 [2018-05-22 09:37:30,530] INFO Property num.partitions is overridden to 2 (kafka.utils.VerifiableProperties)
 75 [2018-05-22 09:37:30,532] INFO Property port is overridden to 9092 (kafka.utils.VerifiableProperties)
 76 [2018-05-22 09:37:30,533] INFO Property socket.receive.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
 77 [2018-05-22 09:37:30,534] INFO Property socket.request.max.bytes is overridden to 104857600 (kafka.utils.VerifiableProperties)
 78 [2018-05-22 09:37:30,534] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
 79 [2018-05-22 09:37:30,535] INFO Property zookeeper.connect is overridden to slaver1:2181,slaver2:2181,slaver3:2181 (kafka.utils.VerifiableProperties)
 80 [2018-05-22 09:37:30,537] INFO Property zookeeper.connection.timeout.ms is overridden to 1000000 (kafka.utils.VerifiableProperties)
 81 [2018-05-22 09:37:30,567] INFO [Kafka Server 2], starting (kafka.server.KafkaServer)
 82 [2018-05-22 09:37:30,569] INFO [Kafka Server 2], Connecting to zookeeper on slaver1:2181,slaver2:2181,slaver3:2181 (kafka.server.KafkaServer)
 83 [2018-05-22 09:37:30,622] INFO Starting ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
 84 [2018-05-22 09:37:30,674] INFO Client environment:zookeeper.version=3.3.3-1203054, built on 11/17/2011 05:47 GMT (org.apache.zookeeper.ZooKeeper)
 85 [2018-05-22 09:37:30,674] INFO Client environment:host.name=slaver2 (org.apache.zookeeper.ZooKeeper)
 86 [2018-05-22 09:37:30,674] INFO Client environment:java.version=1.7.0_79 (org.apache.zookeeper.ZooKeeper)
 87 [2018-05-22 09:37:30,674] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
 88 [2018-05-22 09:37:30,674] INFO Client environment:java.home=/home/hadoop/soft/jdk1.7.0_79/jre (org.apache.zookeeper.ZooKeeper)
 89 [2018-05-22 09:37:30,675] INFO Client environment:java.class.path=:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/dependant-libs-2.8.0/*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../perf/build/libs//kafka-perf_2.8.0*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../clients/build/libs//kafka-clients*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../examples/build/libs//kafka-examples*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-consumer/build/libs//kafka-hadoop-consumer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-producer/build/libs//kafka-hadoop-producer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/jopt-simple-3.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/kafka_2.9.2-0.8.1.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/log4j-1.2.15.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-annotation-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-core-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/scala-library-2.9.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-api-1.7.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-nop-1.7.6.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/snappy-java-1.0.5.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zkclient-0.3.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zookeeper-3.3.4.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/libs/kafka_2.8.0*.jar (org.apache.zookeeper.ZooKeeper)
 90 [2018-05-22 09:37:30,675] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
 91 [2018-05-22 09:37:30,675] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
 92 [2018-05-22 09:37:30,675] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
 93 [2018-05-22 09:37:30,676] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
 94 [2018-05-22 09:37:30,678] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
 95 [2018-05-22 09:37:30,678] INFO Client environment:os.version=2.6.32-358.el6.x86_64 (org.apache.zookeeper.ZooKeeper)
 96 [2018-05-22 09:37:30,679] INFO Client environment:user.name=hadoop (org.apache.zookeeper.ZooKeeper)
 97 [2018-05-22 09:37:30,679] INFO Client environment:user.home=/home/hadoop (org.apache.zookeeper.ZooKeeper)
 98 [2018-05-22 09:37:30,679] INFO Client environment:user.dir=/home/hadoop (org.apache.zookeeper.ZooKeeper)
 99 [2018-05-22 09:37:30,681] INFO Initiating client connection, connectString=slaver1:2181,slaver2:2181,slaver3:2181 sessionTimeout=6000 [email protected] (org.apache.zookeeper.ZooKeeper)
100 [2018-05-22 09:37:30,723] INFO Opening socket connection to server slaver1/192.168.19.131:2181 (org.apache.zookeeper.ClientCnxn)
101 [2018-05-22 09:37:30,732] INFO Socket connection established to slaver1/192.168.19.131:2181, initiating session (org.apache.zookeeper.ClientCnxn)
102 [2018-05-22 09:37:30,752] INFO Session establishment complete on server slaver1/192.168.19.131:2181, sessionid = 0x163857dfeaa0001, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
103 [2018-05-22 09:37:30,758] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
104 [2018-05-22 09:37:31,139] FATAL Fatal error during KafkaServerStable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
105 kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.
106     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:95)
107     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:92)
108     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
109     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
110     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
111     at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33)
112     at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
113     at scala.collection.mutable.WrappedArray.map(WrappedArray.scala:33)
114     at kafka.log.LogManager.lockLogDirs(LogManager.scala:92)
115     at kafka.log.LogManager.<init>(LogManager.scala:55)
116     at kafka.server.KafkaServer.createLogManager(KafkaServer.scala:275)
117     at kafka.server.KafkaServer.startup(KafkaServer.scala:72)
118     at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
119     at kafka.Kafka$.main(Kafka.scala:46)
120     at kafka.Kafka.main(Kafka.scala)
121 [2018-05-22 09:37:31,153] INFO [Kafka Server 2], shutting down (kafka.server.KafkaServer)
122 [2018-05-22 09:37:31,173] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
123 [2018-05-22 09:37:31,184] INFO Session: 0x163857dfeaa0001 closed (org.apache.zookeeper.ZooKeeper)
124 [2018-05-22 09:37:31,185] INFO [Kafka Server 2], shut down completed (kafka.server.KafkaServer)
125 [2018-05-22 09:37:31,186] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn)
126 [2018-05-22 09:37:31,266] INFO [Kafka Server 2], shutting down (kafka.server.KafkaServer)
127 [2018-05-22 09:37:33,769] INFO Verifying properties (kafka.utils.VerifiableProperties)
128 [2018-05-22 09:37:33,891] INFO Property broker.id is overridden to 3 (kafka.utils.VerifiableProperties)
129 [2018-05-22 09:37:33,892] INFO Property log.cleaner.enable is overridden to false (kafka.utils.VerifiableProperties)
130 [2018-05-22 09:37:33,892] INFO Property log.dirs is overridden to /tmp/kafka-logs (kafka.utils.VerifiableProperties)
131 [2018-05-22 09:37:33,892] INFO Property log.retention.check.interval.ms is overridden to 60000 (kafka.utils.VerifiableProperties)
132 [2018-05-22 09:37:33,893] INFO Property log.retention.hours is overridden to 168 (kafka.utils.VerifiableProperties)
133 [2018-05-22 09:37:33,893] INFO Property log.segment.bytes is overridden to 536870912 (kafka.utils.VerifiableProperties)
134 [2018-05-22 09:37:33,893] INFO Property num.io.threads is overridden to 8 (kafka.utils.VerifiableProperties)
135 [2018-05-22 09:37:33,895] INFO Property num.network.threads is overridden to 2 (kafka.utils.VerifiableProperties)
136 [2018-05-22 09:37:33,896] INFO Property num.partitions is overridden to 2 (kafka.utils.VerifiableProperties)
137 [2018-05-22 09:37:33,897] INFO Property port is overridden to 9092 (kafka.utils.VerifiableProperties)
138 [2018-05-22 09:37:33,897] INFO Property socket.receive.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
139 [2018-05-22 09:37:33,898] INFO Property socket.request.max.bytes is overridden to 104857600 (kafka.utils.VerifiableProperties)
140 [2018-05-22 09:37:33,899] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
141 [2018-05-22 09:37:33,900] INFO Property zookeeper.connect is overridden to slaver1:2181,slaver2:2181,slaver3:2181 (kafka.utils.VerifiableProperties)
142 [2018-05-22 09:37:33,901] INFO Property zookeeper.connection.timeout.ms is overridden to 1000000 (kafka.utils.VerifiableProperties)
143 [2018-05-22 09:37:33,928] INFO [Kafka Server 3], starting (kafka.server.KafkaServer)
144 [2018-05-22 09:37:33,930] INFO [Kafka Server 3], Connecting to zookeeper on slaver1:2181,slaver2:2181,slaver3:2181 (kafka.server.KafkaServer)
145 [2018-05-22 09:37:33,989] INFO Starting ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
146 [2018-05-22 09:37:34,010] INFO Client environment:zookeeper.version=3.3.3-1203054, built on 11/17/2011 05:47 GMT (org.apache.zookeeper.ZooKeeper)
147 [2018-05-22 09:37:34,010] INFO Client environment:host.name=slaver3 (org.apache.zookeeper.ZooKeeper)
148 [2018-05-22 09:37:34,010] INFO Client environment:java.version=1.7.0_79 (org.apache.zookeeper.ZooKeeper)
149 [2018-05-22 09:37:34,010] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
150 [2018-05-22 09:37:34,011] INFO Client environment:java.home=/home/hadoop/soft/jdk1.7.0_79/jre (org.apache.zookeeper.ZooKeeper)
151 [2018-05-22 09:37:34,011] INFO Client environment:java.class.path=:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/dependant-libs-2.8.0/*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../perf/build/libs//kafka-perf_2.8.0*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../clients/build/libs//kafka-clients*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../examples/build/libs//kafka-examples*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-consumer/build/libs//kafka-hadoop-consumer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../contrib/hadoop-producer/build/libs//kafka-hadoop-producer*.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/jopt-simple-3.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/kafka_2.9.2-0.8.1.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/log4j-1.2.15.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-annotation-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/metrics-core-2.2.0.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/scala-library-2.9.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-api-1.7.2.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/slf4j-nop-1.7.6.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/snappy-java-1.0.5.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zkclient-0.3.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../libs/zookeeper-3.3.4.jar:/home/hadoop/soft/kafka_2.9.2-0.8.1/bin/../core/build/libs/kafka_2.8.0*.jar (org.apache.zookeeper.ZooKeeper)
152 [2018-05-22 09:37:34,011] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
153 [2018-05-22 09:37:34,011] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
154 [2018-05-22 09:37:34,011] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
155 [2018-05-22 09:37:34,012] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
156 [2018-05-22 09:37:34,012] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
157 [2018-05-22 09:37:34,013] INFO Client environment:os.version=2.6.32-358.el6.x86_64 (org.apache.zookeeper.ZooKeeper)
158 [2018-05-22 09:37:34,014] INFO Client environment:user.name=hadoop (org.apache.zookeeper.ZooKeeper)
159 [2018-05-22 09:37:34,014] INFO Client environment:user.home=/home/hadoop (org.apache.zookeeper.ZooKeeper)
160 [2018-05-22 09:37:34,015] INFO Client environment:user.dir=/home/hadoop (org.apache.zookeeper.ZooKeeper)
161 [2018-05-22 09:37:34,017] INFO Initiating client connection, connectString=slaver1:2181,slaver2:2181,slaver3:2181 sessionTimeout=6000 [email protected] (org.apache.zookeeper.ZooKeeper)
162 [2018-05-22 09:37:34,081] INFO Opening socket connection to server slaver1/192.168.19.131:2181 (org.apache.zookeeper.ClientCnxn)
163 [2018-05-22 09:37:34,091] INFO Socket connection established to slaver1/192.168.19.131:2181, initiating session (org.apache.zookeeper.ClientCnxn)
164 [2018-05-22 09:37:34,106] INFO Session establishment complete on server slaver1/192.168.19.131:2181, sessionid = 0x163857dfeaa0002, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
165 [2018-05-22 09:37:34,111] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
166 [2018-05-22 09:37:34,268] FATAL Fatal error during KafkaServerStable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
167 kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.
168     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:95)
169     at kafka.log.LogManager$$anonfun$lockLogDirs$1.apply(LogManager.scala:92)
170     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
171     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
172     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
173     at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33)
174     at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
175     at scala.collection.mutable.WrappedArray.map(WrappedArray.scala:33)
176     at kafka.log.LogManager.lockLogDirs(LogManager.scala:92)
177     at kafka.log.LogManager.<init>(LogManager.scala:55)
178     at kafka.server.KafkaServer.createLogManager(KafkaServer.scala:275)
179     at kafka.server.KafkaServer.startup(KafkaServer.scala:72)
180     at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
181     at kafka.Kafka$.main(Kafka.scala:46)
182     at kafka.Kafka.main(Kafka.scala)
183 [2018-05-22 09:37:34,279] INFO [Kafka Server 3], shutting down (kafka.server.KafkaServer)
184 [2018-05-22 09:37:34,304] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
185 [2018-05-22 09:37:34,311] INFO Session: 0x163857dfeaa0002 closed (org.apache.zookeeper.ZooKeeper)
186 [2018-05-22 09:37:34,311] INFO [Kafka Server 3], shut down completed (kafka.server.KafkaServer)
187 [2018-05-22 09:37:34,312] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn)
188 [2018-05-22 09:37:34,559] INFO [Kafka Server 3], shutting down (kafka.server.KafkaServer)
189 [[email protected] script_hadoop]$ jps
190 2898 Jps
191 2802 QuorumPeerMain
192 2725 Kafka
193 [[email protected] script_hadoop]$ 

 

以上是关于kafka.common.KafkaException: Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instan的主要内容,如果未能解决你的问题,请参考以下文章