Docker构建Doris 3FE 3BE

Docker构建Doris 3FE 3BE

# 构建网络
docker network create --driver doris-bridge --subnet=172.20.80.0/24 doris-network

# fe1
docker run -itd \
    --name=fe-01 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env FE_ID=1 \
    -p 8031:8030 \
    -p 9031:9030 \
    -v /data/fe-01/doris-meta:/opt/apache-doris/fe/doris-meta \
    -v /data/fe-01/conf:/opt/apache-doris/fe/conf \
    -v /data/fe-01/log:/opt/apache-doris/fe/log \
    --network=doris-network \
    --ip=172.20.80.2 \
    apache/doris:1.2.1-fe-x86_64

# fe2
docker run -itd \
    --name=fe-02 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env FE_ID=2 \
    -p 8032:8030 \
    -p 9032:9030 \
    -v /data/fe-02/doris-meta:/opt/apache-doris/fe/doris-meta \
    -v /data/fe-02/conf:/opt/apache-doris/fe/conf \
    -v /data/fe-02/log:/opt/apache-doris/fe/log \
    --network=doris-network \
    --ip=172.20.80.3 \
    apache/doris:1.2.1-fe-x86_64

# fe3
docker run -itd \
    --name=fe-03 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env FE_ID=3 \
    -p 8033:8030 \
    -p 9033:9030 \
    -v /data/fe-03/doris-meta:/opt/apache-doris/fe/doris-meta \
    -v /data/fe-03/conf:/opt/apache-doris/fe/conf \
    -v /data/fe-03/log:/opt/apache-doris/fe/log \
    --network=doris-network \
    --ip=172.20.80.4 \
    apache/doris:1.2.1-fe-x86_64


# be1
docker run -itd \
    --name=be-01 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env BE_ADDR="172.20.80.5:9050" \
    -p 8041:8040 \
    -v /data/be-01/storage:/opt/apache-doris/be/storage \
    -v /data/be-01/conf:/opt/apache-doris/be/conf \
    -v /data/be-01/log:/opt/apache-doris/be/log \
    --network=doris-network \
    --ip=172.20.80.5 \
    apache/doris:1.2.1-be-x86_64

# be2
docker run -itd \
    --name=be-02 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env BE_ADDR="172.20.80.6:9050" \
    -p 8042:8040 \
    -v /data/be-02/storage:/opt/apache-doris/be/storage \
    -v /data/be-02/conf:/opt/apache-doris/be/conf \
    -v /data/be-02/log:/opt/apache-doris/be/log \
    --network=doris-network \
    --ip=172.20.80.6 \
    apache/doris:1.2.1-be-x86_64


# be3
docker run -itd \
    --name=be-03 \
    --env FE_SERVERS="fe1:172.20.80.2:9010,fe2:172.20.80.3:9010,fe3:172.20.80.4:9010" \
    --env BE_ADDR="172.20.80.7:9050" \
    -p 8043:8040 \
    -v /data/be-03/storage:/opt/apache-doris/be/storage \
    -v /data/be-03/conf:/opt/apache-doris/be/conf \
    -v /data/be-03/log:/opt/apache-doris/be/log \
    --network=doris-network \
    --ip=172.20.80.7 \
    apache/doris:1.2.1-be-x86_64

查看容器
docker ps

[root@zxx ~]# docker ps
CONTAINER ID   IMAGE                          COMMAND                 CREATED        STATUS         PORTS                                            NAMES
b3970e9a6034   apache/doris:1.2.1-be-x86_64   "bash entry_point.sh"   9 hours ago    Up 2 seconds   0.0.0.0:8043->8040/tcp                           be-03
99254f1b3226   apache/doris:1.2.1-be-x86_64   "bash entry_point.sh"   9 hours ago    Up 2 seconds   0.0.0.0:8042->8040/tcp                           be-02
4eb0d7e42c92   apache/doris:1.2.1-be-x86_64   "bash entry_point.sh"   21 hours ago   Up 3 seconds   0.0.0.0:8041->8040/tcp                           be-01
4053de5aee81   apache/doris:1.2.1-fe-x86_64   "bash init_fe.sh"       21 hours ago   Up 3 seconds   0.0.0.0:8033->8030/tcp, 0.0.0.0:9033->9030/tcp   fe-03
0dbdcd22c944   apache/doris:1.2.1-fe-x86_64   "bash init_fe.sh"       21 hours ago   Up 4 seconds   0.0.0.0:8032->8030/tcp, 0.0.0.0:9032->9030/tcp   fe-02
3bd104d2ff2a   apache/doris:1.2.1-fe-x86_64   "bash init_fe.sh"       21 hours ago   Up 4 seconds   0.0.0.0:8031->8030/tcp, 0.0.0.0:9031->9030/tcp   fe-01

浏览器访问FE:
http://zyl:8031

http://zyl:8032

http://zyl:8033

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