Flink standalone方式搭建及问题

通过Docker一键搭建,以下是模板。

version: '3.1'
services:
  jobmanager:
    image: flink:latest
    ports:
      - "8081:8081"
    command: jobmanager
    volumes:
      - ./jobs:/opt/flink/jobs:rw
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
    deploy:
      resources:
         limits:
            cpus: "2.00"
            memory: 4G

  taskmanager:
    image: flink:latest
    depends_on:
      - jobmanager
    command: taskmanager
    scale: 2
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2
    deploy:
      resources:
         limits:
            cpus: "2.00"
            memory: 4G

遇到的坑1、class传参问题

【错误】./bin/flink run ./jobs/flinkpgsql-1.0-SNAPSHOT-jar-with-dependencies.jar -c cn.sdust.jtyhzl.packingcnt.ParkingCnt

【正确】./bin/flink run -c cn.sdust.jtyhzl.packingcnt.ParkingCnt ./jobs/flinkpgsql-1.0-SNAPSHOT-jar-with-dependencies.jar

【结论】 flink run 传参只能放脚本地址前面。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Captcha Code