请务必注意CDH6的安装前置条件包括如下:
- 外部数据库支持:
MySQL 5.7或更高
MariaDB 5.5或更高
PostgreSQL 8.4或更高
Oracle 12c或更高
- JDK
Oracle JDK1.8,将不再支持JDK1.7
- 操作系统支持
RHEL 6.8或更高
RHEL 7.2或更高
SLES 12 SP2或更高
Ubuntu 16或更高
- 本次测试环境为
1.CM和CDH版本为6.0.0
2.Redhat 7.6
3.JDK1.8.0_141
4.MariaDB-5.5.56
5.root用户安装
1.前置准备
1.1.hostname及hosts配置
集群中各个节点之间能互相通信使用静态IP地址。IP地址和主机名通过/etc/hosts配置,主机名通过/etc/hostname进行配置。
以cm节点(utility)为例:
- hostname配置
/etc/hostname文件如下:
[root@utility ~]# vi /etc/hostname utility
utility
或者你可以通过命令修改立即生效
[root@utility ~]# hostnamectl set-hostname utility
- hosts配置
/etc/hosts文件如下:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.18.100.116 utility
10.18.100.173 master
10.18.100.174 worker1
10.18.100.175 worker2
10.18.100.176 worker3
以上两步操作,在集群中其它节点做相应配置。
1.2.禁用SELinux
在所有节点执行setenforce 0 命令,此处使用批处理shell执行:
[root@utility ~]# setenforce 0
setenforce: SELinux is disabled
集群所有节点修改/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
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
1.3.关闭防火墙
集群所有节点执行 systemctl stop命令,此处通过shell批量执行命令如下:
[root@utility ~]# systemctl stop firewalld
[root@utility ~]# systemctl disable firewalld
[root@utility ~]# systemctl status firewalld
1.4.集群时钟同步
在Redhat7.x的操作系统上,已经默认的安装了chrony,我们这里先卸载chrony,然后安装ntp。使用ntp来配置各台机器的时钟同步,将cm(10.18.100.116)服务作为本地ntp服务器,其它3台服务器与其保持同步。
1.所有机器卸载chrony
[root@utility ~]# yum -y remove chrony
2.所有机器安装ntp
[root@utility ~]# yum -y install ntp
3.cm机器配置时钟与自己同步
[root@utility ~]# vi /etc/ntp.conf
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
4.集群其它节点,配置找cm机器去同步
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
server 10.18.100.116
5.重启所有机器的ntp服务
[root@utility ~]# systemctl restart ntpd
[root@utility ~]# systemctl status ntpd
6.验证始终同步,在所有节点执行ntpq -p命令,如下使用脚本批量执行
[root@utility ~]# ntpq -p
左边出现*号表示同步成功。
1.5.设置swap
所有节点执行:
[root@utility ~]# echo vm.swappiness = 10 >> /etc/sysctl.conf
1.6.设置透明大页面
所有节点执行:
[root@utility ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
[root@utility ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
设置开机自关闭
将如下脚本添加到/etc/rc.d/rc.local文件中
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugep