Ambari这个东东对操作系统的要求还是很高的,首先限制了要使用CentOS,RHEL,并且还是64bit 的,让我的Ubuntu泪奔啊~~~手头正好有RHEL6.x的盘,于是就用红帽吧。但是红帽是收费的,所以yum源是需要更改一下的。其他的杂七杂八还有一些设置,我就以列表的方式记下来吧。
1 关闭防火墙。selinux,iptables通通关闭。
1: setenfoce 0 关闭SELinux
2:
3: service iptables stop(重启后恢复)
4:
5: chkconfig iptables off(重启后不恢复)
6:
7: nano /etc/sysconfig/selinux修改selinux=disabled
8:
9: 查看是否关闭防火墙:service iptables status
10:
2 同步集群时间。这个是个运气活,我还没搞明白时间中心是怎么工作的,反正有时候就是同步不成功。
1: ntpdate time.nist.gov
如果显示已经有进程什么的在运行,就用service ntpd stop关了它!time.nist.gov是时间中心的地址,也可以采用其他的时间同步中心,如time.windows.com等,只要是集群都用着一个同步就好了。在RHEL中还要设置一下时区,我统一设置成了首都大北京的东8时区。
3 配置集群无密码访问,使用SSH。首先修改etc/hosts,etc/sysconfig/networking两个文件,使各节点可以使用域名进行互ping,然后生成rsa密钥,这里一定要是rsa!Ambari只能用rsa,用了dsa的就哭去吧。配置完了一定要不厌其烦的把每个节点都无密码访问一下,确保完全成功后再进行下一步。
4 更改RHEL的yum源,国内最好的就是网易了,排名榜上都有人家的名字的。
###删除原先的yum软件###
1: rpm -aq|grep yum|xargs rpm -e --nodeps
###下载新的yum软件###
1: wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
2: wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
3: wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
4: wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
5:
###安装软件###
1: rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
2: rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
3: rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
###修改软件源###
1: mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak
2: nano /etc/yum.repos.d/rhel-debuginfo.repo
1: [base]
2: name=CentOS-$releasever - Base
3: baseurl=http://tel.mirrors.163.com/centos/6/os/$basearch/
4: gpgcheck=1
5: gpgkey=http://tel.mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
6: #released updates
7: [updates]
8: name=CentOS-$releasever - Updates
9: baseurl=http://tel.mirrors.163.com/centos/6/updates/$basearch/
10: gpgcheck=1
11: gpgkey=http://tel.mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
12: #packages used/produced in the build but not released
13: #[addons]
14: #name=CentOS-$releasever - Addons
15: #baseurl=http://tel.mirrors.163.com/centos/$releasever/addons/$basearch/
16: #gpgcheck=1
17: #gpgkey=http://tel.mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
18: #additional packages that may be useful
19: [extras]
20: name=CentOS-$releasever - Extras
21: baseurl=http://tel.mirrors.163.com/centos/6/extras/$basearch/
22: gpgcheck=1
23: gpgkey=http://tel.mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
24: #additional packages that extend functionality of existing packages
25: [centosplus]
26: name=CentOS-$releasever - Plus
27: baseurl=http://tel.mirrors.163.com/centos/6/centosplus/$basearch/
28: gpgcheck=1
29: enabled=0
1: yum clean all
2: yum -y update