CDH6.3.2
一、基本介绍
基于最新CDH发布版本编写安装文档,CDH6安装过程基本与CDH5一致,主要包括以下几步:
1、安装前置准备:包括安装操作系统、关闭防火墙、同步服务器时钟等;
2、mysql安装部署;
3、安装Cloudera Manager;
4、安装CDH集群;
软件要求:
CDH 集群搭建需要的安装包包括 JDK、Cloudera-Manager RPM 包(3 个),CDH parcel⽂件(3 个)、MySQL、MySQL 驱动 jar 包。
组件 | 版本 | 类型 | 备注 |
---|---|---|---|
JDK | 8u202 | tar | jdk-8u202-linux-x64.tar.gz |
CM daemons | 6.3.1 | rpm | cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm |
CM agent | 6.3.1 | rpm | cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm |
CM server | 6.3.1 | rpm | cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm |
CDH 各组件⼆ 进制服务包 | 6.3.2 | parcel | CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel、CDH-6.3.2-1.cdh6.3.2.p0.1605554-el7.parcel.sha1、manifest.json |
MySQL | 8.0.18 | tar | mysql-8.0.18-el7-x86_64.tar.gz |
MySQL驱动包 | 8.0.18 | jar | mysql-connector-java-8.0.18.jar |
节点分布:
CM Server 和 Agent 分配 Cloudera Manager 由 Server 和 Agent 组成,安装 Cloudera Manager Server 的节点称为 Server 节点,安装 Cloudera Manager Agent 的节点称为 Agent 节点。
3个节点的情形
节点 | 安装的服务 |
---|---|
node1 | CM daemon,CM server,CM agent |
node2 | CM daemon,CM agent |
node3 | CM daemon,CM agent |
二、安装前置准备
没有出现其他节点主机名的话,说明每个节点都是需要执行的。
2.1 hosts及hostname
rehl7修改主机名使用hostnamectl命令
#节点一
[root@hadoop-1 ~]# hostnamectl set-hostname hadoop-1
#节点二
[root@hadoop-2 ~]# hostnamectl set-hostname hadoop-2
#节点三
[root@hadoop-3 ~]# hostnamectl set-hostname hadoop-3
修改/etc/hosts(每个节点都执行)
[root@hadoop-1 ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#集群节点地址 集群主机名
172.15.10.145 hadoop-1
172.15.10.146 hadoop-2
172.15.10.147 hadoop-3
2.2 禁用selinux并关闭防火墙
[root@hadoop-1 ~]# vim /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 values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
-------------------------------------------------------------------------------------------------------------------
[root@hadoop-1 ~]# systemctl stop firewalld.service
[root@hadoop-1 ~]# systemctl disable firewalld.service
2.3 系统参数修改
swap空间设置
[root@hadoop-1 ~]# echo "vm.swappiness = 0" >> /etc/sysctl.conf
[root@hadoop-1 ~]# sysctl -p
设置透明大页面
[root@hadoop-1 ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
[root@hadoop-1 ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
增⼤系统打开⽂件数
[root@hadoop-1 ~]# vim /etc/security/limits.conf
#末尾加上
* - nofile 100000
* - nproc 100000
hadoop soft memlock unlimited
hadoop hard memlock unlimited
2.4 ssh免密认证
[root@hadoop-1 ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
[root@hadoop-1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@hadoop-1
[root@hadoop-1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@hadoop-2
[root@hadoop-1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@hadoop-3
#验证方式,ssh hostname,直接连接上了说明配置成功
[root@hadoop-1 ~]# ssh hadoop-2
2.5 安装并启动Apache http
在主节点执行
#安装Apache http
[root@hadoop-1 ~]# yum install -y httpd
#启动Apache http
[root@hadoop-1 cdh]# systemctl start httpd
#设置开机启动Apache http
[root@hadoop-1 cdh]# systemctl enable httpd
#创建安装文件http根目录
[root@hadoop-1 cdh]# mkdir -p /var/www/html/cm6
[root@hadoop-1 cdh]# mkdir -p /var/www/html/cdh6
[root@hadoop-1 cdh]# cd /usr/local/src/cdh/
#上传安装文件到http根目录
[root@hadoop-1 cdh]# cp allkeys.asc *.rpm /var/www/html/cm6
[root@hadoop-1 cdh]# ll /var/www/html/cm6
total 1199784
-rw-r--r-- 1 root root 14041 Jan 22 00:06 allkeys.asc
-rw-r--r-- 1 root root 10483568 Jan 22 00:06 cloudera-manager-agent-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 1203832464 Jan 22 00:06 cloudera-manager-daemons-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 11488 Jan 22 00:06 cloudera-manager-server-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 10996 Jan 22 00:06 cloudera-manager-server-db-2-6.3.1-1466458.el7.x86_64.rpm
-rw-r--r-- 1 root root 14209868 Jan 22 00:06 enterprise-debuginfo-6.3.1-1466458.el7.x86_64.rpm
#创建yum仓库
[root@hadoop-1 cdh]# cd /var/www/html/cm6
[root@hadoop-1 cm6]# yum install -y createrepo
[root@hadoop-1 cm6]# createrepo .
2.6 yum源设置
yum源设置有多种方式,无网络可以采用镜像挂载,有网络可以直接用清华源、阿里源等等,此处不做展开,自行百度。这里介绍下本地挂载的方式。
[root@hadoop-1 ~]# vim /etc/yum.repos.d/rhel7.repo
[base]
name=rhel7
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
[root@hadoop-1 ~]# mkdir -p /media/cdrom
[root@hadoop-1 ~]# mount /dev/cdrom /media/cdrom
mount: /media/cdrom: WARNING: device write-protected, mounted read-only.
-------------------------------------------------------------------------------------------------------------------
#挂载自建镜像
[root@hadoop-1 cm6]# vim /etc/yum.repos.d/cloudera-manager.repo
[cloudera-manager]
name=Cloudera Manager 6.3.1
baseurl=http://hadoop-1/cm6
gpgcheck=0
enabled=1
autorefresh=0
type