doris docker安装
Last updated on November 22, 2024 pm
🧙 Questions
使用docker安装doris
1.2.2
☄️ Ideas
一定要先执行这一行命令
sysctl -w vm.max_map_count=2000000
创建fe的目录
mkdir -p /data/doris/fe/doris-meta
mkdir -p /data/doris/fe/log
mkdir -p /data/doris/fe/conf
官放参考命令
docker run -itd \
--name=fe \
--env FE_SERVERS="fe1:${当前机器的内网IP}:9010" \
--env FE_ID=1 \
-p 8030:8030 \
-p 9030:9030 \
-v /data/fe/doris-meta:/opt/apache-doris/fe/doris-meta \
-v /data/fe/log:/opt/apache-doris/fe/log \
--net=host \
apache/doris:2.0.3-fe-x86_64
fe端口号说明
使用内网ip
开放8个端口号: 30190~30200
- 9010: edit_log_port,默认内网访问端口
- 8030: http_port,和yarn端口号冲突,前端UI访问端口
- 9030: query_port,mysql客户端链接端口
- 9020: rpc_port
自定义端口号
vim /data/doris/fe/conf/fe.conf
# the output dir of stderr and stdout
LOG_DIR = ${DORIS_HOME}/log
DATE = `date +%Y%m%d-%H%M%S`
JAVA_OPTS="-Xmx8192m -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="-Xmx8192m -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
http_port = 30190
rpc_port = 30191
query_port = 30192
edit_log_port = 30193
mysql_service_nio_enabled = 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
# 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
priority_networks = 172.23.39.0/24
启动fe
重装doris,最好删除/data/doris/fe下的文件,重新创建
docker run -itd \
--name=doris-fe \
--env FE_SERVERS="fe1:172.23.39.236:30193" \
--env FE_ID=1 \
-v /data/doris/fe/doris-meta:/opt/apache-doris/fe/doris-meta \
-v /data/doris/fe/log:/opt/apache-doris/fe/log \
-v /data/doris/fe/conf/fe.conf:/opt/apache-doris/fe/conf/fe.conf \
--net=host \
apache/doris:1.2.2-fe-x86_64
查看fe日志
tail -f /data/doris/fe/log/fe.log
检查fe网页
- http://localhost:30190
- 账号: admin
- 密码: 空
检查mysql连接
- jdbc:mysql://localhost:30192
- 账号: root
- 密码: 空
创建be的目录
mkdir -p /data/doris/be/storage
mkdir -p /data/doris/be/log
mkdir -p /data/doris/be/conf
官网参考命令
docker run -itd \
--name=be \
--env FE_SERVERS="fe1:${当前机器的内网IP}:9010" \
--env BE_ADDR="${当前机器的内网IP}:9050" \
-p 8040:8040 \
-v /data/be/storage:/opt/apache-doris/be/storage \
-v /data/be/log:/opt/apache-doris/be/log \
--net=host \
apache/doris:2.0.3-be-x86_64
端口号说明
注意使用内网ip
- 9010: edit_log_port,默认内网访问端口
- 9050: heartbeat_service_port,留给FE访问
- 8040: be_http_port,和nodeManger默认端口号冲突
- 9060: be_port
自定义端口号
vim /opt/apache-doris/be/conf/be.conf
PPROF_TMPDIR="$DORIS_HOME/log/"
# since 1.2, the JAVA_HOME need to be set to run BE process.
# JAVA_HOME=/path/to/jdk/
# INFO, WARNING, ERROR, FATAL
sys_log_level = INFO
# ports for admin, web, heartbeat service
be_port = 30194
webserver_port = 30195
heartbeat_service_port = 30196
brpc_port = 30197
# 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, separate 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>', separate 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
priority_networks = 172.23.39.0/24
启动be
docker run -itd \
--name=doris-be \
--env FE_SERVERS="fe1:172.23.39.236:30193" \
--env BE_ADDR="172.23.39.236:30196" \
-v /data/doris/be/storage:/opt/apache-doris/be/storage \
-v /data/doris/be/log:/opt/apache-doris/be/log \
-v /opt/apache-doris/be/conf/be.conf:/opt/apache-doris/be/conf/be.conf \
--net=host \
apache/doris:1.2.2-be-x86_64
默认不启动be,需要进入容器中启动
docker exec -it doris-be bash
cd /opt/apache-doris/be
bash bin/start_be.sh --daemon
查看be日志
tail -f /data/doris/be/log/be.INFO
fe添加be节点
ALTER SYSTEM ADD BACKEND "172.23.39.236:30196";
SHOW PROC '/backends';
检测doris安装
create database ispong_db;
CREATE TABLE ispong_db.users
(
username VARCHAR (32) ,
age INT
)
UNIQUE KEY (username)
DISTRIBUTED BY HASH(username) BUCKETS 10
PROPERTIES("replication_num" = "1");
insert into ispong_db.users values ("zhangsan",13);
select * from ispong_db.users;
🔗 Links
doris docker安装
https://ispong.isxcode.com/db/doris/doris docker安装/