1、准备工作:
1.1 防火墙关闭,ip地址修改
1.2 主机名修改:vi /etc/sysconfig/network 修改以后重启
如果主机名为namenode,datanode1,2,3则下面命令可以直接复制
Vi etc/hosts
192.168.253.37 namenode
192.168.253.38 datanode1
192.168.253.39 datanode2
192.168.253.40 datanode3
1.3 ssh
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys root@datanode1:~/.ssh/
scp ~/.ssh/authorized_keys root@datanode2:~/.ssh/
scp ~/.ssh/authorized_keys root@datanode3:~/.ssh/
[root@namenode ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
44:7a:a3:e8:a5:97:44:a7:25:67:5c:1a:4b:d1:ea:73 root@namenode
The key's randomart image is:
+--[ RSA 2048]----+
| =o. |
| = =. |
| + %. |
| o @.. |
| . =.S |
| . + .o E |
| o o o |
| . |
| |
+-----------------+
[root@namenode ~]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[root@namenode ~]# scp ~/.ssh/authorized_keys root@datanode1:~/.ssh/
The authenticity of host 'datanode1 (192.168.253.38)' can't be established.
RSA key fingerprint is 9b:1b:8d:0a:8f:fb:d2:15:f8:36:5e:be:71:43:50:35.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'datanode1,192.168.253.38' (RSA) to the list of known hosts.
root@datanode1's password:
authorized_keys 100% 395 0.4KB/s 00:00
[root@namenode ~]# scp ~/.ssh/authorized_keys root@datanode2:~/.ssh/
The authenticity of host 'datanode2 (192.168.253.39)' can't be established.
RSA key fingerprint is 9b:1b:8d:0a:8f:fb:d2:15:f8:36:5e:be:71:43:50:35.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'datanode2,192.168.253.39' (RSA) to the list of known hosts.
root@datanode2's password:
authorized_keys 100% 395 0.4KB/s 00:00
[root@namenode ~]# scp ~/.ssh/authorized_keys root@datanode3:~/.ssh/
The authenticity of host 'datanode3 (192.168.253.40)' can't be established.
RSA key fingerprint is 9b:1b:8d:0a:8f:fb:d2:15:f8:36:5e:be:71:43:50:35.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'datanode3,192.168.253.40' (RSA) to the list of known hosts.
root@datanode3's password:
authorized_keys 100% 395 0.4KB/s 00:00
[root@namenode ~]# scp /etc/hosts root@datanode1:/etc/hosts
hosts 100% 258 0.3KB/s 00:00
[root@namenode ~]# scp /etc/hosts root@datanode2:/etc/hosts
hosts 100% 258 0.3KB/s 00:00
[root@namenode ~]# scp /etc/hosts root@datanode3:/etc/hosts
hosts 100% 258 0.3KB/s 00:00
[root@namenode ~]#
[root@namenode Desktop]# cd /mnt/hgfs/N 切换到事先下载好的文件所在的目录
以下操作每台机器都去执行一遍
1.4 JDK安装
[root@namenode N]# rpm -ivh oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm
warning: oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID e8f86acd: NOKEY
Preparing... ########################################### [100%]
1:oracle-j2sdk1.7 ########################################### [100%]
1.5 daemons的安装
主要是因为他比较大,所以单独拿出来安装
[root@namenode N]# rpm -ivh cloudera-manager-daemons-5.4.1-1.cm541.p0.197.el6.x86_64.rpm
warning: cloudera-manager-daemons-5.4.1-1.cm541.p0.197.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID e8f86acd: NOKEY
Preparing... ########################################### [100%]
1:cloudera-manager-daemon########################################### [100%]
1.6 agent放置
可以事先将agent放到指定目录下,这样可以减少下载时间。
cp/mnt/hgfs/N/cloudera-manager-agent-5.4.1-1.cm541.p0.197.el6.x86_64.rpm /var/cache/yum/x86_64/6/cloudera-manager/packages/
1.7agent 安装
yum -y install cloudera-manager-agent 这一步推荐在每台机器上执行成功以后再做其他事情。
说明:主要是cloudera-manager-agent5.4.1这个版本只能在线安装因为涉及到的太多了。
2. 开始安装cloudera manager
2.1开始执行
[root@namenode N]# ./cloudera-manager-installer.bin
按照提示下一步和接受就行。安装完毕就是这样。
进入页面选择免费,然后一直下一步。
这里输入主机名和IP都行。namenode,datanode1,2,3
后面一直默认。
输入密码
等待,取决于网络。在这个等待的过程中,将下载的parcel的文件(一共两个包括sha为后缀的一个文件,下载的时候叫sha1,一定要改成sha才行)和manifest.json复制到/opt/cloudera/parcel-repo下
cp /mnt/hgfs/N/CDH-5.4.2-1.cdh5.4.2.p0.2-el6.parcel* /opt/cloudera/parcel-repo/
cp /mnt/hgfs/N/manifest.json /opt/cloudera/parcel-repo/
2.2parcel复制
这步以后,不要着急点击下一步。先检查刚才复制的文件对不对。然后再继续。
这样就不用去下载parcel了,等待。
安装完毕后有一个检查过程,如果安装前面做的,基本没有问题。最多有如下一个,
这个没有关系,在每台机器上做一下echo 0 > /proc/sys/vm/swappiness 不用重启,重新检查就通过了。
2.3配置各个服务器角色
根据机器性能分配,然后下一步。后面一直下一步。
等待完毕。
2.4对时检查
检查一下主节点ntp情况,然后使得所有节点和主节点对时。安装完毕。
在主节点上 运行命令行输入命令: setup。
找到NTPD的服务选中,保存退出,重启生效。
在其他节点上的命令行中 ntpdate -d 主节点IP(如192.168.1.1)
并且将这句话加入到crontab -e中
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/637517/viewspace-1766833/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/637517/viewspace-1766833/