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

查看:64
本文介绍了由于无法找到或加载主类错误,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.11.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://www.thewindowsclub.com/how-to-run-sh-or-shell-script-file-in-windows-10(第 1 部分使用 WSL 执行 Shell 脚本文件)
  2. 让 Ubuntu for win 10 运行 Linux 命令(运行 .sh 文件),这可以通过进入 Microsoft Store 并下载首选的 Linux 发行版来实现.(或在 Windows 中打开 PowerShell,键入 bash 以获取简单信息)
  3. 在 Ubuntu 上安装 OpenJDK,如下:https://askubuntu.com/问题/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天全站免登陆