dolphinscheduler 2.0.3 Docker部署 不支持mysql的解决办法

由于商业许可证的原因,不能直接使用mysql驱动包,但是我们可以自己制作镜像,官网也有回答.
https://dolphinscheduler.apache.org/zh-cn/docs/2.0.3/user_doc/guide/installation/docker.html
按照官网的回答,依然会有些坑,docker-compose.yml的配置注意事项应当如下:

1:mysql数据源的配置
dolphinscheduler 2.0.3 Docker部署 不支持mysql的解决办法_第1张图片

2: zookeeper,官方的这条回答中在这里插入图片描述
其中zookeeper的image字段是不能更换的,所以配置如下,不变

dolphinscheduler 2.0.3 Docker部署 不支持mysql的解决办法_第2张图片
3:api,alert,master,worker中,depends_on字段依然是- dolphinscheduler-postgresql,需要注释掉,更换为- dolphinscheduler-mysql,官方文档并未说明。应当如下:
dolphinscheduler 2.0.3 Docker部署 不支持mysql的解决办法_第3张图片

4:最后vollumes加上mysql
dolphinscheduler 2.0.3 Docker部署 不支持mysql的解决办法_第4张图片
其他操作和官方文档一样,以上为补充点。
所以docker-compose.yml全部配置如下

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: "3.1"

services:

  dolphinscheduler-mysql:
    #image: apache/dolphinscheduler:mysql-driver
    image:  bitnami/mysql:latest
    environment:
      TZ: Asia/Shanghai
      MYSQL_USERNAME: root
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: dolphinscheduler
    volumes:
    - dolphinscheduler-mysql:/bitnami/mysql
    restart: unless-stopped
    networks:
    - dolphinscheduler

 # dolphinscheduler-postgresql:
 #   image: bitnami/postgresql:11.11.0
  #  environment:
 #     TZ: Asia/Shanghai
  #    POSTGRESQL_USERNAME: root
  #    POSTGRESQL_PASSWORD: root
  #    POSTGRESQL_DATABASE: dolphinscheduler
  #  volumes:
  #  - dolphinscheduler-postgresql:/bitnami/postgresql
  #  restart: unless-stopped
  #  networks:
  #  - dolphinscheduler

  dolphinscheduler-zookeeper:
    image: bitnami/zookeeper:3.6.2
    environment:
      TZ: Asia/Shanghai
      ALLOW_ANONYMOUS_LOGIN: "yes"
      ZOO_4LW_COMMANDS_WHITELIST: srvr,ruok,wchs,cons
    volumes:
    - dolphinscheduler-zookeeper:/bitnami/zookeeper
    restart: unless-stopped
    networks:
    - dolphinscheduler

  dolphinscheduler-api:
   # image: apache/dolphinscheduler:2.0.3
    image: apache/dolphinscheduler:mysql-driver
    command: api-server
    ports:
    - 12345:12345
    environment:
      TZ: Asia/Shanghai
    env_file: config.env.sh
    healthcheck:
      test: ["CMD", "/root/checkpoint.sh", "ApiApplicationServer"]
      interval: 30s
      timeout: 5s
      retries: 3
    depends_on:
    - dolphinscheduler-mysql
    #- dolphinscheduler-postgresql
    - dolphinscheduler-zookeeper
    volumes:
    - dolphinscheduler-logs:/opt/dolphinscheduler/logs
    - dolphinscheduler-shared-local:/opt/soft
    - dolphinscheduler-resource-local:/dolphinscheduler
    restart: unless-stopped
    networks:
    - dolphinscheduler

  dolphinscheduler-alert:
    #image: apache/dolphinscheduler:2.0.3
    image: apache/dolphinscheduler:mysql-driver
    command: alert-server
    environment:
      TZ: Asia/Shanghai
    env_file: config.env.sh
    healthcheck:
      test: ["CMD", "/root/checkpoint.sh", "AlertServer"]
      interval: 30s
      timeout: 5s
      retries: 3
    depends_on:
    #- dolphinscheduler-postgresql
    - dolphinscheduler-mysql
    volumes:
    - dolphinscheduler-logs:/opt/dolphinscheduler/logs
    restart: unless-stopped
    networks:
    - dolphinscheduler

  dolphinscheduler-master:
    #image: apache/dolphinscheduler:2.0.3
    image: apache/dolphinscheduler:mysql-driver
    command: master-server
    environment:
      TZ: Asia/Shanghai
    env_file: config.env.sh
    healthcheck:
      test: ["CMD", "/root/checkpoint.sh", "MasterServer"]
      interval: 30s
      timeout: 5s
      retries: 3
    depends_on:
    #- dolphinscheduler-postgresql
    - dolphinscheduler-mysql
    - dolphinscheduler-zookeeper
    volumes:
    - dolphinscheduler-logs:/opt/dolphinscheduler/logs
    - dolphinscheduler-shared-local:/opt/soft
    restart: unless-stopped
    networks:
    - dolphinscheduler

  dolphinscheduler-worker:
    #image: apache/dolphinscheduler:2.0.3
    image: apache/dolphinscheduler:mysql-driver
    command: worker-server
    environment:
      TZ: Asia/Shanghai
    env_file: config.env.sh
    healthcheck:
      test: ["CMD", "/root/checkpoint.sh", "WorkerServer"]
      interval: 30s
      timeout: 5s
      retries: 3
    depends_on:
    #- dolphinscheduler-postgresql
    - dolphinscheduler-mysql
    - dolphinscheduler-zookeeper
    volumes:
    - dolphinscheduler-worker-data:/tmp/dolphinscheduler
    - dolphinscheduler-logs:/opt/dolphinscheduler/logs
    - dolphinscheduler-shared-local:/opt/soft
    - dolphinscheduler-resource-local:/dolphinscheduler
    restart: unless-stopped
    networks:
    - dolphinscheduler

networks:
  dolphinscheduler:
    driver: bridge

volumes:
  dolphinscheduler-mysql:
  dolphinscheduler-postgresql:
  dolphinscheduler-zookeeper:
  dolphinscheduler-worker-data:
  dolphinscheduler-logs:
  dolphinscheduler-shared-local:
  dolphinscheduler-resource-local:

你可能感兴趣的:(笔记,大数据)