由于找不到或加载主类错误而导致Flink群集无法启动 [英] Flink cluster not starting due to Could not find or load main class error

查看:543
本文介绍了由于找不到或加载主类错误而导致Flink群集无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 flink 并运行集群,尽管我得到以下输出,看上去好像集群已启动:

I am trying to set up flink and run a cluster, although I get the following output which seems like the cluster started:

$ ./bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host LAPTOP-HRAHBL24.
Starting taskexecutor daemon on host LAPTOP-HRAHBL24.

当我进入localhost:8081时,连接被拒绝,因此我检查了flink日志,并在taskexecutor日志中看到以下错误:

When I go to localhost:8081 the connection gets refused, so I checked the flink logs and in the taskexecutor logs I see the following error:

Error: Could not find or load main class org.apache.flink.runtime.taskexecutor.TaskManagerRunner

在独立日志中,我得到以下信息:

and in the standalone logs I get this:

Error: Could not find or load main class org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint

我一直在搜索互联网,找不到任何东西.我的java env 和系统变量是正确的,因为我可以看到java -version和 javac -version的输出.我正在使用 java 8 ,特别是 jdk1.8.0_251 .我用 Flink 1.10.1 1.5.0 尝试了上述方法,两者都给了我相同的错误.关于如何解决此问题的任何想法?

I have been searching the internet and couldn't find anything. My java env and system variables are correct as I can see the output of java -version and javac -version. I am using java 8, specifically jdk1.8.0_251. I tried the above with Flink 1.10.1 and 1.5.0, both give me the same error. Any idea on how to resolve this?

推荐答案

我遇到了同样的问题,但是现在我能够启动集群并看到localhost:8081 UI.

I was experiencing the same issue, but now I am able to start the cluster and see the localhost:8081 UI.

这是我采取的步骤:

  1. 针对Windows的激活 WSL : https://askubuntu.com/Questions/746413/trying-to-install-java-8-unable-to-locate-package-openjdk-8-jre (首先打开Linux shell,然后按照说明进行操作)
  1. Activation WSL for windows : https://www.thewindowsclub.com/how-to-run-sh-or-shell-script-file-in-windows-10 (part 1 Execute Shell Script file using WSL)
  2. Getting Ubuntu for win 10 to run Linux commands (running the .sh files), this can be achieved by going into Microsoft Store and downloading the preferred distribution of Linux. (Or open PowerShell in windows, type bash for easy info)
  3. Installing OpenJDK on the Ubuntu, following: https://askubuntu.com/questions/746413/trying-to-install-java-8-unable-to-locate-package-openjdk-8-jre (first open Linux shell, then follow the instructions)


完成这些步骤后,您应该能够在 Apache Flink 1.11.2 文件夹中打开Linux Shell,并运行 ./bin/start-cluster.sh 没问题.


After these steps you should be able to open Linux Shell in Apache Flink 1.11.2 folder and run ./bin/start-cluster.sh without any problem.

这篇关于由于找不到或加载主类错误而导致Flink群集无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