标签:
1、集群规划
说明:由于CDH管理集群很方便,可以动态添加删除主机,动态改变主机主机上的服务,动态监控服务状态;
1)、主机准备:windows宿主机或linux桌面版宿主机或苹果宿主机(本人使用的debian+xfce桌面作为自己的宿主机)
2)、虚拟机软件准备:使用VMware Workstation12 pro
3)、虚拟机系统:centos 6.5
4)、机器规划:hadoopmaster、hadoopslave01、hadoopslave02、hadoopslave(作为基础镜像使用)
例如:
注意:所有的虚拟机的账号密码都是统一的,意思就是说分布式看成一个主机
5)、hadooopmaster 运行 Cloudera Manager
2、资源准备:
1)、下载postgresql分别:http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/repoview/
postgresql84-8.4.22-1PGDG.rhel6.x86_64.rpm
postgresql84-libs-8.4.22-1PGDG.rhel6.x86_64.rpm
postgresql84-server-8.4.22-1PGDG.rhel6.x86_64.rpm
2)、下载最新版本的cm资源包压缩包:http://archive-primary.cloudera.com/cm5/repo-as-tarball/5.7.1/
注意:根据自己的虚拟机下载对应版本的cm,注意cm一定要是最新版本;
3)、下载最新版本的cm安装包程序:http://archive.cloudera.com/cm5/installer/latest/
4)、安装hadoop、hivingsql、hbase等分布式生态系统软件:http://archive.cloudera.com/cdh5/parcels/5.7.1/
注意:分别下载截图中的文件
3、虚拟机配置所有的机器都需要的配置
1)、修改主机名:vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoopmaster
2)、修改hosts文件:vi /etc/hosts
#host
192.168.240.129 hadoopmaster
192.168.240.130 hadoopslave01
192.168.240.134 hadoopslave02
#192.168.240.129 archive.cloudera.com
3)、设置固定IP,根据自己的需求设置:vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth1"
BOOTPROTO="static"
HWADDR="00:50:56:34:61:2E"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
#UUID="6d6002f2-4f52-49ef-bb07-e2b54637cafb"
IPADDR=192.168.240.134
NETMASK=255.255.255.0
GATEWAY=192.168.240.2
DNS1=192.168.240.2
4)、重启网络服务:service network restart
4、关机防火墙 和 SELinux
1)、关闭防火墙
service iptables stop (临时关闭防火墙)
chkconfig iptables off (重启后生效)
2)、关闭SELinux
setenforce 0 (临时设置selinux)
vi /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 these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
5、集群间服务器使用无密码ssh登陆,再次提醒各个集群中的主机最好使用统一的账号密码
1)、hadoopmaster主机
ssh-keygen -t rsa (一直按回车即可)
ssh-copy-id -i localhost
ssh-copy-id -i hadoopmaster
ssh-copy-id -i hadoopslave01
ssh-copy-id -i hadoopslave02
2)、hadoopslave01主机
ssh-keygen -t rsa (一直按回车即可)
ssh-copy-id -i localhost
ssh-copy-id -i hadoopmaster
ssh-copy-id -i hadoopslave01
3)、hadoopslave02主机
ssh-keygen -t rsa (一直按回车即可)
ssh-copy-id -i localhost
ssh-copy-id -i hadoopmaster
ssh-copy-id -i hadoopslave02
6、建立cm资源服务器——安装Apache httpd web服务器
1)、检查httpd服务是否安装:service httpd status
如果没有安装:yum install -y httpd
yum install -y httpd #安装httpd
service httpd start #启动命令
service httpd stop #关闭命令
service httpd restart #重启命令
service httpd status #查看服务状态
chkconfig httpd on #将httpd加入到启动列表
7、选择hadoopmaster作为cm的资源服务器发布cm
[root@localhost hadoopmaster]# pwd
/home/hadoop/hadoopmaster
[root@localhost hadoopmaster]# ll
total 529076
-rw-r--r--. 1 root root 541768507 Jun 14 09:14 cm5.7.1-centos6.tar.gz
[root@localhost hadoopmaster]# tar -zxvf cm5.7.1-centos6.tar.gz
cm/
cm/hadoopmaster-manager.repo
cm/5
cm/5.7.1/
cm/5.7.1/mirrors
cm/5.7.1/repodata/
cm/5.7.1/repodata/other.xml.gz.asc
cm/5.7.1/repodata/filelists.xml.gz
cm/5.7.1/repodata/primary.xml.gz.asc
cm/5.7.1/repodata/repomd.xml
cm/5.7.1/repodata/other.xml.gz
cm/5.7.1/repodata/repomd.xml.asc
cm/5.7.1/repodata/primary.xml.gz
cm/5.7.1/repodata/filelists.xml.gz.asc
cm/5.7.1/RPMS/
cm/5.7.1/RPMS/x86_64/
cm/5.7.1/RPMS/x86_64/hadoopmaster-manager-daemons-5.7.1-1.cm502.p0.297.el6.x86_64.rpm
cm/5.7.1/RPMS/x86_64/enterprise-debuginfo-5.7.1-1.cm502.p0.297.el6.x86_64.rpm
cm/5.7.1/RPMS/x86_64/hadoopmaster-manager-server-db-2-5.7.1-1.cm502.p0.297.el6.x86_64.rpm
cm/5.7.1/RPMS/x86_64/hadoopmaster-manager-server-5.7.1-1.cm502.p0.297.el6.x86_64.rpm
cm/5.7.1/RPMS/x86_64/hadoopmaster-manager-agent-5.7.1-1.cm502.p0.297.el6.x86_64.rpm
cm/5.7.1/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update45-1.x86_64.rpm
cm/5.7.1/RPMS/x86_64/jdk-6u31-linux-amd64.rpm
cm/5.7.1/RPMS/noarch/
cm/RPM-GPG-KEY-hadoopmaster
[root@localhost hadoopmaster]# ll
total 529080
drwxrwxr-x. 3 1106 592 4096 Jun 11 11:08 cm
-rw-r--r--. 1 root root 541768507 Jun 14 09:14 cm5.7.1-centos6.tar.gz
[root@localhost hadoopmaster]#
——移动加压后的cm文件夹到web目录,并设置权限
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# mkdir -p cm5/redhat/6/x86_64
[root@localhost html]# cd cm5/redhat/6/x86_64
[root@localhost x86_64]# mv /home/soft/cloudera/cm .
[root@localhost x86_64]# chmod -R ugo+rX cm
——设置完成后访问下地址:http://hadoopmaster/cm5/redhat/6/x86_64/cm/
8、安装Cloudera Manager 5
1)、安装postgresql
是否安装postgresql:rpm -qa|grep postgres,如果已经安装,但版本小于8.4,则使用rpm -e卸载。
[root@localhost postgresql84]# rpm -ivh postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
warning: postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ########################################### [100%]
1:postgresql84-libs ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm
warning: postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ########################################### [100%]
1:postgresql84 ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm
warning: postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing... ########################################### [100%]
1:postgresql84-server ########################################### [100%]
[root@localhost postgresql84]#
2)、修改安装cm的客户端的配置
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/Centos-* /home/hadoop/soft/
vi /etc/yum.repos.d/myrepo.repo
[myrepo]
name=myrepo
baseurl=http://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5/
enabled=1
gpgcheck=0
vi /etc/hosts
#host
192.168.240.129 hadoopmaster
192.168.240.130 hadoopslave01
192.168.240.134 hadoopslave02
192.168.240.129 archive.cloudera.com
3)、安装CM5
[root@localhost cloudera]# chmod +x cloudera-manager-installer.bin
[root@localhost cloudera]# ./cloudera-manager-installer.bin
注意:查看安装过程日志:/var/log/cloudera-manager-installer/
4)、安装过程中截图
a、安装过程比较漫长,耐心等地
b、安装完成,查看安装地址:http://192.168.240.134:7180/
c、登陆界面,默认账号:admin 密码:admin
d、同意条款
e、选择免费版——cloudera manager express
f、设置ip端,例如:192.168.240.[1-255] ,然后点击搜索
g、选择主机节点
9、集群安装hadoop、hivingsql、hbase、spark、storm等,即CDH
1)、安装cdh
a、集群安装
b、使用”更多选项“使用”本地 Parcel 存储库路径“,位置:/opt/cloudera/parcel-repo
注意(每台机器执行):yum install -y portmap python-psycopg2 cyrus-sasl-gssapi mod_ssl openssl-devel MySQL-python
1)、将前面下载的CDH parcels文件放到 /opt/cloudera/parcel-repo 目录下
[root@hadoopmaster parcel-repo]# mv /home/hadoop/Documents/parcel/* ./
[root@hadoopmaster parcel-repo]# ls
CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel manifest.json
CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel.sha1
2)、生成对应的sha文件
manifest.json 文件中按照版本“CDH-5.7.1-1.cdh5.7.1.p0.53-el6.parcel” -(根据自己的版本选定) 找到对应的 hash值
"hash": "67fc4c86b260eeba15c339f1ec6be3b59b4ebe30"
3)、hash值保存在sha文件中
echo '67fc4c86b260eeba15c339f1ec6be3b59b4ebe30'>CDH-5.1.0-1.cdh5.1.0.p0.53-el6.parcel.sha 根据自己的版本定
[root@hadoopmaster parcel-repo]# ls
CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel manifest.json
CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel.sha1
[root@hadoopmaster parcel-repo]# echo 'e24f56882ecdcf6837636abc8298c629c0f9d109' > CDH-5.7.1-1.cdh5.7.1.p0.11-el6.parcel.sha1
2)、验证
根据自己的使用情况进行验证;
文章摘自: http://blog.csdn.net/feixeyes/article/details/38084403
http://blog.csdn.net/yhl27/article/details/37726639
标签:
原文地址:http://www.cnblogs.com/linuxone/p/5577035.html