CDH5.9.0离线部署

部署环境:win7+vmware11+centos7.2+cdh5.9.0

1) 关闭防火墙

–# firewall-cmd –state
–# systemctl stop firewalld.service
–# systemctl disable firewalld.service
–# vi /etc/selinux/config
SELINUX=disabled ,然后重启

2) 虚拟机IP配置

BOOTPROTO=static
IPADDR=192.168.220.11
NETMASK=255.255.255.0
GATEWAY=192.168.220.1

3) 虚拟机hostname设置

–# vi /etc/hosts
192.168.220.11 cdh01
192.168.220.12 cdh02
192.168.220.13 cdh03
192.168.220.14 cdh04

4) 卸载系统自带的openjdk

–# java –version
–# rpm -qa | grep java
–# rpm -e –nodeps java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64
–# rpm -e –nodeps java-1.8.0-openjdk-headless-1.8.0.71-2.b15.el7_2.x86_64

5) 所有节点安装jdk,并配置环境变量

–# tar -xzvf jdk-7u79-linux-x64.tar.gz -C /usr/local/
–#vi /etc/profile 设置环境变量,添加如下3行内容
export JAVA_HOME=/usr/local/jdk1.7
export CLASSPATH=/usr/local/jdk1.7/lib
export PATH=.: JAVAHOME/bin: PATH
–# source /etc/profile

6) 克隆虚拟机

7) SSH免密码登陆

8) 卸载mariadb数据库

9) 安装mysql数据库(rpm -ivh)

a). mysql-community-common-5.7.18-1.el7.x86_64.rpm
b). mysql-community-libs-5.7.18-1.el7.x86_64.rpm
c). mysql-community-client-5.7.18-1.el7.x86_64.rpm
d). mysql-community-server-5.7.18-1.el7.x86_64.rpm
e). # mysql_install_db –datadir=/var/lib/mysql
f).# chown mysql:mysql /var/lib/mysql –R
g). [root@cdh01 ~] # systemctl start mysqld.service
h). [root@cdh01 ~]# cat /root/.mysql_secret
i). [root@cdh01 ~]# mysql -uroot –p
set password for root@localhost = password(‘123456’);
k). [root@cdh01 ~]# chkconfig mysqld on
l). 创建CDH集群服务所需要的数据库
create database hue DEFAULT CHARACTER SET utf8;
create database amon DEFAULT CHARACTER SET utf8;
create database hive DEFAULT CHARACTER SET utf8;
create database oozie DEFAULT CHARACTER SET utf8;
grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;
mysql> flush privileges;

10) 设置ntp时间服务器

a). 测机是否安装ntp服务,rpm –qa | grep ntp-*
b).centos7默认安装了ntp
c).配置ntp主机
[root@cdh01 ~]# vi /etc/ntp.conf
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
注释掉原来的server.*,添加如上两条
[root@cdh01 ~]# systemctl start ntpd.service
[root@cdh01 ~]# systemctl enable ntpd.service
[root@cdh01 ~]# ntpq -p 验证服务
[root@cdh01 ~]# date -R
d).配置ntp从机
[root@chd02 ~]# vi /etc/ntp.conf
server 192.168.220.11 prefer
注释掉其他server,添加上述server
[root@chd02 ~]# ntpdate cdh01 同步时间

12) CM安装

a). [root@cdh01 Downloads]# tar –xzvf cloudera-manager-centos7-cm5.9.0_x86_64.tar.gz –C /opt
b). 将mysql-connector-java-5.1.39-bin.jar放到/opt/cm-5.9/share/cmf/lib/中
c).初始化数据库
–# /opt/cm-5.9.0/share/cmf/schema/scm_prepare_database.sh mysql scm -hcdh01 -uroot –p123456 –scm-host cdh01 scm scm scm
d). 修改cm server主机名
–# vi /opt/cm-5.9.0/etc/cloudera-scm-agent/config.ini
e). 同步Agent到其他节点
[root@cdh01 ~]# scp -r /opt/cm-5.9.0 root@cdh02:/opt/
f). 创建cloudera-scm用户(所有节点)
[root@cdh01 ~]# useradd –system –home=/opt/cm-5.9.0/run/cloudera-scm-server –no-create-home –shell=/bin/false –comment “Cloudera SCM User” cloudera-scm

13) CDH安装

a). Parcel包放到主节点的/opt/cloudera/parcel-repo/
b).包含3个文件:parcel、sha、json

14) 启动CM

a). cm主节点[root@cdh01 ~]#
/opt/cm-5.9.0/etc/init.d/cloudera-scm-server start;
/opt/cm-5.9.0/etc/init.d/cloudera-scm-agent start;
b). 所有节点[root@cdh01 ~]#
/opt/cm-5.9.0/etc/init.d/cloudera-scm-agent start;
c). 命令还有stop(停止), status(状态), restart(重启)

15) CDH集群配置

打开浏览器,访问cdh01:7180/cmf/login,完成相关配置。

你可能感兴趣的:(hadoop)