Environment installation
As an open source MPP architecture OLAP database, Doris can run on most mainstream commercial servers. In order to take full advantage of the concurrency advantages of the MPP architecture and the high availability features of Doris, we recommend that the deployment of Doris follow the following requirements:
Linux operating system | version requirements |
---|---|
Linux system | Version |
CentOS | 7.1 and above |
Ubuntu | 16.04 and above |
Software Requirements
software | Version |
---|---|
Java | 1.8 and above |
GCC | 4.8.2 and above |
Operating System Installation Requirements
Set the system maximum number of open file handles
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
Clock synchronization
The metadata of Doris requires that the time accuracy is less than 5000ms, so all machines in the cluster must synchronize their clocks to avoid service exceptions caused by inconsistencies in metadata caused by clock problems.
Close the swap partition (swap)
The Linux swap partition will cause serious performance problems for Doris, and the swap partition needs to be disabled before installation.
Check to see if the swap partition is enabled:
free -m
If it is enabled, modify the configuration item and comment this line:
#/swapfile none swap sw 0 0
Then reboot to restart.
Linux file system
Here we recommend using the ext4 file system. When installing the operating system, please select the ext4 file system.
Development and testing environment
module | CPU | Memory | disk | network | number of instances |
---|---|---|---|---|---|
Frontend | 8 cores + | 8GB+ | SSD or SATA, 10GB+* | Gigabit Ethernet | 1 |
Backend | 8 cores + | 16GB+ | SSD or SATA, 50GB+ * | Gigabit Ethernet | 1-3 * |
Production Environment
module | CPU | Memory | disk | network | Number of instances (minimum requirement) |
---|---|---|---|---|---|
Frontend | 16 cores+ | 64GB+ | SSD or RAID card, 100GB+ * | 10 Gigabit NIC | 1-3 * |
Backend | 16 cores+ | 64GB+ | SSD or SATA, 100G+* | 10 Gigabit NIC | 3 * |
java environment
Enter jps on the command line, if the error -bash: jps: command not found is reported, it means that jdk needs to be reinstalled. If jdk has been installed normally, skip this section.
input the command
whereis java
This is just the execution path of java, not the installation path of java.
input the command
which java
This path is a soft link of the java path, get the address pointed to by the link:
ls -l /usr/bin/java
Continue to query the real address:
ls -l /etc/alternatives/java
The found path is the openjdk that comes with CentOS, so we need to download jdk1.8 from the oracle official website and reinstall it. First, uninstall the original openjdk:
rpm -qa | grep java #查看java文件
sudo rpm -qa | grep java | xargs rpm -e --nodeps #root权限下删除所有java文件
jdk download official website: https://www.oracle.com/java/technologies/downloads/#java8-linux
Download the bottom version, unzip:
tar -zxvf jdk-8u351-linux-x64.tar.gz
Under the linux directory:
/usr/local files are generally stored for another host to store additional installation software, usually programs installed by compiling source code, such as jdk, nginx, rabbitmq; /opt is the directory for additional installation software
, Such as mysql, redis, zookeeper;
many applications and files of /usr users are placed in this directory
Configure java environment variables:
vim /etc/profile
Append at the end:
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_351 #jdk安装目录
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
Refresh the profile file:
source /etc/profile
Check if the installation was successful:
java -version
javac
Enter the command line jps:
it is normal at this time.
GCC environment
Check whether GCC is installed, and ensure that the version is 4.8.2 and above:
a@a:~$ gcc
Command 'gcc' not found, but can be installed with:
sudo apt install gcc
a@a:~$ sudo apt install gcc # 安装GCC
a@a:~$ gcc -v # 查看GCC版本
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
mysql installation
The mysql protocol used by doris needs to be connected and used through mysql. If there is no mysql, you need to install mysql first:
mysql
sudo apt install mysql-client-core-8.0 # version 8.0.30-0ubuntu0.20.04.2, or
sudo apt install mariadb-client-core-10.3 # version 1:10.3.34-0ubuntu0.20.04.1
Installation package download
First query the cpu model:
cat /proc/cpuinfo
If the cpu supports avx2, then directly download the three files under avx2.
First decompress FE and BE, and then put the third package java-udf-jar-with-dependencies.jar in the apache-doris-be-1.2.1-bin-x86_64/lib directory. If the location of the package is misplaced, the subsequent BE will not be able to start.
Set environment variables :
vim /etc/profile.d/doris.sh
FE
Configure FEs:
a@a:/opt/doris/apache-doris-fe-1.2.1-bin-x86_64/conf # pwd
a@a:/export/server/apache-doris-1.1.1-bin-x86/fe/conf # ll
# vim fe.conf
root@zhiyong-doris:/export/server/apache-doris-1.1.1-bin-x86/fe/conf# cat 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="-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 = 8030
rpc_port = 9020
query_port = 9030
edit_log_port = 13536
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
priority_networks = 192.168.88.0/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
Among them, the port 9010 of edit_log_port is easy to conflict, so please pay attention. In addition, the ${DORIS_HOME}/doris-meta directory needs to be created in advance.
Start FE
Execute under the bin path of FE:
./start_fe.sh --daemon
jps # 查看FE是否启动,若有PaloFe,则说明FE启动成功
BE
Modify the BE configuration folder. Similarly, modify be.conf under the conf folder of BE:
# 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 = 13535
heartbeat_service_port = 9050
brpc_port = 8060
# 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.88.0/24
# 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
storage_root_path = /opt/doris/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
Create the storage folder directory in advance.
If be is deployed in hadoop cluster, pay attention to adjust the webserver_port in be.conf.
Add all BE nodes in FE
Connect doris:
mysql -h 192.168.88.21 -P 9030 -uroot
mysql> show databases;
mysql> use information_schema;
mysql> show tables;
mysql> ALTER SYSTEM ADD BACKEND "192.168.88.21:9050";
Start BE
Enter in the bin directory of BE:
./start_be.sh --daemon
View BE status:
mysql> SHOW PROC '/backends';
If the Alive item is true, it means that the BE starts successfully, and if it is false, it means that the startup fails.
If the startup fails, you can check whether the doris-meta and storage folders have been created in advance, and whether the port conflicts. Generally, errors are caused by these two reasons. Errors are often due to problems with the filled configuration information.