使用Docker快速搭建Doris集群

好的,坏的,回头看都是对的,你要相信一切都是最好的安排

想深入交流doris的私聊我加微信 xiaolm1213

以DORIS-0.12.21-release为例,如果想自己编译也可以,去下载docker镜像进行编译,把编译好fe、be、fs的拷出来

获取资源

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

制作docker镜像

# 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 .

docker-compose启动

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/

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

添加节点

官方文档》写的明明白白

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值