Doris集群部署

集群资源

服务器 IP 角色 磁盘 CPU 内存
doris01 192.168.1.11 FE /dev/vda1 99G 32c 128G
doris02 192.168.1.12 BE、Broker /dev/{sdb…sdp} 32c 128G
doris03 192.168.1.13 BE、Broker /dev/{sdb…sdp} 32c 128G
doris04 192.168.1.14 BE、Broker /dev/{sdb…sdp} 32c 128G
doris05 192.168.1.15 BE、Broker /dev/{sdb…sdp} 32c 128G

Doris用户密码: root / Passord123@doris
Doris-BE 数据目录: /data{…q}/disk{1…16}/doris
Doris-FE安装目录: /opt/doris/
Doris-BE安装目录: /opt/doris/
Broker安装目录: /opt/apache_hdfs_broker/
Doris-FE监听端口:8010,8030,9020,9030
Doris-BE监听端口:8030,8060,9050,9060

Doris部署

编译

(使用DataEase服务器进行编译,编译后拷贝到Doris服务器中)
启动编译环境

docker run -it -d \
-v /opt/.m2:/root/.m2 \
-v /opt/doris-0.15.0/:/root/doris-0.15.0/ \
apache/incubator-doris:build-env-ldb-toolchain-latest

编辑编译容器环境

cd /root/doris-0.15.0
git clone https://github.com/apache/incubator-doris.git
#使用tzselect选择时区,然后执行以下命令使其生效
echo "TZ='Asia/Shanghai'
export TZ" >> /etc/profile
source /etc/profile
alternatives --set java java-1.8.0-openjdk.x86_64
alternatives --set javac java-1.8.0-openjdk.x86_64
export JAVA_HOME=/usr/lib/jvm/java-1.8.0
#开始编译be/fe
nohup sh build.sh --clean --be --fe 2>&1 &
#编译broker
cd fs_brokers/apache_hdfs_broker/
./build.sh
cd output/apache_hdfs_broker/
cp -r apache_hdfs_broker /root/doris-0.15.0/incubator-doris-master/output/
#打包
cd /root/doris-0.15.0/incubator-doris-master/
tar -zcvf doris-0.15.0-bin.tar.gz output/

部署FE

只部署在doris01/192.168.1.11 一台服务器

服务器已配置jdk1.8.0_51,不再另行安装。
解压DorisFE 并配置启动

