与作业管理器通信失败flink中的wordcount示例中出现错误

h9a6wy2h  于 2021-06-24  发布在  Flink
关注(0)|答案(1)|浏览(363)

我尝试运行wordcount示例: ../bin/flink run WordCount.jar 并在执行几分钟后给我一个“与jobmanager通信失败错误”。
资料来源:https://github.com/apache/flink/blob/master/flink-examples/flink-scala-examples
例外情况如下:

Executing WordCount example with built-in default data.
  Provide parameters to read input data from a file.
  Usage: WordCount <text path> <result path>
org.apache.flink.client.program.ProgramInvocationException: The program execution failed: Communication with JobManager failed: Lost connection to the JobManager.
  at org.apache.flink.client.program.Client.runBlocking(Client.java:370)
  at org.apache.flink.client.program.Client.runBlocking(Client.java:348)
  at org.apache.flink.client.program.Client.runBlocking(Client.java:315)
  at org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:70)
  at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:804)
  at org.apache.flink.api.java.DataSet.collect(DataSet.java:410)
  at org.apache.flink.api.java.DataSet.print(DataSet.java:1495)
  at org.apache.flink.examples.java.wordcount.WordCount.main(WordCount.java:80)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:497)
  at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:395)
  at org.apache.flink.client.program.Client.runBlocking(Client.java:252)
  at org.apache.flink.client.CliFrontend.executeProgramBlocking(CliFrontend.java:675)
  at org.apache.flink.client.CliFrontend.run(CliFrontend.java:326)
  at org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:977)
  at org.apache.flink.client.CliFrontend.main(CliFrontend.java:1027)
Caused by: org.apache.flink.runtime.client.JobExecutionException: Communication with JobManager failed: Lost connection to the JobManager.
  at org.apache.flink.runtime.client.JobClient.submitJobAndWait(JobClient.java:141)
  at org.apache.flink.client.program.Client.runBlocking(Client.java:368)
... 18 more
Caused by: org.apache.flink.runtime.client.JobClientActorConnectionTimeoutException: Lost connection to the JobManager.
  at org.apache.flink.runtime.client.JobClientActor.handleMessage(JobClientActor.java:243)
  at org.apache.flink.runtime.akka.FlinkUntypedActor.handleLeaderSessionID(FlinkUntypedActor.java:88)
  at org.apache.flink.runtime.akka.FlinkUntypedActor.onReceive(FlinkUntypedActor.java:68)
  at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167)
  at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
  at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97)
  at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
  at akka.actor.ActorCell.invoke(ActorCell.scala:487)
/src/main/scala/org/apache/flink/examples/scala/wordcount/WordCount.scala
  at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
  at akka.dispatch.Mailbox.run(Mailbox.scala:221)
  at akka.dispatch.Mailbox.exec(Mailbox.scala:231)  
  at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)   
  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
  at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

尝试运行命令时出现上述异常。

gv8xihay

gv8xihay1#

我通过分析@till建议的日志解决了这个问题。服务器运行不正常。重新启动所有服务器。

相关问题