基于ubuntu16.04搭建Ambari集群
从10月10号接触Ambari到现在为止,刚好14天吧(两个星期)
网上的安装方法一大堆,但是必须要找到适合你的,否则很难安装成功的。所以我将题目定为:基于ubuntu16.04搭建Ambari集群。
一、修改域名
dthost001(样例)
root@DTHost001:/home/dtmanager# vim /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
内网ip dthost002
外网ip dthost001 dthost001
外网ip dthost002 dthost002
内网ip dthost001
dthost002(样例)
root@DTHost002:~# vim /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
内网ip dthost002
外网ip dthost001 dthost001
外网ip dthost002 dthost002
内网ip dthost001
二、在root用户中配置ssh免密钥登录
使用ssh-copy-id是配置免密钥登录最快的方法
(在两台云主机中同时执行)
ssh-keygen
ssh-copy-id 云主机1外网IP
ssh-copy-id 云主机2外网IP
(测试)
ssh root@dthost001
ssh root@dthost002
(退出)
exit
三、安装
转换到root下执行下面命令,下面提供一种在线安装方法
选定一台云主机作为master,另一台作为slave(以下命令除第6条外,只需要在master主机中执行即可)
cd /etc/apt/sources.list.d
wget http://public-repo-1.hortonworks.com/ambari/ubuntu16/2.x/updates/2.5.2.0/ambari.list
apt-key adv –recv-keys –keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server
apt-get install ambari-agent(在master和slave两台机器中都要执行)
apt-get install ambari-metrics-assembly
其它安装方法请参考http://www.voidcn.com/article/p-nxtxngvc-bpy.html?tdsourcetag=s_pctim_aiomsg
四、设置和启动
设置只需要使用默认即可
ambari-server setup
ambari-server start
五、修改阿里云端口
阿里云主机可能对部分端口无法访问,例如8080端口就无法访问,所以需要到阿里云控制平台中去开启端口权限。详情请参考如下链接。https://blog.csdn.net/KascLiyuan/article/details/73438093
六、登录图形化界面,做初始化设置
登录 公网ip:8080
账号 admin
密码 admin
其中配置端口那一步骤最容易失败的,要填写主机名称
后面的步骤使用默认即可。反正我在上面花了不少时间,祝各位安装ambari的时候好运连连。最后祝各位同行程序员节快乐。