1.配置hostname(所有节点)
ambari需要完整的hostname,要不然肯定会安装失败
vi /etc/sysconfig/network
HOSTNAME=node***.ambari
然后输入 hostname node***.ambari
测试hostname是否完成
hostname -f
hostname
上两个命令的输出结果应该是一致的,都为:node***.ambari
2.配置hosts(所有节点)
由于集群比较小,没必要配置DNS,因此用host就可以了
hosts文件内容应当如下
vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
12.0.5.11 node1.ambari node1
12.0.5.12 node2.ambari node2
12.0.5.14 node4.ambari node4
12.0.5.15 node5.ambari node5
12.0.5.16 node6.ambari node6
第一列为IP地址,第二列为hostname,第三列为别名
3.配置SSH无密码访问(master节点)
选择一个节点为主节点,同时也是ambari的master节点
ssh-keygen -t dsa
生产公钥和密钥对
scp ~/.ssh/id_dsa.pub node**:~/.ssh/authorized_keys
发送公钥到其他的节点
4.关闭iptables和SElinux(所有节点)
修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,并重启!
输入sestatus 查看 SELINUX状态
关闭防火墙
chkconfig iptables off /etc/init.d/iptables stop5.配置NTP服务,同步集群时间(所有节点)
主节点:
(1)首先确定ntp是否存在,若不存在则通过以下命令安装:
- yum install ntp
(2)修改配置文件/etc/ntp.conf,在其中插入:
- restrict 12.0.5.0 mask 255.0.0.0 nomodify notrap
其中:
用restrict控管权限
nomodify - 用户端不能更改ntp服务器的时间参数
noquery - 用户端不能使用ntpq,ntpc等命令来查询ntp服务器
notrap - 不提供trap远端登陆
(3)此时可以向12.0.5.0/24的机器提供时间服务了,开启ntp服务:
- /etc/rc.d/init.d/ntpd start // 启动ntp服务
- chkconfig ntpd on // 让ntp服务开机启动
1)修改vi /etc/ntp.conf,在里边插入:
- server 12.0.5.11
(2)使ntpd服务开启启动
- chkconfig ntpd on
(3)启动客户端ntpd服务
- /etc/rc.d/init.d/ntpd start
-
yum
-
rpm
-
scp
-
curl yum -y install curl
-
wget
-
pdsh yum -y install pdsh
如果遇到gpg check的问题 可以
用 yum install nagios --nogpgcheck
附:增加RPMforge源
1,download the rpmforge package:
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
2,Install DAG's GPG key
sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
如果上面出现错误,确认下:
sudo rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
3,sudo rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
4,试试看:sudo yum install htop
开始更新系统:
yum update
7.检查相关安装
http://incubator.apache.org/ambari/1.2.0/installing-hadoop-using-ambari/content/ambari-chap1-5-1.html
按照此网页的内容