flink安装启动(docker)

参考https://hub.docker.com/_/flink/

 

相关端口
The Web Client is on port 8081
JobManager RPC port 6123
TaskManagers RPC port 6122
TaskManagers Data port 6121

 

mkdir /opt/flink -p
vim /opt/flink/docker-compose.yml

version: "2.1"
services:
  jobmanager:
    image: flink
    expose:
      - "6123"
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager
  taskmanager:
    image: flink
    expose:
      - "6121"
      - "6122"
    depends_on:
      - jobmanager
    command: taskmanager
    links:
      - "jobmanager:jobmanager"
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager

 

生成启动
cd /opt/flink/
docker-compose build
docker-compose up -d --force-recreate
docker-compose down
docker-compose restart


查看日志
docker logs --tail="500" flink_jobmanager_1
docker logs -f flink_taskmanager_1

查看进程
netstat -anltp|grep 8081

复制出配置文件
docker cp flink_jobmanager_1:/opt/flink/conf/ /opt/flink/conf_bak/

进入容器
docker exec -it --user root flink_jobmanager_1 /bin/bash

浏览器上查看页面dashboard
http://192.168.0.101:8081

 

posted @ 2019-11-13 15:12  wintersoft  阅读(4356)  评论(0编辑  收藏  举报