doris 编译安装

Last updated on November 22, 2024 pm

🧙 Questions

单节点安装doris1.1.0

☄️ Ideas

下载doris源码
wget https://dist.apache.org/repos/dist/release/doris/1.1/1.1.0-rc05/apache-doris-1.1.0-src.tar.gz
tar -vzxf apache-doris-1.1.0-src.tar.gz
运行编译镜像
docker run -it \
  --name doris-build-env \
  -v /home/ispong/.m2:/root/.m2 \
  -v /home/ispong/apache-doris-1.1.0-src:/root/doris-1.1.0-release/ \
  -d apache/doris:build-env-for-1.1.0
进入容器
docker exec -it doris-build-env bash
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
编译doris
cd /root/doris-1.1.0-release/
nohup bash build.sh >> build.log 2>&1 &
tail -f /root/doris-1.1.0-release/build.log
编译broker
cd /root/doris-1.1.0-release/fs_brokers/apache_hdfs_broker/
nohup bash build.sh >> build.log 2>&1 &
tail -f /root/doris-1.1.0-release/fs_brokers/apache_hdfs_broker/build.log
创建安装目录
sudo mkdir -p /data/doris/doris-0.14
sudo chown -R ispong:ispong /data/doris/doris-0.14
从docker中拷贝出doris
docker cp doris-build-env:/root/doris/output/be /data/doris/doris-1.1.0/
docker cp doris-build-env:/root/doris/output/fe /data/doris/doris-1.1.0/
docker cp doris-build-env:/root/doris/fs_brokers/apache_hdfs_broker/output/apache_hdfs_broker /data/doris/doris-1.1.0/
sudo ln -s /data/doris/doris-1.1.0 /opt/doris
配置doris系统环境变量
sudo vim /etc/profile
export DORIS_HOME=/opt/doris 
export PATH=$PATH:$DORIS_HOME/fe/bin 
export PATH=$PATH:$DORIS_HOME/be/bin
export PATH=$PATH:$DORIS_HOME/apache_hdfs_broker/bin
source /etc/profile

安装FE(Frontend)

Metadata and scheduling nodes of Doris system. In the import process, it is mainly responsible for the generation of import planning and the scheduling of import tasks.

修改FE配置

Note: 需要配置JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk

vim /opt/doris/fe/conf/fe.conf
# 8030 一定要改端口号 和yarn的resouceManger默认端口号冲突
http_port = 18030 
# 9010 一定要改端口号 和cdh的zk服务端口号冲突
edit_log_port = 19010
# 9030 mysql链接端口
query_port = 9030
创建doris-meta文件夹
mkdir -p /opt/doris/fe/doris-meta
启动FE

关闭FE: sh bin/stop_fe.sh –daemon

cd /opt/doris/fe
sh bin/start_fe.sh --daemon
查看日志
tail -f /opt/doris/fe/log/fe.log
访问是否启动成功

默认端口号 ${http_port} 8030

netstat -nlpt | grep 30129

安装BE(Backend)

The computing and storage nodes of Doris system. In the import process, it is mainly responsible for ETL and storage of data.

创建storage文件夹
mkdir -p /opt/doris/be/storage
修改BE配置
vim /opt/doris/be/conf/be.conf
storage_root_path = /opt/doris/be/storage
heartbeat_service_port = 9050
# 8040 一定要改端口号 nodeManger默认端口号冲突
webserver_port = 30130
启动BE
cd /opt/doris/be
bash bin/start_be.sh --daemon
cd /opt/doris/be
bash bin/stop_be.sh --daemon
查看日志
tail -f /opt/doris/be/log/be.out
检测是否启动
netstat -nlpt | grep 9060
使用mysql连接doris-FE
# root 默认没有密码
docker exec -it isxcode-mysql bash
# mysql -u ${user} -h ${ip} -P ${query_port}
mysql -u root -h isxcode -P 30131
-- 添加BE 需要提前添加
-- heartbeat_service_port 默认端口号9050
-- ALTER SYSTEM ADD BACKEND "${内网ip}:9050";
ALTER SYSTEM ADD BACKEND "172.23.39.227:30136";
ALTER SYSTEM DROP BACKEND "<be_host>:<heartbeat_service_port>"


-- 测试是否安装成功
SHOW PROC '/backends';
+-----------+-----------------+---------------+-------------------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------+------------------------+----------------------------------------+
| BackendId | Cluster         | IP            | HostName                | HeartbeatPort | BePort | HttpPort | BrpcPort | LastStartTime       | LastHeartbeat       | Alive | SystemDecommissioned | ClusterDecommissioned | TabletNum | DataUsedCapacity | AvailCapacity | TotalCapacity | UsedPct | MaxDiskUsedPct | ErrMsg | Version                | Status                                 |
+-----------+-----------------+---------------+-------------------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------+------------------------+----------------------------------------+
| 11001     | default_cluster | 172.26.34.173 | iZ8vbiphip9gd4r7opbw33Z | 9050          | 9060   | 8040     | 8060     | 2022-04-16 15:14:05 | 2022-04-16 15:16:04 | true  | false                | false                 | 0         | .000             | 1.000 B       | .000          | 0.00 %  | 0.00 %         |        | 0.14.0-release-Unknown | {"lastSuccessReportTabletsTime":"N/A"} |
+-----------+-----------------+---------------+-------------------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------------------+-----------+------------------+---------------+---------------+---------+----------------+--------+------------------------+----------------------------------------+

安装Broker

Broker is an independent stateless process. It encapsulates the file system interface and provides Doris with the ability to read files in the remote storage system.

修改配置文件
vim /opt/doris/apache_hdfs_broker/conf/apache_hdfs_broker.conf
broker_ipc_port=8000
启动
cd /opt/doris/apache_hdfs_broker
sh bin/start_broker.sh --daemon
查看日志
tail -f /opt/doris/apache_hdfs_broker/log/apache_hdfs_broker.log
添加Broker到集群
-- broker_ipc_port
ALTER SYSTEM ADD BROKER ispong_broker "172.23.39.226:8000";
SHOW PROC '/brokers';
+---------------+---------------+------+-------+---------------------+---------------------+--------+
| Name          | IP            | Port | Alive | LastStartTime       | LastUpdateTime      | ErrMsg |
+---------------+---------------+------+-------+---------------------+---------------------+--------+
| ispong_broker | 172.26.34.173 | 8000 | true  | 2022-04-16 15:28:45 | 2022-04-16 15:28:45 |        |
+---------------+---------------+------+-------+---------------------+---------------------+--------+

doris 编译安装
https://ispong.isxcode.com/db/doris/doris 编译安装/
Author
ispong
Posted on
September 23, 2021
Licensed under