docker-compose.yaml脚本如下:
version: "3"
services:
fe:
image: selectdb/doris.fe-ubuntu:2.1.7
hostname: fe
environment:
- TZ=Asia/Shanghai
- FE_SERVERS=fe1:172.16.152.49:9010
- FE_ID=1
- RUN_TYPE="RECOVERY"
ports:
- 8030:8030
- 9030:9030
- 9010:9010
- 9020:9020
volumes:
- /opt/bigdata/dor-data/fe/doris-meta/:/opt/apache-doris/fe/doris-meta/
- /opt/bigdata/dor-data/fe/log/:/opt/apache-doris/fe/log/
- /opt/bigdata/dor-data/fe/conf/:/opt/apache-doris/fe/conf/
network_mode: host
be:
image: selectdb/doris.be-ubuntu:2.1.7
hostname: be
environment:
- TZ=Asia/Shanghai
- FE_SERVERS=fe1:172.16.152.49:9010
- BE_ADDR=172.16.152.49:9050
ports:
- 8040:8040
- 9050:9050
volumes:
- /opt/bigdata/dor-data/be/storage/:/opt/apache-doris/be/storage/
- /opt/bigdata/dor-data/be/log/:/opt/apache-doris/be/log/
- /opt/bigdata/dor-data/be/conf/:/opt/apache-doris/be/conf/
depends_on:
- fe
network_mode: host
执行后FE状态如图:

容器中BE下log下没有日志,使用docker logs -f be日志如图:

[root@node49 bigdata]# docker-compose up -d
[+] Running 2/2
⠿ Container bigdata-fe-1 Started 0.2s
⠿ Container bigdata-be-1 Started 0.3s
[root@node49 bigdata]# docker logs -f bigdata-be-1
2024-11-22T16:49:28+08:00 [Warn] [Entrypoint]: FE_SERVERS fe1:172.16.152.49:9010
2024-11-22T16:49:28+08:00 [Warn] [Entrypoint]: BE_ADDR 172.16.152.49:9050
2024-11-22T16:49:28+08:00 [Note] [Entrypoint]: MASTER_FE_IP 172.16.152.49
2024-11-22T16:49:28+08:00 [Note] [Entrypoint]: CURRENT_BE_IP 172.16.152.49
2024-11-22T16:49:28+08:00 [Note] [Entrypoint]: CURRENT_BE_PORT 9050
2024-11-22T16:49:28+08:00 [Note] [Entrypoint]: PRIORITY_NETWORKS 172.16.152.0/24
2024-11-22T16:49:28+08:00 [Note] [Entrypoint]: MASTER FE is not started. retry.
fe_e8737490_76e8_4065_a370_13d9a44829cf 172.16.152.49 9010 8030 9030 9020 -1 FOLLOWER true 1601775696 true true 8 2024-11-22 16:49:32 2024-11-22 16:49:32 true doris-2.1.7-rc03-443e87e203 Yes
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: MASTER FE is started!
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: add priority_networks 172.16.152.0/24 to /opt/apache-doris/be/conf/be.conf
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: this node role is mix
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: ============= init args ================
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: MASTER_FE_IP 172.16.152.49
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: CURRENT_BE_IP 172.16.152.49
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: CURRENT_BE_PORT 9050
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: RUN_TYPE ELECTION
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: Executing SQL: alter system add backend '172.16.152.49:9050';
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: BE is not register. retry.
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: BE successfully registered to FE!
10002 172.16.152.49 9050 -1 -1 -1 -1 NULL NULL false false 0 0.000 0.000 1.000 B 0.000 0.00 % 0.00 % 0.000 {"location" : "default"{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} 0
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: Verify that BE is registered to FE successfully
2024-11-22T16:49:38+08:00 [Note] [Entrypoint]: Ready to start BE!
10002 172.16.152.49 9050 -1 -1 -1 -1 NULL NULL false false 0 0.000 0.000 1.000 B 0.000 0.00 % 0.00 % 0.000 {"location" : "default"{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} 0
2024-11-22T16:49:39+08:00 [Note] [Entrypoint]: EntryPoint Check - Verify that BE is registered to FE successfully
[root@node49 bigdata]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4714ffa4b590 selectdb/doris.fe-ubuntu:2.1.7 "bash init_fe.sh" 31 seconds ago Up 30 seconds bigdata-fe-1
[root@node49 bigdata]#