为什么Apache Flink不在Windows上运行?

发布于 2025-01-26 11:48:50 字数 747 浏览 2 评论 0原文

我是新手,我是第一次使用Apache Flink。我已经在Windows中下载了Flink-1.14.4-bin-scala_2.12版本,我已经安装了Cygwin在Windows中运行SH文件。我还在Windows 10 OS上安装了Java 11。

我正在关注据我执行脚本 bin/start-cluster.sh ,这在cygwin终端显示

启动群集。
在主持人Simli上启动独立的守护程序。
在主机上启动taskexecutor守护程序。

但是,在执行此命令之后,Apache Flink Web UI并未在http:// localhost:8081/

我在这里丢失一些非常简单的东西吗? 我还提到一个问题,但似乎我已经安​​装了正确的Java版本(Java 11)。

I am a newbie and I am using apache flink for the first time. I have downloaded flink-1.14.4-bin-scala_2.12 version in windows, I have installed cygwin to run the sh files in windows. I have also installed java 11 on my windows 10 os.

I am following this documentation according to which I am executing the script bin/start-cluster.sh and this is shown on the cygwin terminal

Starting cluster.
Starting standalonesession daemon on host Simli.
Starting taskexecutor daemon on host Simli.

but after executing this command, the apache flink web UI is not starting at http://localhost:8081/

Am I missing something really simple here?
I have also referred to this question but it seems that I have installed the correct version of java (java 11).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

归途 2025-02-02 11:48:50

Windows和Cygwin上的线路结尾字符似乎存在问题。

  1. 启动cygwin shell。

  2. 通过输入来确定您的主目录

; PWD

这将返回Cygwin root路径下的路径。

  1. 使用Notepad,WordPad或其他文本编辑器在主目录中打开文件.bash_profile并附加以下内容(如果不存在文件,则必须创建它):

$ export shellopts

$ SET -O IGNCR

保存文件并打开一个新的bash shell(只是句子导出...并设置...而不是$,以防万一)。

  1. 暂时文件夹名称上还有另一个错误,其中包含字符':',并且它在Windows上不起作用,可以修复此问题edit /conf/flink-conf.yaml并添加

taskmanager.resource-ID: TM_LOCALHOST

此设置的缺点是每个执行情况都不会有特定的文件夹,并且它将在Cygwin

参考的临时文件夹上具有该名称:

flink任务管理器未启动问题

flink的windows/cygwin手动修复

apace flink:任务经理未能启动-Mapohl的评论

flink的邮件列表

There seems to be an issue with line endings characters on Windows and Cygwin.

  1. Start a Cygwin shell.

  2. Determine your home directory by entering

cd; pwd

This will return a path under the Cygwin root path.

  1. Using NotePad, WordPad or a different text editor open the file .bash_profile in the home directory and append the following (if the file does not exist you will have to create it):

$ export SHELLOPTS

$ set -o igncr

Save the file and open a new bash shell (just the sentences export... and set..., not the $, just in case).

  1. There is another error on a temporal folder name that includes the character ':', and it doesn't work on windows, to fix this issue edit /conf/flink-conf.yaml and add

taskmanager.resource-id: tm_localhost

The drawback of this setting is that there will be no specific folder per execution, and it will have that name on the temporal folder of cygwin

References:

Flink Task manager not started issue

Flink's windows/cygwin manual fix

Apace Flink : Task Manager failed to start - mapohl's comment

Flink's mail list

肩上的翅膀 2025-02-02 11:48:50

对于Newbie,为了尽快体验Flink的新功能,并避免安装环境的麻烦,我认为您可以尝试安装Docker。

Flink Docker-compose.yml:

version: '2.1'
services:
  sql-client:
    user: flink:flink
    image: yuxialuo/flink-sql-client:1.13.2.v1 
    depends_on:
      - jobmanager
      - mysql
    environment:
      FLINK_JOBMANAGER_HOST: jobmanager
      MYSQL_HOST: mysql
    volumes:
      - shared-tmpfs:/tmp/iceberg
  jobmanager:
    user: flink:flink
    image: flink:1.13.2-scala_2.11
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
    volumes:
      - shared-tmpfs:/tmp/iceberg
  taskmanager:
    user: flink:flink
    image: flink:1.13.2-scala_2.11
    depends_on:
      - jobmanager
    command: taskmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2
    volumes:
      - shared-tmpfs:/tmp/iceberg
  mysql:
    image: debezium/example-mysql:1.1
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_USER=mysqluser
      - MYSQL_PASSWORD=mysqlpw

volumes:
  shared-tmpfs:
    driver: local
    driver_opts:
      type: "tmpfs"
      device: "tmpfs"

然后在docker-compose.yml文件所在的当前目录中启动flink组件。

docker-compose up -d

此命令将自动启动Docker中定义的所有容器以独立模式组成配置。

您可以通过访问来检查Flink是否正常运行:http:// localhost:8081/

您也可以在Dockerhub上搜索所需的图像的Flink版本:https://hub.dock.docker.com/r/apache/flink /标签

For newbie, in order to experience the new features of Flink as soon as possible in windows, and to avoid the trouble of installing the environment, I think you can try to install Docker.

Flink docker-compose.yml:

version: '2.1'
services:
  sql-client:
    user: flink:flink
    image: yuxialuo/flink-sql-client:1.13.2.v1 
    depends_on:
      - jobmanager
      - mysql
    environment:
      FLINK_JOBMANAGER_HOST: jobmanager
      MYSQL_HOST: mysql
    volumes:
      - shared-tmpfs:/tmp/iceberg
  jobmanager:
    user: flink:flink
    image: flink:1.13.2-scala_2.11
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
    volumes:
      - shared-tmpfs:/tmp/iceberg
  taskmanager:
    user: flink:flink
    image: flink:1.13.2-scala_2.11
    depends_on:
      - jobmanager
    command: taskmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2
    volumes:
      - shared-tmpfs:/tmp/iceberg
  mysql:
    image: debezium/example-mysql:1.1
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_USER=mysqluser
      - MYSQL_PASSWORD=mysqlpw

volumes:
  shared-tmpfs:
    driver: local
    driver_opts:
      type: "tmpfs"
      device: "tmpfs"

Then start the Flink component in the current directory where the docker-compose.yml file is located.

docker-compose up -d

This command will automatically start all the containers defined in the Docker Compose configuration in detached mode.

You can check if Flink is running properly by visiting: http://localhost:8081/

You can also search for the Flink version of the image you want on DockerHub:https://hub.docker.com/r/apache/flink/tags

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文