Docker compose方式部署doris

1.背景

接到个任务,在新服务器上部署doris,为了统一管理,采用docker-compose方式部署。

这对初接触运维的小白来说,过程是坎坷的,不说了,直接分享步骤

2.宿主机上执行

sysctl -w vm.max_map_count=2000000

3.docker-compose.yml(亲测可用版)

3FE-3BE方式


version: '3'
services:
  docker-fe-01:
    image: "apache/doris:1.2.2-fe-x86_64"
    container_name: "doris-fe-01"
    hostname: "fe-01"
    restart: always
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - FE_ID=1
    ports:
      - 9026:8030
      - 9027:9030
    volumes:
      - /home/doris/data/fe-1/doris-meta:/opt/apache-doris/fe/doris-meta
      - /home/doris/data/fe-1/log:/opt/apache-doris/fe/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.2
  docker-fe-02:
    image: "apache/doris:1.2.2-fe-x86_64"
    container_name: "doris-fe-02"
    hostname: "fe-02"
    restart: always
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - FE_ID=2
    ports:
      - 8028:8030
      - 9029:9030
    volumes:
      - /home/doris/data/fe-2/doris-meta:/opt/apache-doris/fe/doris-meta
      - /home/doris/data/fe-2/log:/opt/apache-doris/fe/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.3
  docker-fe-03:
    image: "apache/doris:1.2.2-fe-x86_64"
    container_name: "doris-fe-03"
    hostname: "fe-03"
    restart: always
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - FE_ID=3
    ports:
      - 9030:8030
      - 9035:9030
    volumes:
      - /home/doris/data/fe-3/doris-meta:/opt/apache-doris/fe/doris-meta
      - /home/doris/data/fe-3/log:/opt/apache-doris/fe/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.4
  docker-be-01:
    image: "apache/doris:1.2.2-be-x86_64"
    container_name: "doris-be-01"
    hostname: "be-01"
    restart: always
    depends_on:
      - docker-fe-01
      - docker-fe-02
      - docker-fe-03
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - BE_ADDR=172.23.80.5:9050
    ports:
      - 9041:8040
    volumes:
      - /home/doris/data/be-1/storage:/opt/apache-doris/be/storage
      - /home/doris/data/be-1/script:/docker-entrypoint-initdb.d
      - /home/doris/data/be-1/log:/opt/apache-doris/be/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.5
  docker-be-02:
    image: "apache/doris:1.2.2-be-x86_64"
    container_name: "doris-be-02"
    hostname: "be-02"
    restart: always
    depends_on:
      - docker-fe-01
      - docker-fe-02
      - docker-fe-03
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - BE_ADDR=172.23.80.6:9050
    ports:
      - 9042:8040
    volumes:
      - /home/doris/data/be-2/storage:/opt/apache-doris/be/storage
      - /home/doris/data/be-2/script:/docker-entrypoint-initdb.d
      - /home/doris/data/be-2/log:/opt/apache-doris/be/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.6
  docker-be-03:
    image: "apache/doris:1.2.2-be-x86_64"
    container_name: "doris-be-03"
    hostname: "be-03"
    restart: always
    depends_on:
      - docker-fe-01
      - docker-fe-02
      - docker-fe-03
    environment:
      - FE_SERVERS=fe1:172.23.80.2:9010,fe2:172.23.80.3:9010,fe3:172.23.80.4:9010
      - BE_ADDR=172.23.80.7:9050
    ports:
      - 9043:8040
    volumes:
      - /home/doris/data/be-3/storage:/opt/apache-doris/be/storage
      - /home/doris/data/be-3/script:/docker-entrypoint-initdb.d
      - /home/doris/data/be-3/log:/opt/apache-doris/be/log
    networks:
      doris_net:
        ipv4_address: 172.23.80.7
networks:
  doris_net:
    ipam:
      config:
        - subnet: 172.23.80.0/24

自动编排完后,按本文配置可通过mysql连接工具,如navicat直接连xxxx:35、xxxx:39、xxxx:27连接doris

默认用户名root,密码空

4 .结束&建议

注意1:测试时发现,如果想修改配置(如改端口等),要先删除映射目录再重新compose,否则会出现注册不成功等问题……

注意2:compose后如果连容器都没创建,检查下docker network是否网段被占用了

 

你可能感兴趣的:(docker,容器,composer,database)