文章目录
Doirs安装部署
1 软件准备
官网下载地址:Doris下载
可通过如下命令查看自己服务器是否满足avx2
的条件
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 25
model : 80
model name : AMD Ryzen 9 5900HX with Radeon Graphics
stepping : 0
microcode : 0xa50000b
cpu MHz : 3293.813
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 16
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc art rep_good nopl tsc_reliable nonstop_tsc extd_apicid eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline_amd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero arat umip pku ospke vaes vpclmulqdq overflow_recov succor
如果看到下图中红色框标记的内容则可选择下载avx2
版本的Doris
2 环境准备
2.1系统及软件
系统 | 版本 |
---|---|
CentOS | 7.1及以上 |
Ubuntu | 16.04及以上 |
软件 | 版本 |
---|---|
Java | 1.8及以上 |
GCC | 4.8.2及以上 |
2.2 系统默认参数修改
完成以上步骤后修改系统默认打开文件的最大数量,命令如下
vi /etc/security/limits.conf
# 在文件末尾添加如下内容
* soft nofile 204800
* hard nofile 204800
* soft nproc 204800
* hard nproc 204800
# 修改完程后重启服务器或重新登录生效
vi /etc/sysctl.conf
# 在文件末尾添加如下内容
fs.file-max = 6553560
vm.max_map_count=2000000
# 修改完成后执行sysctl -p 命令生效
2.3 时间同步
选一台服务器作时间服务器,这里以hdp1作为时间服务器,其他服务器以时间服务器时间为准
2.3.1 时间服务器配置(root用户)
-
安装ntp服务
yum install -y ntp
-
修改ntp配置文件
修改/etc/ntp.conf文件
vi /etc/ntp.conf
2.1 授权192.168.1.0-192.168.1.255网段上的所有机器可以从这台机器上查询和同步时间
修改
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
为
restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap #我这里使用的网段为80,具体网段根据服务器的ip而定
2.2 集群在局域网和非局域网时间配置
集群在局域网中,不使用其他互联网上的时间
修改
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
为
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
集群使用互联网时间,这里使用阿里云时间服务器的时间
# 将原来的注释掉
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
# 添加如下
server ntp1.aliyun.com iburst
server ntp2.aliyun.com iburst
server ntp3.aliyun.com iburst
server ntp4.aliyun.com iburst
server ntp5.aliyun.com iburst
server ntp6.aliyun.com iburst
server ntp7.aliyun.com iburst
2.3 当该节点丢失网络连接,依然可以采用本地时间作为时间服务器为集群中的其他节点提供时间同步
server 127.127.1.0
fudge 127.127.1.0 stratum 10
-
启动ntp服务并设置开机自启
systemctl start ntpd # 启动ntpd服务 systemctl enable ntpd # 配置ntpd服务开机自启
2.3.2 其他服务器配置(root用户)
-
非时间服务器都安装ntpdate服务
yum install -y ntpdate
-
同步时间
ntpdate hdp1
-
定时同步时间
通过crontab编写定时任务
crontab -e # 添加如下内容 29,59 * * * * /usr/sbin/ntpdate hdp1 # 每小时的第29分和59分同步一次时间
到达时间点后通过
date
命令查看时间是否已经同步,当然配置间隔时间更短的任务,这样可以更快的看到效果。
3 软件安装
环境 | 节点 | 服务 |
---|---|---|
测试 | lx01 | fe,be |
测试 | lx02 | be |
测试 | lx03 | be |
先软件包进行解压,命令如下
# FE
xz -d ./apache-doris-fe-1.2.1-bin-x86_64.tar.xz
tar -xf ./apache-doris-fe-1.2.1-bin-x86_64.tar
# BE
xz -d ./apache-doris-be-1.2.1-bin-x86_64.tar.xz
tar -xf ./apache-doris-be-1.2.1-bin-x86_64.tar
# Dependencies
xz -d ./apache-doris-dependencies-1.2.1-bin-x86_64.tar.xz
tar -xf ./apache-doris-dependencies-1.2.1-bin-x86_64.tar
配置FE,命令如下
# 编辑解压完的FE的conf目录下的fe.conf文件
vi /opt/apps/doris-fe-1.2.1/conf/fe.conf
# 修改如下内容
meta_dir = /opt/data/doris/fe/doris-meta #这里是将元数据的目录做了修改,生产环境尽量进行修改,如果不修改会放到doris默认的存放目录
priority_networks = 192.xxx.xxx.xxx/24;192.168.0.0/16 #192.xxx.xxx.xxx是BE所在服务器的真实IP
配置BE,命令如下
# 编辑解压完的BE的conf目录下的be.conf文件
vi /opt/apps/doris-be-1.2.1/conf/be.conf
# 修改内容如下
JAVA_HOME=/opt/apps/jdk1.8 #配置JAVA_HOME
storage_root_path = /opt/data/doris/be/storage #配置数据存储目录,同样生产环境尽量不要使用doris默认的存放目录
priority_networks = 192.xxx.xxx.xxx/24;192.168.0.0/16 #192.xxx.xxx.xxx是BE所在服务器的真实IP
将JAVA UDF的jar包拷贝到BE的lib目录下,apache-doris-dependencies-1.2.1-bin-x86_64.tar.xz
解压完的目录中就有这个jar包,如果不将jar包拷贝到BE的lib目录中,启动be的时候会报错
将BE节点添加到FE中
先启动FE的服务,命令如下
/opt/apps/doris-fe-1.2.1/bin/start_fe.sh
#启动完成通过netstat -nltp | grep 9030查看是否有这个端口号,如果有则说明FE启动成功
这个会使用到mysql客户端连接FE,如果所在服务器已经安装好了mysql,则可以直接使用mysql的命令进行添加,如果没有mysql的服务,则安装一个mysql的客户端就可以.,执行命令如下
# 在 fe/conf/fe.conf 中;默认使用root账号,登录时不需要密码
mysql -h 192.xxx.xxx.xxx -P 9030 -uroot
# 登录到客户后执行如下命令,be_host是BE节点的IP地址,有几个添加几个就可以了
ALTER SYSTEM ADD BACKEND "be_host:heartbeat_service_port";
到这里Doris基本安装步骤就完成了.
# 在 fe/conf/fe.conf 中;默认使用root账号,登录时不需要密码
mysql -h 192.xxx.xxx.xxx -P 9030 -uroot
# 登录到客户后执行如下命令,be_host是BE节点的IP地址,有几个添加几个就可以了
ALTER SYSTEM ADD BACKEND "be_host:heartbeat_service_port";
到这里Doris基本安装步骤就完成了.