Doris series 2-Doris compilation and installation

I Preparation before Compilation

1.1 environmental preparation

Host configuration:

IPhost namedeploy
10.31.1.119hp5FEFS_Broker
10.31.1.120hp6BEFS_Broker
10.31.1.121hp7BEFS_Broker,FE Observer
10.31.1.122hp8BEFS_Broker

Hardware configuration:
Each host: CPU4 core, 8G memory and 150G hard disk

Software version:

nameedition
operating systemCentOS release 7.8 (Final) 64 bit
JDK1.11
yum install -y java-11-openjdk-devel.x86_64  
ln -s /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el7_9.x86_64 /usr/lib/jvm/java11

vi /etc/profile
JAVA_HOME=/usr/lib/jvm/java11
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH

source /etc/profile

1.2 installing Docker

1.2. 1 uninstall the old version

yum remove docker  docker-common docker-selinux docker-engine

1.2. 2 install the required software packages

yum install -y yum-utils device-mapper-persistent-data lvm2

1.2. 3 set yum source

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

1.2. 4. View docker version

yum list docker-ce --showduplicates | sort -r

1.2. 5. Install docker

yum install docker-ce
yum install <FQPN>  # For example: Yum install docker-ce-20.10 nine

1.2. 6 start and join the startup

systemctl start docker
systemctl enable docker

1.2. 7 verify that the installation was successful

docker version

1.2. 8 migration docker

Because there is not enough space in the root directory, migrate docker to the / home directory