#新建Doris安装目录
mkdir /opt/doris
tar -zxvf doris-0.15.0-bin.tar.gz
#拷贝解压包中的be目录
cp -r output/fe/* /opt/doris/
echo "DORIS_HOME=/opt/doris" >> ~/.bash_profile
source ~/.bash_profile
#创建元数据存放位置
mkdir $DORIS_HOME/doris-meta
#调整JDK内存参数
sed -i 's/-Xmx4096m/-Xmx16384m/g' /opt/doris/conf/fe.conf
#避免9010与其他服务端口冲突
sed -i 's/9010/8010/g' /opt/doris/conf/fe.conf
echo "meta_dir = \${DORIS_HOME}/doris-meta" >> /opt/doris/conf/fe.conf
#运行Doris-FE
/opt/doris/bin/start_fe.sh --daemon

部署BE

部署在doris0205/192.168.1.1235 四台服务器

服务器已配置jdk1.8.0_51,不再另行安装。
解压DorisBE并配置启动


mkdir /opt/doris
tar -zxvf doris-0.15.0-bin.tar.gz
cp -r output/be/* /opt/doris/

echo "DORIS_HOME=/opt/doris" >> ~/.bash_profile
source ~/.bash_profile
#服务器有16块HDD磁盘分别挂载到 /data ~/dataq ,再各目录创建Doris数据目录
n=1;for i in `ls / |grep ^data`; do mkdir -p /$i/disk$n/doris;n=$(($n+1)); done
#避免8040端口冲突
sed -i 's/8040/8030/g' /opt/doris/conf/be.conf
#配置数据目录
echo "storage_root_path = /data/disk1/doris;/datac/disk2/doris;/datad/disk3/doris;/datae/disk4/doris;/dataf/disk5/doris;/datag/disk6/doris;/datah/disk7/doris;/datai/disk8/doris;/dataj/disk9/doris;/datak/disk10/doris;/datal/disk11/doris;/datam/disk12/doris;/datan/disk13/doris;/datao/disk14/doris;/datap/disk15/doris;/dataq/disk16/doris
#单条查询最多使用的be内存,服务器的80%
exec_mem_limit = 64G
#最大可导入的数据文件
streaming_load_max_mb=1024000" >> /opt/doris/conf/be.conf

将Doris-BE添加到FE

#使用mysql客户端登录Doris-FE
mysql -h192.168.1.11 -P9030  -uroot
#192.168.1.11 为fe节点IP
#-P9030 为fe.conf 中的 query_port
#默认使用 root 账户,无密码登录
ALTER SYSTEM ADD BACKEND "72.22.0.32:9050";
ALTER SYSTEM ADD BACKEND "72.22.0.33:9050";
ALTER SYSTEM ADD BACKEND "72.22.0.34:9050";
ALTER SYSTEM ADD BACKEND "72.22.0.35:9050";
#192.168.1.12-35 为be节点
#9050 为 be.conf 中的 heartbeat_service_port 

启动Doris-BE


/opt/doris/bin/start_be.sh --daemon
#查看启动日志
tail -100f /opt/doris/log/be.INFO
I0426 14:58:04.201578 12757 task_worker_pool.cpp:1576] finish report TASK. master host: 192.168.1.11, port: 9020
I0426 14:58:15.202304 12757 task_worker_pool.cpp:1576] finish report TASK. master host: 192.168.1.11, port: 9020
I0426 14:58:28.202965 12757 task_worker_pool.cpp:1576] finish report TASK. master host: 192.168.1.11, port: 9020
#查看BE状态,Alive为true.
mysql -P9030 -h192.168.1.11 -uroot
SHOW PROC '/backends';
+-----------+-----------------+-------------+---------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------------+--------+---------------+-------------------------------------------------------------------------------------------------------------------------------+
| BackendId | Cluster         | IP          | HostName      | HeartbeatPort | BePort | HttpPort | BrpcPort | LastStartTime       | LastHeartbeat       | Alive | SystemDecommissioned | ClusterDecommissioned | TabletNum | DataUsedCapacity | AvailCapacity | TotalCapacity | UsedPct | MaxDiskUsedPct | Tag                      | ErrMsg | Version       | Status                                                        |
+-----------+-----------------+-------------+---------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------------+--------+---------------+-------------------------------------------------------------------------------------------------------------------------------+
| 10002     | default_cluster | 192.168.1.12 | doris02 | 9050          | 9060   | 8030     | 8060     | 2022-04-26 14:51:14 | 2022-04-26 15:09:24 | true  | false                | false                 | 0         | 0.000            | 20.702 TB     | 85.258 TB     | 75.72 % | 76.26 %        | {"location" : "default"} |        | trunk-Unknown | {"lastSuccessReportTabletsTime":"2022-04-26 15:09:11","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} |
| 10003     | default_cluster | 192.168.1.13 | doris03 | 9050          | 9060   | 8030     | 8060     | 2022-04-26 14:56:41 | 2022-04-26 15:09:24 | true  | false                | false                 | 0         | 0.000            | 21.255 TB     | 85.258 TB     | 75.07 % | 75.48 %        | {"location" : "default"} |        | trunk-Unknown | {"lastSuccessReportTabletsTime":"2022-04-26 15:09:28","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} |
| 10004     | default_cluster | 192.168.1.14 | doris04 | 9050          | 9060   | 8030     | 8060     | 2022-04-26 14:56:44 | 2022-04-26 15:09:24 | true  | false                | false                 | 0         | 0.000            | 21.444 TB     | 85.258 TB     | 74.85 % | 75.90 %        | {"location" : "default"} |        | trunk-Unknown | {"lastSuccessReportTabletsTime":"2022-04-26 15:08:33","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} |
| 10005     | default_cluster | 192.168.1.15 | doris05 | 9050          | 9060   | 8030     | 8060     | 2022-04-26 14:56:47 | 2022-04-26 15:09:24 | true  | false                | false                 | 0         | 0.000            | 21.126 TB     | 85.258 TB     | 75.22 % | 76.30 %        | {"location" : "default"} |        | trunk-Unknown | {"lastSuccessReportTabletsTime":"2022-04-26 15:08:31","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} |
+-----------+-----------------+-------------+---------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------------+--------+---------------+-------------------------------------------------------------------------------------------------------------------------------+

部署Broker

拷贝broker并启动

#拷贝到doris同级目录
cp -r output/apache_hdfs_broker/ /opt/
#启动broker
/opt/apache_hdfs_broker/bin/start_broker.sh --daemon
#查看启动日志
tail -100f /opt/apache_hdfs_broker/log/apache_hdfs_broker.out
starting apache hdfs broker....succeed

添加broker到FE并查看状态

#登录FE
mysql -P9030 -h192.168.1.11 -uroot
#添加broker
ALTER SYSTEM ADD BROKER broker_data02 "192.168.1.12:8000";
ALTER SYSTEM ADD BROKER broker_data03 "192.168.1.13:8000";
ALTER SYSTEM ADD BROKER broker_data04 "192.168.1.14:8000";
ALTER SYSTEM ADD BROKER broker_data05 "192.168.1.15:8000";

#查看broker,Alive为true.
mysql> SHOW PROC "/brokers";
+---------------+-------------+---------------+------+-------+---------------------+---------------------+--------+
| Name          | IP          | HostName      | Port | Alive | LastStartTime       | LastUpdateTime      | ErrMsg |
+---------------+-------------+---------------+------+-------+---------------------+---------------------+--------+
| broker_data05 | 192.168.1.15 | doris05 | 8000 | true  | 2022-04-26 15:10:45 | 2022-04-26 15:11:50 |        |
| broker_data04 | 192.168.1.14 | doris04 | 8000 | true  | 2022-04-26 15:10:45 | 2022-04-26 15:11:50 |        |
| broker_data03 | 192.168.1.13 | doris03 | 8000 | true  | 2022-04-26 15:10:45 | 2022-04-26 15:11:50 |        |
| broker_data02 | 192.168.1.12 | doris02 | 8000 | true  | 2022-04-26 15:10:45 | 2022-04-26 15:11:50 |        |
+---------------+-------------+---------------+------+-------+---------------------+---------------------+--------+
4 rows in set (0.00 sec)
#最后配置Doris-FE的登录密码
SET PASSWORD FOR 'root' = PASSWORD('Password123@doris');

你可能感兴趣的:(doris,doris集群,doris编译)