文章目录
- 前言
- 一、系统环境简介
- 二、部署要求
- 三、部署安装
- 1、基础设置
- 2、下载镜像
- 3、下载安装包
- 4、启动镜像环境
- 5、配置fe
- 6、配置be
- 总结
前言
应项目测试需求,需使用docker部署单机版doris。
一、系统环境简介
#1 系统信息
[root@test][~]
$cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@test][~]
$uname -a
Linux test 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
#2 docker版本信息
[root@test][~]
$docker version
Client: Docker Engine - Community
Version: 23.0.1
API version: 1.42
Go version: go1.19.5
Git commit: a5ee5b1
Built: Thu Feb 9 19:51:00 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 23.0.1
API version: 1.42 (minimum version 1.12)
Go version: go1.19.5
Git commit: bc3805a
Built: Thu Feb 9 19:48:42 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
二、部署要求
三、部署安装
1、基础设置
在启动doris的be时,需要将 Linux 操作系统的内核参数设置为2000000,这里是Doris官方要求的,Linux系统修改内核参数,直接在Docker宿主机中设置即可。
[root@test][~]
$sysctl -w vm.max_map_count=2000000
vm.max_map_count = 2000000
[root@test][~]
$sysctl vm.max_map_count
vm.max_map_count = 2000000
2、下载镜像
这个镜像主要是用来集成FE(Doris的前端UI)和BE(Doris的后台进程)的,里面包含一些常用的开发环境,例如JDK等
[root@test][~/doris]
$ docker pull apache/doris:build-env-ldb-toolchain-latest
3、下载安装包
#1 官方下载地址
https://doris.apache.org/zh-CN/download/
#2 本次下载如下版本
`
#3 # mysql连接客户端 这里需要引入MySQL是因为了支持 Doris 的元数据存储和管理
wget https://doris-build-hk.oss-cn-hongkong.aliyuncs.com/mysql-client/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
#4 下载的两个软件截图如下:
[root@test][~/doris]
$ ll
drwxr-xr-x 5 root root 44 Dec 10 2023 apache-doris-2.0.3-bin-x64.tar.gz
-rw-r--r-- 1 root root 643790848 Nov 26 10:15 mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
4、启动镜像环境
#1 启动镜像
docker run -d -it --name=doris \
-p 9030:9030 -p 8030:8030 \
apache/doris:build-env-ldb-toolchain-latest \
/bin/bash
#2 复制安装包到doris容器中
docker cp /root/doris/apache-doris-2.0.3-bin-x64.tar.gz doris:/opt
docker cp /root/doris/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz doris:/opt
#3 进入到容器中
[root@test][~/doris]
$docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a7c07b27e56a apache/doris:build-env-ldb-toolchain-latest "/bin/bash" 4 minutes ago Up 4 minutes 0.0.0.0:8030->8030/tcp, :::8030->8030/tcp, 0.0.0.0:9030->9030/tcp, :::9030->9030/tcp doris
[root@test][~/doris]
$docker exec -it doris bash
[root@a7c07b27e56a ~]# cd /opt/
[root@a7c07b27e56a opt]# ls
apache-doris-2.0.3-bin-x64.tar.gz mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
[root@a7c07b27e56a opt]# tar -zxvf apache-doris-2.0.3-bin-x64.tar.gz
[root@a7c07b27e56a opt]# tar -zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
[root@a7c07b27e56a opt]# ls
apache-doris-2.0.3-bin-x64 apache-doris-2.0.3-bin-x64.tar.gz mysql-5.7.22-linux-glibc2.12-x86_64 mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
# 查看主机iP,后面会用到
[root@a7c07b27e56a opt]# hostname -i
172.17.0.2
5、配置fe
#1 进入到指定目录
[root@a7c07b27e56a apache-doris-2.0.3-bin-x64]# cd /opt/apache-doris-2.0.3-bin-x64/fe
[root@a7c07b27e56a fe]# ll
total 132
-rw-r--r-- 1 root root 84903 Dec 10 2023 LICENSE-dist.txt
-rw-r--r-- 1 root root 1948 Dec 10 2023 NOTICE.txt
drwxr-xr-x 2 root root 43 Dec 10 2023 bin
drwxr-xr-x 3 root root 49 Dec 10 2023 conf
drwxr-xr-x 2 root root 6 Dec 10 2023 doris-meta
drwxr-xr-x 2 root root 24576 Dec 10 2023 lib
drwxr-xr-x 2 root root 4096 Dec 10 2023 licenses
drwxr-xr-x 2 root root 6 Dec 10 2023 log
drwxr-xr-x 3 root root 105 Dec 10 2023 mysql_ssl_default_certificate
drwxr-xr-x 2 root root 62 Dec 10 2023 spark-dpp
drwxr-xr-x 3 root root 20 Dec 10 2023 webroot
#2 编辑配置文件
[root@a7c07b27e56a fe]# vim conf/fe.conf
# Default value is empty.
# priority_networks = 10.10.10.0/24;192.168.0.0/16
# 修改成如下的
priority_networks = 172.17.0.2/24
#3 启动fe
[root@a7c07b27e56a fe]# ll bin/
total 12
-rwxr-xr-x 1 root root 7538 Dec 10 2023 start_fe.sh
-rwxr-xr-x 1 root root 2604 Dec 10 2023 stop_fe.sh
[root@a7c07b27e56a fe]# ./bin/start_fe.sh --daemon
[root@a7c07b27e56a fe]# jps
546 Jps
532 DorisFE
#4 后台验证,
[root@a7c07b27e56a fe]# curl http://127.0.0.1:8030/api/bootstrap
{"msg":"success","code":0,"data":{"replayedJournalId":0,"queryPort":0,"rpcPort":0,"version":""},"count":0}[root@a7c07b27e56a fe]#
#5 页面验证
账户root,密码为空
#6 容器内链接fe,默认无密码
[root@a7c07b27e56a fe]# /opt/mysql-5.7.22-linux-glibc2.12-x86_64/bin/mysql -uroot -P9030 -h127.0.0.1 --skip-ssl
WARNING: --ssl is deprecated and will be removed in a future version. Use --ssl-mode instead.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
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> show frontends\G;
*************************** 1. row ***************************
Name: fe_499e3b0b_c794_4aed_8658_751e08363ce7
Host: 172.17.0.2
EditLogPort: 9010
HttpPort: 8030
QueryPort: 9030
RpcPort: 9020
Role: FOLLOWER
IsMaster: true #这里为true代表正常
ClusterId: 2136993076
Join: true #这里为true代表正常
Alive: true #这里为true代表正常
ReplayedJournalId: 816
LastHeartbeat: 2024-11-26 03:30:03
IsHelper: true
ErrMsg:
Version: doris-2.0.3-rc06-37d31a5
CurrentConnected: Yes
1 row in set (0.08 sec)
ERROR:
No query specified
mysql> exit
Bye
6、配置be
#1 进入到指定目录
[root@a7c07b27e56a fe]# cd /opt/apache-doris-2.0.3-bin-x64/be
#2 编辑配置文件
[root@a7c07b27e56a be]# vim conf/be.conf
# use CIDR format, e.g. 10.10.10.0/24 or IP format, e.g. 10.10.10.1
# Default value is empty.
# priority_networks = 10.10.10.0/24;192.168.0.0/16
# 添加下面这行
priority_networks = 172.17.0.2/24
#3 设置jdk路径
[root@a7c07b27e56a be]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0
[root@a7c07b27e56a be]# vim bin/start_be.sh
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# 下面添加这行
export JAVA_HOME=/usr/lib/jvm/java-1.8.0
#4 然后启动be,并在mysql中连接be
[root@a7c07b27e56a be]# ./bin/start_be.sh --daemon
#5 进入mysql
[root@a7c07b27e56a be]# /opt/mysql-5.7.22-linux-glibc2.12-x86_64/bin/mysql -uroot -P9030 -h127.0.0.1 --skip-ssl
WARNING: --ssl is deprecated and will be removed in a future version. Use --ssl-mode instead.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
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.
#5.1 将BE节点加入到集群中
mysql> ALTER SYSTEM ADD BACKEND "172.17.0.2:9050";
Query OK, 0 rows affected (0.04 sec)
#5.2 显示doris后端详情
mysql> SHOW BACKENDS\G;
*************************** 1. row ***************************
BackendId: 10830
Host: 172.17.0.2
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2024-11-26 03:53:20
LastHeartbeat: 2024-11-26 03:54:30
Alive: true #true表示节点运行正常(如果为false,可以尝试等待一会再重新查看,第一次启动会慢一点;或有其他问题在/opt/apache-doris-1.2.4.1-bin-x86_64/be/log/be.out 里面查看日志)
SystemDecommissioned: false
TabletNum: 14
DataUsedCapacity: 0.000
TrashUsedCapcacity: 0.000
AvailCapacity: 19.659 GB
TotalCapacity: 46.889 GB
UsedPct: 58.07 %
MaxDiskUsedPct: 58.07 %
RemoteUsedCapacity: 0.000
Tag: {"location" : "default"}
ErrMsg:
Version: doris-2.0.3-rc06-37d31a5
Status: {"lastSuccessReportTabletsTime":"2024-11-26 03:54:28","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
HeartbeatFailureCounter: 0
NodeRole: mix
1 row in set (0.01 sec)
ERROR:
No query specified
#6 进程验证
[root@a7c07b27e56a be]# jps
1361 DorisBE
532 DorisFE
3150 Jps
#7 页面验证
总结
至此,单机版的doris搭建完毕。
- 参考博客 Docker单机部署Doris超详细图文教程