Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否可以支持 rest client 提交 job #51

Open
EarthChen opened this issue Jun 8, 2021 · 2 comments
Open

是否可以支持 rest client 提交 job #51

EarthChen opened this issue Jun 8, 2021 · 2 comments

Comments

@EarthChen
Copy link

EarthChen commented Jun 8, 2021

环境

  • flink:1.12.0-scala_2.11 standalone
  • flink-streaming-platform-web 1.3.0
version: '3'
services:
#  flink-stream-web:
#    build: .
#    ports:
#      - "8080:8080"
#    environment:
#      MYSQL_HOST: 192.168.200.159
#      MYSQL_PORT: 3306
#      MYSQL_USERNAME: root
#      MYSQL_PASSWORD: 123456
#      JVM_OPTS: ""
#      SPRING_ENV: prod
#      SERVER_PORT: 8080
#    volumes:
#    - ./data/flink:/opt/flink/
#    depends_on:
#      - mysql
#    links:
#      - mysql
#  mysql:
#    image: mysql:8.0.19
#    command: --default-authentication-plugin=mysql_native_password
#    environment:
#      MYSQL_USER: "flink_web"
#      MYSQL_PASSWORD: "flink_web"
#      MYSQL_DATABASE: "flink_web"
#      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
#    volumes:
#      - ./docs/sql:/docker-entrypoint-initdb.d
  jobmanager:
    image: flink:1.12.0-scala_2.11
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
#    volumes:
#      - ./data/flink/:/opt/flink/
  taskmanager:
    image: flink:1.12.0-scala_2.11
    depends_on:
      - jobmanager
    command: taskmanager
    scale: 1
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2

问题

本地运行了一下 flink 和 flink-streaming-platform-web,发现最终在提交 job 时是使用 shell 使用配置的 flink client 提交任务
那就需要该平台需要和 jobmanager部署在一台机器上,如果最终部署在 docker(k8s)上就需要将两者打包到一起(一个容器两个进程),这样是不太好的,同时由于 sql 会被写入文件,如果不在一个实例中,这时候文件无法被访问

建议

  1. 是否可以改为使用 rest client 进行提交 job?
  2. 将提交的 sql 和 jar 包划分单独路径,最终容器部署时使用共享磁盘使其能够共享?
@zairushice
Copy link

你可以只部署你的服务,然后服务器上放一个flink客户端挂载到容器内部,提交任务的时候-m指定远端flink集群地址就行了

@YoungNovice
Copy link

https://nightlies.apache.org/flink/flink-docs-release-1.14/zh/docs/ops/rest_api/#jobs-1
你好 flink现在支持提交sql任务么, 我看了下rest api列表好像只支持jar方式提交job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants