Use Docker to quickly build a Doris cluster

Use Docker to quickly build a Doris cluster

I want to have an in-depth exchange of doris's private chat, I add WeChat

Take DORIS-0.12.21-release as an example. If you want to compile it yourself, you can download the docker image to compile and copy the compiled fe, be, and fs.

Access to resources

wget https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/DORIS-0.12.21-release.tar.gz
解压进入目录

Make a docker image

# 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

Create mirror

docker build -f DockerFile -t doris:0.12.21-release .

docker-compose start

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

Create a folder: mkdir /xxx/doris/fe/conf
Start leader: docker-compose -f docker-compose-doris-fe-leader.yml up -d
Start follower: Slightly
UI interface: http://s-hadoop- log01:8030/
Note: Start the leader first, and then start the follower at the first startup, because the follower points to the machine where the leader is located, and it will start according to the 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

Create a folder: mkdir /xxx/doris/be/conf
Start be: docker-compose -f docker-compose-doris-be.yml up -d
UI interface: http://s-hadoop-log01:8040/

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

Create a folder: mkdir /xxx/doris/fs_broker/conf
Start fs: docker-compose -f docker-compose-doris-fs-broker.yml up -d

Add node

" Official documents " written clearly and plainly

Guess you like

Origin blog.csdn.net/jklcl/article/details/112910796