此文阅读需要有Linux和服务器硬件基础!某些内容写的不是特别细,如果常见的linux基础命令tar、uzip、mv、mkdir、系统包的安装等等,以文字带过了,这样可以减少文章篇幅。
官方的安装部署方式一定要好好看一下,最好是尝试着做一下,再看本教程最好!https://doris.apache.org/zh-CN/installing/install-deploy.html
一.部署方式选择
Doris安装部署分为两种方式:
- 下载Apache Doris源码进行编译
- 下载百度Palo预编译版本,不需要编译源码,直接安装就行
这里我们采用的是第2种,主要是安装省时、门槛低,更多palo和doris的区别可以看下方的注意
内容。当然还是建议采用官方源码进行编译,可以选择较新的分支进行编译,以体验最新功能。
百度Palo预编译版本下载地址
注意:
- 百度开源版本非 Apache Release 版本,但包含全部 Apache Doris 的功能,并与 Apache 版本兼容。
- Apache 官方 Release 版本请前往 Apache Doris 官方网站 下载。
- 百度Palo的更新频次比Apache Doris更高和功能项要更多一些。
- Apache Doris本身就是Palo开源的,所以用百度的Palo本身也不存在什么问题,他俩是一个东西。
二.部署前准备工作
1. 服务器硬件准备
建议调研环境、测试环境可以用低配或者虚拟机。生产环境建议物理机,3台FE+7台BE组成。具体服务器配置相关问题,可以留言交流,或者浏览 Apache Doris安装与部署 章节
推荐环境如下:
![](https://img.haomeiwen.com/i13039903/fb39f66c000b30bb.png)
FE建议3台组成HA,后续如果发现BE计算能力不足,扩展BE即可。不需要在折腾FE了。
2.系统软件准备
所有服务器都需要做。【必须】的内容一定要做,【按需】的 内容可以不用做:
(1)【必须】 Linux CentOS 7.9 安装所有最新补丁,在安装操作系统的时候,推荐选择ext4文件系统。
(2)【必须】 时钟同步:https://www.cnblogs.com/jhxxb/p/11526098.html
(3)【必须】关闭交换分区(swap):https://www.cnblogs.com/whm-blog/p/10920881.html
(4)【必须】把limits调到最大:https://www.jianshu.com/p/816911a8f90e
(5)【必须】 安装gcc 10.2.0:https://www.cnblogs.com/sakela/p/14652712.html
(6)【必须】安装JDK1.8:https://blog.csdn.net/weixin_36365168/article/details/114194870
(7)【必须】 在所有BE节点上安装ODBC:https://www.jianshu.com/p/093f89723c8c
(8)【按需】如果有新建root账号的需求,可以参照:https://www.jianshu.com/p/b9537e714399
(9)【按需】关于broker,因我们并没有用到涉及需使用broker接入内容,所以文章中并没有写broker的接入过程,可参照:https://doris.apache.org/zh-CN/installing/install-deploy.html#%E8%BD%AF%E7%A1%AC%E4%BB%B6%E9%9C%80%E6%B1%82,https://doris.apache.org/zh-CN/administrator-guide/broker.html
三.部署Doris
部署Doris时,用的都是root用户!
1.安装FE(集群)
(1)先确认待安装的服务器的CPU是否支持avx2指令,这个过程所有服务器都需要确定。
0.14.13.1 及之后的版本需要运行环境的 CPU 支持 avx2 指令,你可以通过 cat /proc/cpuinfo 查看是否支持。如果不支持,请使用带 no-avx2 后缀的版本。avx2 指令会显著提升 bloomfilter 等数据结构的计算效率,从而影响索引过滤、runtime filter 等功能的效率。
使用以下命令查看:
[root@DORIS-FE-PRD01 ~]# cat /proc/cpuinfo
![](https://img.haomeiwen.com/i13039903/d0ffe80ef12ccd0a.png)
可以看到cpu是支持avx2指令的,那就可以下载支持avx2指令的palo已编译版本。如果cpu不支持avx2指令,需要下载不支持avx2指令的palo已编译版本。
先去百度PALO官方网站下载已编译好的版本,以下是下载地址,点击图片中的Link
下载适合的版本。0.15.1-rc09
是支持avx2指令,0.15.1-rc09-no-avx2
是不支持avx2指令:
百度Palo预编译版本下载地址
![](https://img.haomeiwen.com/i13039903/3e7c09c057d54a6b.png)
(2)下载完后得到
PALO-0.15.1-rc09-binary.tar.gz
,上传至服务器/opt/software
目录,每台服务器都需要上传。本教程是10台服务器,所以10台服务器都上传。(3)上传完成后解压得到
PALO-0.15.1-rc09-binary
目录,目录结构如下,主要关注be
和fe
目录,其他几个文件夹先忽略:![](https://img.haomeiwen.com/i13039903/19130e2f58ae7522.png)
(4)把
fe
挪到/home/doris/
目录下去,前提需要创建该目录。(5)进入
/home/doris/fe/conf
, vim be.conf
,有以下几项需要增加或修改:
以下配置中不会详述每个配置的含义,可以访问Doris文档查看具体释义和更多配置:
https://doris.apache.org/zh-CN/administrator-guide/config/fe_config.html
- ①
JAVA_OPTS
中-Xmx
调到32768m
,即32GB
JAVA_OPTS="-Xmx32768m -XX:+UseMembar -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC
-XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xlogg
c:$DORIS_HOME/log/fe.gc.log.$DATE"
- ②
meta_dir
中配置fe元数据的存放路径需要修改为/doris-meta
。
meta_dir = /doris-meta
这里需要注意,fe的源程序包是放在
/home/doris/
下,是系统盘位置为480G RAID
所在盘符目录。fe元数据的存放硬盘为/doris-meta
,fe节点的3块960G
的硬盘做了RAID5
阵列,整体大小由960G*3
的数量大小,变为960G*2
即1.8TB
左右的大小,并挂载到/doris-meta
目录下。
- ③ 增加
enable_http_server_v2 = true
配置,支持https,这样可以打开新的前端UI界面。
http_port = 8030
rpc_port = 9020
query_port = 9030
edit_log_port = 9010
mysql_service_nio_enabled = true
enable_http_server_v2 = true # 在这里加该配置就行
这里稍微扩展一下,与本配置无太大关系:
我们在实际使用Flink Doris Connector.jar用http的方式进行sink时,一开始可以sink,但是用了一段时间,发现sink不了了。我们并未解决该问题,这个需要大家留意。所以最终还是采用了jdbc的方式进行sink,暂时放弃了http sink。
- ④
priority_networks
需要设置fe所在的服务器IP,这里我的服务器只用了单网口只有一个IP。
priority_networks = 192.168.16.44/24
- ⑤
dynamic_partition_enable = true
增加动态分区配置,后续使用中动态分区用的比较多,先把它配置上。在文件末尾加上就行。
dynamic_partition_enable = true
这里贴上我的fe.conf完整的文件内容,可以做个参照:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#####################################################################
## The uppercase properties are read and exported by bin/start_fe.sh.
## To see all Frontend configurations,
## see fe/src/org/apache/doris/common/Config.java
#####################################################################
# the output dir of stderr and stdout
LOG_DIR = ${DORIS_HOME}/log
DATE = `date +%Y%m%d-%H%M%S`
JAVA_OPTS="-Xmx32768m -XX:+UseMembar -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xloggc:$DORIS_HOME/log/fe.gc.log.$DATE"
# For jdk 9+, this JAVA_OPTS will be used as default JVM options
JAVA_OPTS_FOR_JDK_9="-Xmx32768m -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=7 -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$DATE:time"
##
## the lowercase properties are read by main program.
##
# INFO, WARN, ERROR, FATAL
sys_log_level = INFO
# store metadata, must be created before start FE.
# Default value is ${DORIS_HOME}/doris-meta
# meta_dir = ${DORIS_HOME}/doris-meta
meta_dir = /doris-meta
http_port = 8030
rpc_port = 9020
query_port = 9030
edit_log_port = 9010
mysql_service_nio_enabled = true
enable_http_server_v2 = true
# Choose one if there are more than one ip except loopback address.
# Note that there should at most one ip match this list.
# If no ip match this rule, will choose one randomly.
# use CIDR format, e.g. 10.10.10.0/24
# Default value is empty.
# priority_networks = 10.10.10.0/24;192.168.0.0/16
priority_networks = 192.168.16.44/24
# Advanced configurations
# log_roll_size_mb = 1024
# sys_log_dir = ${DORIS_HOME}/log
# sys_log_roll_num = 10
# sys_log_verbose_modules = org.apache.doris
# audit_log_dir = ${DORIS_HOME}/log
# audit_log_modules = slow_query, query
# audit_log_roll_num = 10
# meta_delay_toleration_second = 10
# qe_max_connection = 1024
# max_conn_per_user = 100
# qe_query_timeout_second = 300
# qe_slow_log_ms = 5000
dynamic_partition_enable = true
(6)启动fe。启动和关闭fe的命令是sh start_fe.sh --daemon
、sh stop_fe.sh --daemon
[root@DORIS-FE-PRD01 bin]# cd /home/doris/fe/bin
[root@DORIS-FE-PRD01 bin]# sh start_fe.sh --daemon
注意:
Doris启动过程中如果发生问题,可以进入/home/doris/fe/log
目录下查看日志,找到异常寻求解决方案
(7)下面需要通过mysql客户端连接fe节点
- ① 下载
mysql-5.7.36
,上传至/opt/software/
,并解压,解压后不用安装,只用它来连接doris。
mysql-5.7.36官方下载链接 - ② 使用以下命令连接doris,能进入到doris表示连接成功,说明fe启动正常
[root@DORIS-FE-PRD01 bin]# cd /opt/software/mysql-5.7.36-linux-glibc2.12-x86_64/bin
[root@DORIS-FE-PRD01 bin]# ./mysql -h 192.168.16.44 -P 9030 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5781
Server version: 5.1.0 Doris version 0.15.1-rc09-Unknown
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
(8)剩下两台fe节点需要做一下第(1)至第(5)个步骤,但是在 首次启动 其余两个fe节点时,需要注意用以下命令执行,后续启动采用第(6)中的命令执行即可:
第二个节点:
[root@DORIS-FE-PRD02 bin]# cd /home/doris/fe/bin
[root@DORIS-FE-PRD02 bin]# ./start_fe.sh --helper 192.168.16.44:9010 --daemon
第三个节点:
[root@DORIS-FE-PRD03 bin]# cd /home/doris/fe/bin
[root@DORIS-FE-PRD03 bin]# ./start_fe.sh --helper 192.168.16.44:9010 --daemon
192.168.16.44
为第一个启动的fe
节点,该节点为master
节点。剩下两台为follower
节点,3台fe
节点组成读写HA。
(9)在192.168.16.44 master fe
节点服务器上,用mysql连接master fe,并用sql添加其余两台follower节点:
[root@DORIS-FE-PRD01 conf]# cd /opt/software/mysql-5.7.36-linux-glibc2.12-x86_64/bin
[root@DORIS-FE-PRD01 bin]# ./mysql -h 192.168.16.44 -P 9030 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5782
Server version: 5.1.0 Doris version 0.15.1-rc09-Unknown
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER SYSTEM ADD FOLLOWER "192.168.16.64:9010";
mysql> ALTER SYSTEM ADD FOLLOWER "192.168.16.53:9010";
添加完后,通过show proc '/frontends';
查看fe节点的状态,主要关注Role
角色、IsMaster
是否主节点、alive
节点存活状态 三列是否正常。
mysql> show proc '/frontends';
+----------------------------------+---------------+-----------------------------+-------------+----------+-----------+---------+----------+----------+------------+------+-------+-------------------+---------------------+----------+--------+---------------------+------------------+
| Name | IP | HostName | EditLogPort | HttpPort | QueryPort | RpcPort | Role | IsMaster | ClusterId | Join | Alive | ReplayedJournalId | LastHeartbeat | IsHelper | ErrMsg | Version | CurrentConnected |
+----------------------------------+---------------+-----------------------------+-------------+----------+-----------+---------+----------+----------+------------+------+-------+-------------------+---------------------+----------+--------+---------------------+------------------+
| 192.168.16.53_9010_1645235873427 | 192.168.16.53 | doris-fe-prd03.aimatech.com | 9010 | 8030 | 9030 | 9020 | FOLLOWER | false | 1773624491 | true | true | 53557 | 2022-02-21 10:41:28 | true | | 0.15.1-rc09-Unknown | No |
| 192.168.16.64_9010_1645235868726 | 192.168.16.64 | doris-fe-prd02.aimatech.com | 9010 | 8030 | 9030 | 9020 | FOLLOWER | false | 1773624491 | true | true | 53557 | 2022-02-21 10:41:28 | true | | 0.15.1-rc09-Unknown | No |
| 192.168.16.44_9010_1645235407812 | 192.168.16.44 | doris-fe-prd01.aimatech.com | 9010 | 8030 | 9030 | 9020 | FOLLOWER | true | 1773624491 | true | true | 53558 | 2022-02-21 10:41:28 | true | | 0.15.1-rc09-Unknown | Yes |
+----------------------------------+---------------+-----------------------------+-------------+----------+-----------+---------+----------+----------+------------+------+-------+-------------------+---------------------+----------+--------+---------------------+------------------+
3 rows in set (0.04 sec)
(10)到此为止,如果一切顺利,fe集群就搭建完了。
2.安装BE(集群)
(1)首先在be节点服务器上,按照fe中的第(1)至(3)步骤完成相应内容。
(2)把be
目录挪到/home/doris/
下,需要创建该目录。
(3)进入/home/doris/be/conf
目录下,修改配置:
以下配置中不会详述每个配置的含义,可以访问Doris文档查看具体释义和更多配置:
https://doris.apache.org/zh-CN/administrator-guide/config/be_config.html
- ① 修改
priority_networks
priority_networks = 192.168.16.65/24
- ② 修改数据存放目录
storage_root_path
:
storage_root_path = /doris-data1,medium:hdd,capacity:890;/doris-data2,medium:ssd,capacity:890;/doris-data3,medium:ssd,capacity:890
说明:
1.be
节点与fe
节点服务器配置是一样的,但是be
节点的960G*3
的SSD硬盘,没有做磁盘阵列,当做3块磁盘去用,分别挂载到/doris-data1 /doris-data2 /doris-data3
目录下。
2.配置中第一个磁盘目录/doris-data1,medium:hdd,capacity:890
medium指定的是hdd。这里需要注意,虽然说3块硬盘都是SSD,但是如果在配置时把medium都配置ssd,会发现在建表的时候会报错。所以这里把第一个改成了hdd,剩下两个还是ssd。报错日志没记录,各位一是便知。至于doris后面会不会修复这个问题,还不得知。
- ③ 增加如下配置,这几项配置是我们在使用过程中自己添加的,可能也不一定适合各位,各位可以按需添加。
max_tablet_version_num = 5000
max_compaction_threads = 16
compaction_task_num_per_disk = 8
cumulative_size_based_promotion_size_mbytes = 2048
row_step_for_compaction_merge_log = 1
total_permits_for_compaction_score = 50000
以下是我的be.conf
全部配置内容,供参照:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
PPROF_TMPDIR="$DORIS_HOME/log/"
# INFO, WARNING, ERROR, FATAL
sys_log_level = INFO
# ports for admin, web, heartbeat service
be_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
priority_networks = 192.168.16.66/24
storage_root_path = /doris-data1.hdd,890;/doris-data2.ssd,890;/doris-data3.ssd,890
max_tablet_version_num = 5000
max_compaction_threads = 16
compaction_task_num_per_disk = 8
cumulative_size_based_promotion_size_mbytes = 2048
row_step_for_compaction_merge_log = 1
total_permits_for_compaction_score = 50000
# Choose one if there are more than one ip except loopback address.
# Note that there should at most one ip match this list.
# If no ip match this rule, will choose one randomly.
# use CIDR format, e.g. 10.10.10.0/24
# Default value is empty.
# priority_networks = 10.10.10.0/24;192.168.0.0/16
# data root path, separate by ';'
# you can specify the storage medium of each root path, HDD or SSD
# you can add capacity limit at the end of each root path, seperate by ','
# eg:
# storage_root_path = /home/disk1/doris.HDD,50;/home/disk2/doris.SSD,1;/home/disk2/doris
# /home/disk1/doris.HDD, capacity limit is 50GB, HDD;
# /home/disk2/doris.SSD, capacity limit is 1GB, SSD;
# /home/disk2/doris, capacity limit is disk capacity, HDD(default)
#
# you also can specify the properties by setting '<property>:<value>', seperate by ','
# property 'medium' has a higher priority than the extension of path
#
# Default value is ${DORIS_HOME}/storage, you should create it by hand.
# storage_root_path = ${DORIS_HOME}/storage
# Advanced configurations
# sys_log_dir = ${DORIS_HOME}/log
# sys_log_roll_mode = SIZE-MB-1024
# sys_log_roll_num = 10
# sys_log_verbose_modules = *
# log_buffer_level = -1
# palo_cgroups
- ④ 还剩6台
be
节点,都按照以上内容进行配置,后者把be
放到/home/doris/
下后,同步一下be.conf
改一下ip
地址就行。 - ⑤ 启动所有
be
节点
[root@DORIS-BE-PRD01 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD01 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD02 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD02 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD03 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD03 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD04 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD04 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD05 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD05 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD06 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD06 bin]# sh start_be.sh --daemon
[root@DORIS-BE-PRD07 conf]# cd /home/doris/be/bin
[root@DORIS-BE-PRD07 bin]# sh start_be.sh --daemon
- ⑥ 进入
fe master
节点,用mysql连接进入sql命令行模式,挨个添加be节点
[root@DORIS-FE-PRD01 bin]# cd /opt/software/mysql-5.7.36-linux-glibc2.12-x86_64/bin
[root@DORIS-FE-PRD01 bin]# ./mysql -h 192.168.16.44 -P 9030 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5783
Server version: 5.1.0 Doris version 0.15.1-rc09-Unknown
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.66:9050";
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.59:9050";
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.60:9050";
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.51:9050";
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.65:9050";
mysql> ALTER SYSTEM ADD BACKEND "192.168.16.63:9050";
添加完后,通过show proc '/backends';
查看be
节点的状态,主要关注alive
节点存活状态 是否正常。
mysql> 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 |
+-----------+-----------------+---------------+-----------------------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------------+--------+---------------------+--------------------------------------------------------------------------------+
| 10009 | default_cluster | 192.168.16.66 | doris-be-prd01.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 68 | 2.802 GB | 2.615 TB | 2.619 TB | 0.14 % | 0.42 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:46","lastStreamLoadTime":-1} |
| 10010 | default_cluster | 192.168.16.59 | doris-be-prd02.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 59 | 2.471 GB | 2.614 TB | 2.619 TB | 0.18 % | 0.54 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:41","lastStreamLoadTime":-1} |
| 10011 | default_cluster | 192.168.16.60 | doris-be-prd03.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 54 | 2.243 GB | 2.613 TB | 2.619 TB | 0.21 % | 0.63 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:32","lastStreamLoadTime":-1} |
| 10012 | default_cluster | 192.168.16.51 | doris-be-prd04.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 55 | 2.202 GB | 2.613 TB | 2.619 TB | 0.22 % | 0.66 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:47","lastStreamLoadTime":-1} |
| 10012 | default_cluster | 192.168.16.52 | doris-be-prd05.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 55 | 2.202 GB | 2.613 TB | 2.619 TB | 0.22 % | 0.66 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:47","lastStreamLoadTime":-1} |
| 10013 | default_cluster | 192.168.16.65 | doris-be-prd06.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 79 | 3.302 GB | 2.614 TB | 2.619 TB | 0.16 % | 0.47 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:21:14","lastStreamLoadTime":-1} |
| 10014 | default_cluster | 192.168.16.63 | doris-be-prd07.aimatech.com | 9050 | 9060 | 8040 | 8060 | 2022-02-19 10:50:31 | 2022-02-21 11:21:11 | true | false | false | 52 | 1.983 GB | 2.613 TB | 2.619 TB | 0.23 % | 0.67 % | {"location" : "default"} | | 0.15.1-rc09-Unknown | {"lastSuccessReportTabletsTime":"2022-02-21 11:20:54","lastStreamLoadTime":-1} |
+-----------+-----------------+---------------+-----------------------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------------------------+--------+---------------------+--------------------------------------------------------------------------------+
6 rows in set (0.02 sec)
- ⑦ 到此为止,如果顺利的话,整个doris集群搭建完毕。后面可以用DB工具用连接mysql的方式连接Doris了。
四.ProxySQL负载部署
当部署多个 FE 节点时,用户可以在多个 FE 之上部署负载均衡层来实现 Doris 的高可用。
该步骤是建议在生产环境一定要做的!
主要步骤可以完全按照官网给的安装手册进行,写的很详细,完全参照即可:
https://doris.apache.org/zh-CN/article/articles/fe-load-balance.html
部署完ProxySQL就可以连接ProxySQL代理地址和端口,连接doris了。
下面是当已经启动ProxySQL时,如果需要修改已配置的ProxySQL的代理端口,可以参照:
https://www.cnblogs.com/XY-Heruo/p/15741246.html
五.连接Doris,进行查询
在第四步中已经做好了ProxySQL的代理,下面将通过连接Proxy代理的IP和端口,连接Doris。
我的ProxySQL地址端口:192.168.16.53:9033
我的FE地址端口:192.168.16.53:9030、192.168.16.64:9030、192.168.16.44:9030
(1)通过DBeaver连接Proxy,选择 mysql,点击下一步
![](https://img.haomeiwen.com/i13039903/d20280995702ca61.png)
(2)填写IP、端口、账号、密码
![](https://img.haomeiwen.com/i13039903/ef3d74b6af92bcf4.png)
(3)点击“测试链接”,显示成功
![](https://img.haomeiwen.com/i13039903/2cd8c572fe60be87.png)
(4)如图所示,db1数据库是导入的测试数据集,大约6亿条14Gb的数据,可以按照官方的教程,导入测试数据集,测试doris集群性能的初步表现:https://doris.apache.org/zh-CN/benchmark/star-schema-benchmark.html
![](https://img.haomeiwen.com/i13039903/757203687be3eef1.png)
(5)执行一条官方测试教程中sql,该条sql执行在1.2秒左右
-- 设置并发度为8
set parallel_fragment_exec_instance_num=8;
-- 设置runtime_filter为BLOOM_FILTER
set runtime_filter_type="BLOOM_FILTER";
-- 执行sql
SELECT d_year, c_nation,
SUM(lo_revenue - lo_supplycost) AS PROFIT
FROM date, customer, supplier, part, lineorder
WHERE lo_custkey = c_custkey
AND lo_suppkey = s_suppkey
AND lo_partkey = p_partkey
AND lo_orderdate = d_datekey
AND c_region = 'AMERICA'
AND s_region = 'AMERICA'
AND (p_mfgr = 'MFGR#1'
OR p_mfgr = 'MFGR#2')
GROUP BY d_year, c_nation
ORDER BY d_year, c_nation;
![](https://img.haomeiwen.com/i13039903/2cdbbff8c66d2daf.png)
网友评论