【直接从word拷贝出来的,格式有点混乱,以后我调整】
一. 环境准备(centos 7,以下内容酌情考虑,根据实际情况配置)
yum install httpd createrepo openssh-clients wget bind-utils -y
rpm -ivh jdk-8u131-linux-x64.rpm
java -version
- 时钟同步
sed -i 's/server 0/#server 0/g' /etc/ntp.conf
sed -i 's/server 1/#server 1/g' /etc/ntp.conf
sed -i 's/server 3.centos.pool.ntp.org iburst/server 10.66.76.11 burst iburst/g' /etc/ntp.conf
sed -i 's/server 2.centos.pool.ntp.org iburst/server 10.66.76.12 burst iburst prefer/g' /etc/ntp.conf
echo "logfile /var/log/ntp.log" >>/etc/ntp.conf
systemctl start ntpd
systemctl enable ntpd
- /etc/hosts
cat >> /etc/hosts << EOF
10.66.221.72 v2-test-cdh01
10.66.221.73 v2-test-cdh02
10.66.221.74 v2-test-cdh03
10.66.221.75 v2-test-cdh04
10.66.221.76 v2-test-cdh05
EOF
- /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=v2-hadoop-5
hostnamectl set-hostname v2-cdh0
- iptabels
systemctl stop iptables.service
chkconfig iptables off
systemctl stop firewalld.service
systemctl disable firewalld.service
- 免密登录
ssh-keygen -t rsa
一路回车,会在/root/.ssh目录下生成id_rsa和id_rsa.pub(公钥)文件
把公钥的内容复制到/root/.ssh/authorized_keys这个文件中,所有想要互访的机器公钥都写入这个文件即可
- 关闭HUGEPAGE
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
cat >> /etc/rc.local << EOF
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
EOF
- 操作系统参数优化
echo "* soft stack 8192" >> /etc/security/limits.conf
echo "* hard stack 8192" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "* soft nproc 65535" >> /etc/security/limits.conf
echo "* hard nproc 65535" >> /etc/security/limits.conf
sysctl -w vm.swappiness=0
echo vm.swappiness = 0 >> /etc/sysctl.conf
二.安装clouderamanager
所有集群机器上执行
cat >> /etc/yum.repos.d/cloudera-manager.repo << EOF
[cloudera-manager]
name = Cloudera Manager, Version 5.10.1
baseurl = http://10.66.221.72/clouderamanager/
gpgcheck = 0
EOF
创建目录
mkdir -p /hbase
mkdir -p /data/dfs/dn1
mkdir -p /data/dfs/dn2
mkdir -p /data/dfs/dn3
mkdir -p /data/dfs/nn
mkdir -p /data/dfs/snn
mkdir -p /data/yarn/nm1
mkdir -p /data/yarn/nm2
mkdir -p /data/yarn/nm3
目录授权
chown -R hdfs.hadoop /data/dfs
chown -R hdfs.hadoop /data/yarn
在namenode上操作
mkdir /var/www/html/clouderamanager
cd /var/www/html/clouderamanager
复制文件到当前目录:
CDH-5.10.1-1.cdh5.10.1.p0.10-el7.parcel
CDH-5.10.1-1.cdh5.10.1.p0.10-el7.parcel.sha1
cloudera-manager-agent-5.10.1-1.cm5101.p0.6.el7.x86_64.rpm
cloudera-manager-daemons-5.10.1-1.cm5101.p0.6.el7.x86_64.rpm
cloudera-manager-installer.bin
cloudera-manager-server-5.10.1-1.cm5101.p0.6.el7.x86_64.rpm
cloudera-manager-server-db-2-5.10.1-1.cm5101.p0.6.el7.x86_64.rpm
enterprise-debuginfo-5.10.1-1.cm5101.p0.6.el7.x86_64.rpm
manifest.json
oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm
执行下面命令
createrepo .
systemctl start httpd.service
cd /var/www/html/clouderamanager/
chmod +x cloudera-manager-installer.bin
./cloudera-manager-installer.bin
一路next ,yes, Ok
安装完成后打开页面http://10.66.221.72:7180/
用户名:admin
密码:admin
需要填写的页面:
选择免费版
填写集群IP:10.66.221.[72-76]
选择存储库—》更多选项:删除所有https://地址,只保留一个填写http://10.66.0.51/ clouderamanager GPGkey删除不填
提供ssh登录凭证:填入root密码
安装检查:需要预先安装好jdk1.8
集群设置—》选择CDH5服务:自定义,勾选HBASE\HDFS\HIVE\MAPREDUCE\YARN\ZOOKEEPER
集群设置—》数据库设置:使用自定义数据库
修改各种目录点击安装