wdp安装手册说明
# 安装前的准备
# 前置软件安装
安装系统之前,需要确保系统中已经具备了这些基本的软件:
- yum and rpm (RHEL/CentOS/Oracle/Amazon Linux)
- zypper and php_curl (SLES)
- apt (Debian/Ubuntu)
- scp, curl, unzip, tar, wget, and gcc*
- OpenSSL (v1.01, build 16 or later)
- Python (with python-devel*)
# 系统设置
安装前需要进行系统参数的默认设置: 包括 系统最大文件打开数量,主机的hostname, ssh的面密码登录,ntp时钟同步设置和关闭防火墙
# 修改默认的最大文件打开数
官方建议最大打开数修改到10000或者更多。
在每台主机上执行以下命令:
ulimit -Sn
ulimit -Hn
#如果返回的数量小于200000,执行命令进行设置:
ulimit -n 400000
2
3
4
5
永久设置:
vi /etc/security/limits.conf
添加:
# End of file
#* - nofile 199990
#* - noproc 199990
* soft nofile 65536
* hard nofile 65536
2
3
4
5
或者
echo "* - nofile 199990" >> /etc/security/limits.conf
echo "* - noproc 199990" >> /etc/security/limits.conf
2
# 设置主机的host
必须确保能够使用hostname进行主机通信,可以配置dns或者设置/etc/hosts
例如:
[root@host116 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.45.xx.116 host116
10.45.xx.117 host117
10.45.xx.118 host118
10.45.xx.120 host120
10.45.xx.121 host121
10.45.xx.122 host122
2
3
4
5
6
7
8
9
10
[root@host151-131 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.45.xxx.131 host151-131
10.45.xxx.132 host151-132
10.45.xxx.133 host151-133
10.45.xxx.116 host116
2
3
4
5
6
7
8
9
# 配置安装主机和其他节点的SSH免密码登录
安装主机运行:ssh-keygen
然后再运行其他主机的面密码登录设置命令:
ssh-copy-id root@host116
ssh-copy-id root@host117
ssh-copy-id root@host118
ssh-copy-id root@vhost-118-24
ssh-copy-id root@oracle24
ssh-copy-id root@crms-10-10-177-40
2
3
4
5
6
# 配置ntp 时钟同步
安装ntp:
yum install ntp
主节点配置:
vi /etc/ntp.conf
#允许任何IP的客户机都可以进行时间同步
#将“restrict default nomodify notrap noquery”这行修改成:
restrict default nomodify notrap
#必须添加网段的支持
restrict 192.168.93.0 mask 255.255.255.0
#最后添加:
server 127.127.1.0 iburst
2
3
4
5
6
7
8
9
其他节点配置:
vi /etc/ntp.conf
#删除默认的同步配置
#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 host116 prefer
2
3
4
5
6
7
8
启动ntp服务:
systemctl start ntpd
systemctl enable ntpd
2
# 关闭防火墙
HADOOP需要使用很多端口,所以集群之间的机器应该是互信的,需要关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
2
这里也需要确认是disabled; /etc/selinux/config
[root@host120 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
2
3
4
5
6
7
脚本直接替换
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# 设置本地仓库
WDP的安装过程中,需要通过网络安装相关的软件。由于在部署系统中一般都在内网中,所以需要设置本地私有仓库。
# 安装和配置http服务
仓库主机安装软件:
yum install yum-utils createrepo httpd
启动httpd服务:
systemctl start httpd.service
systemctl enable httpd.service
2
创建文件夹
mkdir -p /var/www/html/hdp-install/
配置权限
编辑配置文件: vi /etc/httpd/conf/httpd.conf
#Listen 12.34.56.78:80
Listen 58888
<Directory "/var/www/html">
# Require all granted
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
2
3
4
5
6
7
8
9
# 配置WDP软件包
下载解压后,存放到目录:
cd /var/www/html/
mkdir -p /var/www/html/WDP/centos7/develop
[iwdp@host68 1.0]$ ll
total 20
drwxr-xr-x 2 iwdp iwdp 47 Mar 9 16:31 bigtop-jsvc
drwxr-xr-x 2 iwdp iwdp 49 Mar 10 10:16 bigtop-utils
drwxr-xr-x 2 iwdp iwdp 4096 Mar 23 11:12 hadoop
drwxr-xr-x 2 iwdp iwdp 286 Mar 15 15:57 hbase
drwxr-xr-x 2 iwdp iwdp 4096 Mar 9 16:31 hive
drwxrwxr-x 2 iwdp iwdp 93 Mar 18 16:33 kafka
drwxr-xr-x 2 iwdp iwdp 95 Mar 31 15:34 phoenix
drwxrwxr-x 2 iwdp iwdp 4096 Mar 31 15:34 repodata
drwxr-xr-x 2 iwdp iwdp 4096 Mar 18 17:37 spark
drwxr-xr-x 3 iwdp iwdp 61 Mar 23 16:58 tez
drwxrwxr-x 2 iwdp iwdp 78 Mar 29 09:56 wdp-agent
drwxrwxr-x 2 iwdp iwdp 241 Mar 19 14:36 wdp-metrics
-rw-r--r-- 1 iwdp iwdp 97 Mar 15 15:57 wdp.repo
drwxr-xr-x 2 iwdp iwdp 45 Mar 9 16:31 wdp-select
drwxrwxr-x 2 iwdp iwdp 120 Mar 29 09:53 wdp-server
drwxr-xr-x 2 iwdp iwdp 101 Mar 22 19:24 zookeeper
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
然后createrepo:
cd /var/www/html/WDP/centos7/develop
createrepo /var/www/html/WDP/centos7/develop
2
访问私库地址:
# 配置WDP节点的库地址
配置yum库的地址
cd /etc/yum.repos.d/
vi wdp.repo
2
内容如下:
Baseurl根据仓库地址进行调整;
注意这里的baseurl记得跟前端的登陆验证版本一致;
[WDP]
name=WDP
#目前release默认的都是cookie验证版本;
#baseurl=http://10.45.xxx.116:58888/files/wdp/1.1-release/1.1-release
#token验证版本;
baseurl=http://10.45.xxx.116:58888/files/wdp/1.1.1-dev
gpgcheck=0
enabled=1
priority=1
2
3
4
5
6
7
8
9
注意需要设置 gpgcheck=0
基础仓库 : base.repo
[Base]
name=Base
baseurl=http://10.45.xxx.116:58888/files/wdp/thirdparty/centos7-base/centos7-base/
gpgcheck=0
enabled=1
priority=1
2
3
4
5
6
mysql仓库: mysql.repo
[MYSQL]
name=mysql
baseurl=http://10.45.xxx.116:58888/files/wdp/1.0-release/mysql-5.7.35/
gpgcheck=0
enabled=1
priority=1
2
3
4
5
6
# 安装和配置mysql
由于WDP的管理器 wdp-server和hive的元数据需要存储在关系数据库中,这里使用mysql作为关系数据库存储元数据。所以需要先进行mysql的安装和配置:
# 安装mysql
#wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
#yum install mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server
2
3
修改相应的配置
vi /etc/my.cnf
添加:
skip-grant-tables
character_set_server=utf8
init_connect='SET NAMES utf8'
lower_case_table_names=1
2
3
4
启动:
systemctl start mysqld.service
设置密码:
mysql
flush privileges;
update mysql.user set authentication_string=password('Pass-xxx') where user='root';
flush privileges;
#mysql 8.0
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Pass-xxx';
2
3
4
5
6
7
关闭:
systemctl stop mysqld.service
修改完毕密码后,需要把免密码认证取消:
vi /etc/my.cnf
#skip-grant-tables这一行注释掉
skip-grant-tables
character_set_server=utf8
init_connect='SET NAMES utf8'
lower_case_table_names=1
2
3
4
5
启动:
systemctl start mysqld.service
允许远程:
mysql -uroot -pPass-xxx
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pass-xxx');
grant all privileges on *.* to 'root'@'%' identified by 'Pass-xxx' with grant option;
grant all privileges on *.* to 'root'@'localhost' identified by 'Pass-xxx' with grant option;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'vhost-118-21' identified by 'Pass-xxx' with grant option;
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.45.xx.61' identified by 'Pass-xxx' with grant option;
flush privileges;
#Mysql 8.0 :
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'Pass-xxx' WITH GRANT OPTION;
CREATE USER 'user1'@'%' IDENTIFIED BY 'Pass-xxx';
flush privileges;
use mysql;
update user set host = '%' where user = 'root';
ALTER USER 'root'@'%' IDENTIFIED BY 'Pass-xxx' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Pass-xxx';
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
开机自动启动
systemctl enable mysqld.service
# 数据库相关用户的创建
创建 wdp/hive 用户以及相关的库:
CREATE USER 'wdp'@'%' IDENTIFIED BY 'Pass-xxx';
GRANT ALL PRIVILEGES ON *.* TO 'wdp'@'%';
CREATE USER 'wdp'@'localhost' IDENTIFIED BY 'Pass-xxx';
GRANT ALL PRIVILEGES ON *.* TO 'wdp'@'localhost';
CREATE USER 'wdp'@'[主机名请替换]' IDENTIFIED BY 'Pass-xxx';
GRANT ALL PRIVILEGES ON *.* TO 'wdp'@'[主机名请替换]';
FLUSH PRIVILEGES;
#安装hive组件相关初始化表;
CREATE USER 'hive'@'%' IDENTIFIED BY 'Pass-xxx-hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
CREATE USER 'hive'@'localhost' IDENTIFIED BY 'Pass-xxx-hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
CREATE USER 'hive'@'[主机名请替换]' IDENTIFIED BY 'Pass-xxx-hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'[主机名请替换]';
FLUSH PRIVILEGES;
#ranger组件相关,目前没有用到
CREATE USER 'ranger'@'%' IDENTIFIED BY 'Pass-xxx-ranger';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
CREATE USER 'ranger'@'localhost' IDENTIFIED BY 'Pass-xxx-ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost';
CREATE USER 'ranger'@'[主机名请替换]' IDENTIFIED BY 'Pass-xxx-ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'[主机名请替换]';
FLUSH PRIVILEGES;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
用户进入创建库:
mysql -uhive -pPass-xxx-hive
CREATE DATABASE hive;
2
3
开机自动启动
systemctl enable mysqld.service
# 启动服务和安装软件
# 安装软件
# 每台主机安装jdk
yum install jdk -y
vi /etc/profile
#在最后一行插入
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_241
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
#通过source命令重新加载/etc/profile文件,使得修改后的内容在当前shell窗口有效:
source /etc/profile
#注:jdk安装路径为:/usr/lib/jvm/jdk1.8.0_241
2
3
4
5
6
7
8
9
10
# 通过yum安装wdp-server
【常用】
yum install wdp-server -y
# 开发模式可以安装指定的包;否则采用新源
# yum install http://10.45.xxx.116:58888/files/wdp/1.1.1-release/wdp-server-1.0-1.x86_64.rpm --nodeps --force
# rpm -ivh http://10.45.xxx.116:58888/files/wdp/1.1-release/1.1-release-en/wdp-server-1.0-1.x86_64.rpm --nodeps --force
2
3
4
# 数据库脚本导入 【常用】
将安装了wdp-server的服务器的
#/var/lib/wdp-server/resources/Wdp-DDL-MySQL-CREATE.sql 文件拷贝到安装了mysql的服务器:/root/Wdp-DDL-MySQL-CREATE.sql;
# cp /var/lib/wdp-server/resources/Wdp-DDL-MySQL-CREATE.sql /root/Wdp-DDL-MySQL-CREATE.sql
2
3
导入脚本信息:
mysql -u root -pPass-xxx
create database wdp;
use wdp;
#source /root/Wdp-DDL-MySQL-CREATE.sql;
source /var/lib/wdp-server/resources/Wdp-DDL-MySQL-CREATE.sql;
exit;
2
3
4
5
6
# 命令行设置
进入到wdp-server的主机,进行如下设置:
vi /var/lib/wdp-server/resources/template-for-installing-wdp.txt
进行如下修改:
JAVA_HOME=/usr/lib/jvm/jdk1.8.0_241
mysql_hostname_ip=vhost-118-24
mysql_port=3306
mysql_database_name=wdp
mysql_username=root
mysql_password=Pass-xxx
2
3
4
5
6
修改完之后,执行设置命令:
wdp-install.sh /var/lib/wdp-server/resources/template-for-installing-wdp.txt
#报错则执行下面的,再执行;
yum install -y postgresql-server
wdp-install.sh /var/lib/wdp-server/resources/template-for-installing-wdp.txt
2
3
4
5
初始化hive jdbc设置
wdp-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.27.jar
#mysql 8.0
wdp-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-8.0.22.jar
2
3
# LIECNES替换
后端版本,新版本1.1.1才支持cpu的License,原理的是服务器ip生产License;
注册地址 (opens new window), 目前通过服务器ip(mysql数据库的ip)生成license; 放license到目录:记得项目中公钥和私钥要对应上;
- public.key
- wdp.license
可以借助http,再通过wget下载;
cd /etc/wdp-server/conf/
wget http://10.45.xxx.116:58888/files/wdp/jks/license/public.key
wget http://10.45.xxx.116:58888/files/wdp/jks/license/wdp.license
2
3
内部测试阶段,统一一起生成签名,便于测试使用;对应的项目的公钥和私钥要一样处理;
# 服务启动
前面的设置完毕后,执行命令行启动wdp
wdp-server start
[root@host151-133 yum.repos.d]# wdp-server start
Using python /usr/bin/python
Starting wdp-server
Wdp Server running with administrator privileges.
Organizing resource files at /var/lib/wdp-server/resources...
WARNING: Multiple versions of mysql-connector-java.jar found in java class path (/usr/share/java/mysql-connector-java-5.1.27.jar and /usr/lib/wdp-server/mysql-connector-java-5.1.27.jar).
Make sure that you include only one mysql-connector-java.jar in the java class path '/etc/wdp-server/conf:/usr/lib/wdp-server/*:/usr/share/java/mysql-connector-java-5.1.27.jar:/usr/share/java/mysql-connector-java.jar'.
Wdp database consistency check started...
Server PID at: /var/run/wdp-server/wdp-server.pid
Server out at: /var/log/wdp-server/wdp-server.out
Server log at: /var/log/wdp-server/wdp-server.log
Waiting for server start..................
Server started listening on 8080
DB configs consistency check: no errors and warnings were found.
Wdp Server 'start' completed successfully.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
然后通过访问8080端口,进行WDP的集群配置
初始用户密码: adminxx/xxx
如果报错提示;以下提示错误;得挺住wdp-server; 修改license再次启动;
wdp-server stop
wget http://10.45.xxx.116:58888/files/wdp/jks/license/wdp.license.33
mv wdp.license wdp.license.old
mv wdp.license.33 wdp.license
wdp-server start
2
3
4
5
6
检查前端版本,发现前端版本不是最新的,单独更新前端:
wget http://10.45.xx.116:58888/files/wdp/web/getWeb.sh
sh getWeb.sh
#检查前端版本
curl localhost:8080/version.json
{
"version":{
"curBranch": "1.2.0",
"commitID": "d4a6a5b",
"commitTime": "2022-04-29 18:00:43 +0800"
},
"buildCfg":{
"buildTime": "2022-04-29 18:01:29",
"envName":".env.default",
"isPro":true,
"defaultLang":"zh",
"isHideLang":false,
"isTokenAuth":true
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 卸载重装wdp-server
有时候要单独更新后端服务,可以直接卸载再重新安装;重复上面的安装软件,再出事后脚本启动;
# 卸载
[root@host151-133 yum.repos.d]# yum remove wdp-server
已加载插件:fastestmirror
正在解决依赖关系
--> 正在检查事务
---> 软件包 wdp-server.x86_64.0.1.0-1 将被 删除
--> 解决依赖关系完成
依赖关系解决
====================================================================================================================================
Package 架构 版本 源 大小
====================================================================================================================================
正在删除:
wdp-server x86_64 1.0-1 @WDP 362 M
事务概要
====================================================================================================================================
移除 1 软件包
安装大小:362 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在删除 : wdp-server-1.0-1.x86_64 1/1
验证中 : wdp-server-1.0-1.x86_64 1/1
删除:
wdp-server.x86_64 0:1.0-1
完毕!
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 安装【要点】
重复上面的步骤;
yum install wdp-server -y
#yum install http://10.45.xxx.116:58888/files/wdp/test/wdp-server-1.0-1.x86_64.rpm --nodeps --force
mysql -u root -pPass-xxx
create database wdp;
use wdp;
source /var/lib/wdp-server/resources/Wdp-DDL-MySQL-CREATE.sql;
exit;
vi /var/lib/wdp-server/resources/template-for-installing-wdp.txt
JAVA_HOME=/usr/lib/jvm/jdk1.8.0_241
#可能要真实ip
mysql_hostname_ip=vhost-118-24
mysql_port=3306
mysql_database_name=wdp
mysql_username=root
mysql_password=Pass-xxx
wdp-install.sh /var/lib/wdp-server/resources/template-for-installing-wdp.txt
wdp-server start
#更新license
cd /etc/wdp-server/conf && mv public.key public.key.old && mv wdp.license wdp.license.old
wget http://10.45.xxx.116:58888/files/wdp/jks/license/public.key
wget http://10.45.xxx.116:58888/files/wdp/jks/license/wdp.license
wdp-server restart
#更新前端
rm -rf installWeb.sh && wget http://10.45.xx.116:58888/files/wdp/jsk/web/installWeb.sh && sh installWeb.sh
#检查前端版本
curl localhost:8080/version.json
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 封装成脚本installServer.sh
#!/bin/bash
yum remove -y wdp-server && yum install -y wdp-server
mysql -uroot -pPass-xxx -e "
create database wdp;
use wdp;
source /var/lib/wdp-server/resources/Wdp-DDL-MySQL-CREATE.sql;
exit;
"
templateCfg=/var/lib/wdp-server/resources/template-for-installing-wdp.txt
localIp=$(ifconfig | grep '\<inet\>'| grep -v '127.0.0.1' | awk '{ print $2}' | awk 'NR==1')
sed -i "s/mysql_hostname_ip=10.45.47.68/mysql_hostname_ip=$localIp/g" $templateCfg
#sed -i 's/mysql_hostname_ip=10.45.47.68/mysql_hostname_ip=127.0.0.1/g' $templateCfg
sed -i 's/mysql_database_name=wdp_data/mysql_database_name=wdp/g' $templateCfg
sed -i 's/mysql_password=Pass-xxx/mysql_password=Pass-xxx/g' $templateCfg
wdp-install.sh $templateCfg
baseHttp=http://10.45.xx.116:58888/files/wdp/jks
#更新license
cd /etc/wdp-server/conf && mv -f public.key public.key.old && mv -f wdp.license wdp.license.old
wget $baseHttp/license/public.key && wget $baseHttp/license/wdp.license
wdp-server restart
#tail -n 100 -f /var/log/wdp-server/wdp-server.log
#更新前端
#cd /srv && rm -rf installWeb.sh && wget $baseHttp/web/installWeb.sh && sh installWeb.sh
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 安装使用【推荐】
再封装前后端,调用使用;installServerWeb.sh
#!/bin/bash
baseHttp=http://10.45.xx.116:58888/files/wdp/jks
cd /srv && rm -rf installWeb.sh installServer.sh
#后端
wget $baseHttp/server/installServer.sh && sh installServer.sh
#前端
wget $baseHttp/web/installWeb.sh && sh installWeb.sh
#统一
#cd /srv && rm -rf installWeb.sh installServer.sh && wget http://10.45.xx.116:58888/files/wdp/jks/server/installServer.sh && sh installServer.sh && wget http://10.45.xx.116:58888/files/wdp/jks/web/installWeb.sh && sh installWeb.sh
2
3
4
5
6
7
8
9
10
使用:
#单独安装server
cd /srv && rm -rf installServer.sh && wget http://10.45.xx.116:58888/files/wdp/jks/server/installServer.sh && sh installServer.sh
#单独更新web
cd /srv && rm -rf installWeb.sh && wget http://10.45.xx.116:58888/files/wdp/jks/web/installWeb.sh && sh installWeb.sh
#前后端一起更新
cd /srv && rm -rf installServerWeb.sh && wget http://10.45.xx.116:58888/files/wdp/jks/installServerWeb.sh && sh installServerWeb.sh
2
3
4
5
6
7
# 完全卸载
脚本操作参考,wdp-install
项目中的脚本;
# 集群配置
# 向导配置
设定集群名称
填写WDP软件的私有仓库地址,并且勾选 Skip Repository Base; 跟/etc/yum.repos.d/wdp.repo
中的baseurl一致;
填写需要安装的主机列表:
填写 ambari 节点的ssh密钥信息
开始安装:
选择安装软件包: 内部简单测试话优先安装YARN+MR
,Tez
,HBase
,Zookeeper
填写hive元数据对于的mysql的用户密码:(hive123xxxx)
设定HIVE的元数据是已有的mysql
填写datanode,namenode磁盘目录信息。
如果有多个磁盘目录,使用逗号隔开
账号信息一般选择默认即可:
资源信息参考后面的章节:
# hdfs,yarn,hbase,hive,spark,llap
Hive要设置数据库,Ranger要配置相关很多;其他组件还好;
# 参数调整
优先安装
YARN+MR
,Tez
,HBase
,Zookeeper
# HDFS参数调整
Namenode 内存:
内存跟文件数量相关
一个文件大概需要150个字节,1亿个文件大概需要15G
Datanode 内存:
一般配置2-4G即可
# YARN参数调整
YARN参数主要是涉及到资源的配置
每个物理节点上的内存分配给yarn的可支配空间
建议分配65%给yarn使用。如果节点还部署了hbase等其他占用内存的应用,这个值应该确保不会超过节点的物理内存限制。
YARN容器建议最小分配内存,这个建议值是1GB
CPU配置:
物理节点上分配给YARN使用的CPU比例,根据实际需要,建议50%或者更多。
容器分配的最小CPU,建议1个
# ZOOKEEPER参数调整
主要调整连接数maxClientCnxns,默认的连接数是60,建议调整到500
需要在Custom zoo.cfg中进行调整
# HBASE参数调整
Master内存调整:
Master只负责元数据等信息的控制,不参与存储和计算,一般设置1GB即可。
Regionserver 内存调整:
Regionserver 提供存取服务,需要配置较多的内存,内存不足会导致频繁GC和性能下降。一般建议配置10GB以上。
读缓存配置,一般建议配置40%
Memstore 刷盘阈值,一般设置128MB
# SPARK参数调整
Spark这里配置的是提供SQL服务器的thriftserver:
一般使用动态资源分配
Custom spark2-thrift-sparkconf
# HIVE参数调整
Tez 容器设置,这个一般设置4G
tez - > Advanced tez-site
tez.runtime.io.sort.mb
这个内存用于排序的,建议配置容器的40%
tez.am.resource.memory.mb
一般配置4GB
HIVESERVER2 内存,建议配置4GB
Metastore 内存,建议配置1GB
# LLAP参数调整
LLAP是常驻的HIVE服务,配置和HIVE类似,值得注意的是和tez相关的配置都在LLAP的配置项中,相同和配置参数和HIVE的配置位置是独立的,HIVE配置的参数不作用于LLAP,反之亦然。
Yarn 启动资源预占
开启LLAP
选择LLAP队列
设定LLAP守护进程的资源配置,注意这个资源的配置应该在LLAP队列的限制范围内
总体VCORE = 节点数*节点核心
总体内存 = 节点数*节点内存
节点数,下图配置是2
节点内存,下图配置和是60G
节点核心,下图配置是18
这里使用了总体CPU vCores = 2*18 = 36
总体的YARN内存 2*60G = 120G
另外还需要设置JVM的大小和缓存参数
进入 Advance hive-interactive-env 需要调整 LLAP Daemon Heap Size和 LLAP Daemon Container Max Headroom
必须确保
HeapSize+Headroom+Cache <= Memory per Deamon
也就是说 JVM程序+缓存+剩余空间 < yarn容器大小
一般按照这个分配原则:
HeapSize = Memory per Deamon * 80%
Headroom = Memory per Deamon * 10%
Cache = Memory per Deamon * 10%
tez.am.resource.memory.mb 这个参数在hive页面的Advance tez-interactive-site中
建议配置4G
tez.runtime.io.sort.mb, 也是在hive页面的Advance tez-interactive-site中
建议配置JVM的10%左右