此处不再重复造轮子
详见:
》
# centos7:jdk8是我们自己做的基础镜像 FROM centos7:jdk8 RUN mkdir -p /home/doris ENV JAVA_HOME /usr/lib/jvm/java COPY ./fe/ /home/doris/fe COPY ./be/ /home/doris/be COPY ./apache_hdfs_broker/ /home/doris/fs_broker EXPOSE 8030 9020 9030 9010 9070 9060 8060 8040 9050 8000 VOLUME ["/home/doris/fe/conf", "/home/doris/fe/log", "/home/doris/fe/doris-meta", "/home/doris/be/conf", "/home/doris/be/log", "/home/doris/be/storage", "/home/doris/fs_brokers/conf"] COPY entrypoint.sh / RUN chmod +x entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
entrypoint.sh
#!/bin/sh echo "fe_role:"$FE_ROLE echo "leader:"$FE_LEADER if [[ $FE_ROLE = 'fe-leader' ]]; then /home/doris/fe/bin/start_fe.sh elif [[ $FE_ROLE = 'be' ]]; then /home/doris/be/bin/start_be.sh elif [[ $FE_ROLE = 'fe-follower' ]]; then /home/doris/fe/bin/start_fe.sh --helper $FE_LEADER else /home/doris/fs_broker/bin/start_broker.sh fi
创建镜像
docker build -f DockerFile -t doris:0.12.21-release .
FE
version: '3.7' services: doris-fe: image: doris:0.12.21-release restart: always network_mode: "host" container_name: "doris-fe" ports: - "8030:8030" - "9010:9010" - "9020:9020" - "9030:9030" volumes: - "/xxx/doris/fe/log:/home/doris/fe/log" - "/xxx/doris/fe/doris-meta:/home/doris/fe/doris-meta" - "/xxx/doris/fe/conf:/home/doris/fe/conf" - "/etc/localtime:/etc/localtime:ro" environment: - FE_ROLE=fe-follower - FE_LEADER=xxxx:9010 security_opt: - seccomp:unconfined
创建文件夹: mkdir /xxx/doris/fe/conf
启动leader: docker-compose -f docker-compose-doris-fe-leader.yml up -d
启动follower: 略
UI界面: http://s-hadoop-log01:8030/
注:第一次启动时先启动leader,再启动follower,因为follower指向leader所在机器之后的启动,都按照leader起就可以了
BE
version: '3.7' services: doris-be: image: doris:0.12.21-release restart: always network_mode: "host" container_name: "doris-be" ports: - "8040:8040" - "8060:8060" - "9050:9050" - "9060:9060" - "9070:9070" volumes: - "/xxx/doris/be/log:/home/doris/be/log" - "/xxx/doris/be/storage:/home/doris/be/storage" - "/xxx/doris/be/conf:/home/doris/be/conf/" - "/etc/localtime:/etc/localtime:ro" environment: - FE_ROLE=be
创建文件夹: mkdir /xxx/doris/be/conf
启动be: docker-compose -f docker-compose-doris-be.yml up -d
UI界面: http://s-hadoop-log01:8040/
doris-fs-broker:
version: '3.7' services: doris-fs-broker: image: doris:0.12.21-release restart: always network_mode: "host" container_name: "doris-fs-broker" ports: - "8000:8000" volumes: - "/xxx/doris/fs_broker/conf:/home/doris/fs_broker/conf" - "/xxx/doris/fs_broker/log:/home/doris/fs_broker/log" - "/etc/localtime:/etc/localtime:ro" environment: - FE_ROLE=fs
创建文件夹: mkdir /xxx/doris/fs_broker/conf
启动fs: docker-compose -f docker-compose-doris-fs-broker.yml up -d