[Doris] Doris データベースの最新バージョンのインストール方法、詳細なグラフィック チュートリアル

環境のインストール

オープン ソースの MPP アーキテクチャ OLAP データベースである Doris は、ほとんどの主流の商用サーバーで実行できます。MPP アーキテクチャの同時実行の利点と Doris の高可用性機能を最大限に活用するために、Doris の展開は次の要件に従うことをお勧めします。

Linux オペレーティング システム バージョン要件
Linux システム バージョン
CentOS 7.1以上
Ubuntu 16.04 以降

ソフトウェア要件

ソフトウェア バージョン
ジャワ 1.8以上
GCC 4.8.2 以降

オペレーティング システムのインストール要件

開いているファイル ハンドルのシステム最大数を設定する

vi /etc/security/limits.conf 
* soft nofile 65536
* hard nofile 65536

クロック同期

Doris のメタデータは 5000 ミリ秒未満の時間精度を必要とするため、クラスター内のすべてのマシンは時計を同期させて、時計の問題によるメタデータの不一致によるサービスの異常を回避する必要があります。

スワップ パーティションを閉じる (スワップ)

Linux スワップ パーティションは Doris のパフォーマンスに深刻な問題を引き起こすため、インストールの前にスワップ パーティションを無効にする必要があります。
スワップ パーティションが有効になっているかどうかを確認します。

free -m

有効になっている場合は、構成アイテムを変更し、次の行をコメント化します。

#/swapfile                                 none            swap    sw              0       0

その後、再起動して再起動します。

Linux ファイル システム

ここでは、ext4 ファイル システムを使用することをお勧めします.オペレーティング システムをインストールするときは、ext4 ファイル システムを選択してください。

開発およびテスト環境

モジュール CPU メモリー ディスク 通信網 インスタンス数
フロントエンド 8コア+ 8GB以上 SSD または SATA、10GB+* ギガビット イーサネット 1
バックエンド 8コア+ 16GB以上 SSD または SATA、50GB 以上 * ギガビット イーサネット 1-3 *

本番環境

モジュール CPU メモリー ディスク 通信網 インスタンス数 (最小要件)
フロントエンド 16コア以上 64GB以上 SSD または RAID カード、100GB 以上 * 10 ギガビット NIC 1-3 *
バックエンド 16コア以上 64GB以上 SSD または SATA、100G+* 10 ギガビット NIC 3 *

Java 環境

コマンド ラインに jps を入力します。エラー -bash: jps: command not found が報告された場合は、jdk を再インストールする必要があることを意味します。jdk が正常にインストールされている場合は、このセクションをスキップしてください。
コマンドを入力する

whereis java


これは、Java のインストール パスではなく、単なる Java の実行パスです。
コマンドを入力する

which java


このパスは Java パスのソフト リンクです。リンクが指すアドレスを取得します。

ls -l /usr/bin/java


実際のアドレスのクエリを続行します。

ls -l /etc/alternatives/java


見つかったパスは CentOS に付属の openjdk であるため、Oracle の公式 Web サイトから jdk1.8 をダウンロードして再インストールする必要があります。

rpm -qa | grep java #查看java文件
sudo rpm -qa | grep java | xargs rpm -e --nodeps #root权限下删除所有java文件

jdk ダウンロードの公式 Web サイト: https://www.oracle.com/java/technologies/downloads/#java8-linux

一番下のバージョンをダウンロードし、解凍します。

tar -zxvf jdk-8u351-linux-x64.tar.gz

Linux ディレクトリの下: /usr/local ファイルは通常、別のホストが追加のインストール ソフトウェア (通常は、jdk、nginx、rabbitmq などのソース コードをコンパイルすることによってインストールされるプログラム) を格納するために格納されます。/opt は
追加のインストール ソフトウェアのディレクトリです。
mysql、redis、zookeeper;
/usr ユーザーの多くのアプリケーションとファイルがこのディレクトリに配置されます

Java 環境変数を構成します。

vim /etc/profile

最後に追加します:

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}

プロファイル ファイルを更新します。

source /etc/profile

インストールが成功したかどうかを確認します。

java -version
javac

コマンドライン jps を入力してください:

この時点では正常です。

GCC 環境

GCC がインストールされているかどうかを確認し、バージョンが 4.8.2 以降であることを確認します。

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のインストール

doris が使用する mysql プロトコルは、接続して mysql 経由で使用する必要があります. mysql がない場合は、最初に mysql をインストールする必要があります:

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

インストールパッケージのダウンロード


最初に CPU モデルをクエリします。

cat /proc/cpuinfo


CPU が avx2 をサポートしている場合は、avx2 の下にある 3 つのファイルを直接ダウンロードします。
最初に FE と BE を解凍してから、3 番目のパッケージ java-udf-jar-with-dependencies.jar を apache-doris-be-1.2.1-bin-x86_64/lib ディレクトリに配置します。パッケージの場所が間違っていると、後続の BE が起動できなくなります。
環境変数を設定します

vim /etc/profile.d/doris.sh

FE

FE を設定します。

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

その中でもedit_log_portの9010番ポートは競合しやすいので注意してください。また、事前に ${DORIS_HOME}/doris-meta ディレクトリを作成する必要があります。

スタートFE

FE の bin パスの下で実行します。

./start_fe.sh --daemon  
jps # 查看FE是否启动,若有PaloFe,则说明FE启动成功

なれ

BE 構成フォルダーを変更します. 同様に、BE の conf フォルダーの下にある be.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.

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

事前に格納フォルダディレクトリを作成してください。
be が Hadoop クラスターにデプロイされている場合は、be.conf の webserver_port を調整するように注意してください。

FE にすべての BE ノードを追加する

ドリスを接続します。

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";

開始する

BE の bin ディレクトリに入力します。

./start_be.sh --daemon

BE ステータスを表示します。

mysql> SHOW PROC '/backends';

ここに画像の説明を挿入

Alive 項目が true の場合は BE が正常に起動したことを意味し、false の場合は起動に失敗したことを意味します。
起動に失敗した場合は、doris-meta フォルダと storage フォルダが事前に作成されているかどうか、およびポートが競合していないかどうかを確認できます.一般的に、エラーはこの 2 つの理由によって引き起こされます.エラーは、多くの場合、満たされた構成の問題によって引き起こされます.情報。

おすすめ

転載: blog.csdn.net/wilde123/article/details/128679586