systemctl stop dcoker
mkdir -p /home/docker
mv /var/lib/docker/* /home/docker/
mount --bind /home/docker/ /var/lib/docker

# Add mount command to boot script
vi /etc/rc.local
mount --bind /home/docker/ /var/lib/docker

1.2. 9 exit and re-enter docker

[root@hp7 /]# docker ps -a
CONTAINER ID   IMAGE                                    COMMAND       CREATED          STATUS                       PORTS     NAMES
4443aa0cb7b9   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   44 seconds ago   Exited (0) 36 seconds ago              hardcore_chaum
8c022367ed79   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   5 minutes ago    Exited (127) 5 minutes ago             lucid_jackson
07c7b65b7724   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   6 minutes ago    Exited (0) 6 minutes ago               modest_hugle
5faefc1a7ce7   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   4 hours ago      Exited (0) 2 minutes ago               infallible_boyd
1331eb39f288   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   4 hours ago      Exited (1) 4 hours ago                 dreamy_clarke
731942087dec   apache/incubator-doris:build-env-1.4.2   "/bin/bash"   3 days ago       Exited (0) 3 days ago                  sweet_wescoff
[root@hp7 /]# 
[root@hp7 /]# docker start 5faefc1a7ce7
5faefc1a7ce7
[root@hp7 /]# docker attach 5faefc1a7ce7
[root@5faefc1a7ce7 ~]# 
[root@5faefc1a7ce7 ~]# ll
total 8
-rw-------.  1 root root 3416 Nov 13  2020 anaconda-ks.cfg
drwxr-xr-x. 22 root root 4096 Dec  6 11:08 incubator-doris
drwxr-xr-x.  2 root root    6 Dec  6 09:54 incubator-doris-DORIS-x.x.x-release
[root@5faefc1a7ce7 ~]# 

II compile

2.1 download Docker image

Download Image

docker pull apache/incubator-doris:build-env-1.4.2

Check mirroring

docker images

2.2 running image

Run mirror

docker run -it apache/incubator-doris:build-env-1.4.2

It is recommended to run the image by mounting the local Doris source code directory, so that the compiled output binaries will be stored in the host computer and will not disappear because the image exits.

At the same time, it is recommended that the maven in the image be deleted at the same time The m2 directory is mounted to the host directory to prevent repeated downloading of maven's dependent libraries every time the image compilation is started.

docker run -it -v /root/.m2 -v /root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-1.4.2

2.3 download source code

After starting the image, you should already be in the container. You can download the Doris source code through the following command (not if the local source code directory is mounted):

git clone https://github.com/apache/incubator-doris.git

2.4 compiling Doris

cd /root/incubator-doris
sh build.sh --clean --be --fe --ui

After compilation, the output file is in the output / directory

III Installation deployment

3.1 install FE

3.1. 1 copy FE deployment file

Copy FE deployment file to hp5

scp -r ./fe root@10.31.1.119:/home/doris/

3.1. 2 configuration FE

The configuration file is conf / Fe conf

  1. meta_dir is the metadata storage location. The default value is ${doris_home} / Doris meta. I think the directory has been created.

  2. java_ By default, the maximum java heap memory of opts is 4GB, which can be adjusted according to the real environment.

  3. priority_networks=10.31.1.0/24 if the host has multiple IPS, doris cannot know which IP to bind. It needs to be specified at this time.

3.1. 3 start FE

sh bin/start_fe.sh --daemon

The FE process starts and enters the background for execution. Logs are stored in the log / directory by default. If startup fails, you can view log / FE Log or log / FE Out to view the error message.

3.2 installation of BE

3.2. 1 copy BE installation files

scp -r ./be root@10.31.1.120:/home/doris/  
scp -r ./be root@10.31.1.121:/home/doris/  
scp -r ./be root@10.31.1.122:/home/doris/  

The following steps hp6, hp7 and hp8 are required for the BE node:

3.2. 2. Modify the configuration of all BE

Modify be / conf / be conf

  1. The main task is to configure storage_root_path: data storage directory. By default, under be/storage, you need to create the directory manually. Semicolons of English status are used between multiple paths; Separate (do not add;) after the last directory. You can distinguish the media, HDD or SSD, storing directories through paths. You can add capacity limits at the end of each path, separated by English status commas.

  2. priority_networks=10.31.1.0/24 if the host has multiple IPS, doris cannot know which IP to bind. It needs to be specified at this time.

3.2. 3 modify file handle data

echo "* soft nofile 204800"  >> /etc/security/limits.conf
echo "* hard nofile 204800"  >> /etc/security/limits.conf
echo "* soft nproc 204800"  >> /etc/security/limits.conf
echo "* hard nproc 204800 "  >> /etc/security/limits.conf

-- modify /etc/sysctl.conf, Add this setting
echo   fs.file-max = 6553560  >> /etc/sysctl.conf

ulimit -u 60000

source /etc/profile

3.2. 4 add all BE nodes in FE

-- among host by FE Node ip;port by fe/conf/fe.conf Medium query_port;Default use root Account, no password login.
mysql -uroot -p -h10.31.1.119 -P9030
-- among host by BE Node ip;port by be/conf/be.conf Medium heartbeat_service_port. 
ALTER SYSTEM ADD BACKEND "10.31.1.120:9050";

3.2. 5 start BE

sh bin/start_be.sh --daemon

Check the operation of BE. If everything is normal, the isAlive column should BE true.

In the end, all three succeeded

3.2. 6 install fs_broker

Compile broker
Broker is deployed independently of Doris in the form of plug-in. If you need to import data from a third-party storage system, you need to deploy the corresponding broker. By default, the FS for reading HDFS and Baidu cloud BOS is provided_ broker. fs_ The broker is stateless. It is recommended that each FE and BE node deploy a broker.

cd /root/incubator-doris/fs_brokers/apache_hdfs_broker
sh build.sh

Copy source code
Copy FS_ The corresponding Broker directory under the Broker's output directory to all nodes to BE deployed. It is recommended to keep the same level with BE or FE directory.

cd /root/incubator-doris/fs_brokers/apache_hdfs_broker/output
scp -r apache_hdfs_broker root@10.31.1.119:/home/doris/
scp -r apache_hdfs_broker root@10.31.1.120:/home/doris/
scp -r apache_hdfs_broker root@10.31.1.121:/home/doris/
scp -r apache_hdfs_broker root@10.31.1.122:/home/doris/

Modify the corresponding Broker configuration
The default value can be used

cd /home/doris/apache_hdfs_broker/conf
vi apache_hdfs_broker.conf

Start Broker

sh bin/start_broker.sh --daemon

Add Broker
To let Doris FE and BE know which nodes the Broker is on, add the Broker node list through the sql command.
Use the MySQL client connection to start the FE, and execute the following command:

-- among host by Broker Node ip;port by Broker In the configuration file broker_ipc_port. 
ALTER SYSTEM ADD BROKER broker_name "host1:port1","host2:port2",...;

ALTER SYSTEM ADD BROKER broker_name "10.31.1.119:8000","10.31.1.120:8000","10.31.1.121:8000","10.31.1.122:8000";

View Broker status

SHOW PROC "/brokers";

3.2. 7. Add FE Observer

FE is divided into three roles: Leader, Follower and observer. By default, a cluster can have only one Leader and multiple followers and observers. The Leader and Follower form a Paxos selection group. If the Leader goes down, the remaining followers will automatically select a new Leader to ensure high write availability. Observer synchronizes the data of the Leader, but does not participate in the election. If only one FE is deployed, the FE is the Leader by default.

The first FE started automatically becomes the Leader. On this basis, you can add several followers and observers.

Amend 10.31 Configuration file on 1.121
Mainly modify priority_networks this parameter
priority_networks = 10.31.1.0/24

Add Observer

-- among host by Observer Node ip,port Configure a profile for it fe.conf Medium edit_log_port. 
ALTER SYSTEM ADD OBSERVER "host:port";

ALTER SYSTEM ADD OBSERVER "10.31.1.121:9010";

View Observer running status

SHOW PROC '/frontends';

FAQ:

1. BE connection FE error

This is a network problem. For specific troubleshooting logs, when the host has multiple IP addresses, it needs to be specified in the configuration file, for example:
priority_networks=10.31.1.0/24

There is another problem. Because my FE node is a test machine, MySQL has been installed. As a result, when I connect to BE, it is the previously installed test library. Before installing FE, I need to uninstall the installed MySQL service on the host.

2. BE installation error - File descriptor number is less than 60000

BE error:

Solution:

echo "* soft nofile 204800"  >> /etc/security/limits.conf
echo "* hard nofile 204800"  >> /etc/security/limits.conf
echo "* soft nproc 204800"  >> /etc/security/limits.conf
echo "* hard nproc 204800 "  >> /etc/security/limits.conf

-- modify /etc/sysctl.conf, Add this setting
echo   fs.file-max = 6553560  >> /etc/sysctl.conf

ulimit -u 60000

source /etc/profile

3. Some other errors are reported

During the installation process, some inexplicable errors occur due to configuration files and other reasons. At this time, you can put $Doris_ Delete the be or fe entire directory under the home directory, then copy it from the source again, and then configure it.

reference resources:

  1. http://doris.apache.org/master/zh-CN/installing/compilation.html#%E4%BD%BF%E7%94%A8-docker-%E5%BC%80%E5%8F%91%E9%95%9C%E5%83%8F%E7%BC%96%E8%AF%91-%E6%8E%A8%E8%8D%90
  2. https://blog.csdn.net/qq_21480329/article/details/117730233
  3. https://blog.csdn.net/longqiancao1/article/details/117665789

Keywords: Docker

Added by Ell20 on Tue, 28 Dec 2021 17:12:56 +0200