Ubuntu14 安装 Ambari 2.2.2

安装Ambari2.2.2有两种方式,分别是从公共仓库中下载和自己从源代码编译。这里我们选择从公共仓库中下载Ambari

重要的事提前说,要选择64位的Ubuntu版本

重要的事提前说,要选择64位的Ubuntu版本

重要的事提前说,要选择64位的Ubuntu版本

以下的操作全部用root身份执行。

配置Hosts文件

最好只保留下面的样子:

192.168.37.143  amaster.mrbcy.tech  amaster
192.168.37.129  anode1.mrbcy.tech   anode1
192.168.37.130  anode2.mrbcy.tech   anode2
192.168.37.131  anode3.mrbcy.tech   anode3

下面的这几种配置都会报错,建议不要保留

错误项1:

127.0.1.1       amaster amaster.mrbcy.tech

错误项2:

::1     localhost ip6-localhost ip6-loopback

错误项3:

127.0.0.1   localhost  amaster

错误项4:

127.0.0.1       localhost
127.0.1.1       ubuntu

可能出现的错误如下:

2013-03-11 19:41:08,263 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

ERROR 2016-01-07 11:16:51,903 main.py:143 - Ambari agent machine hostname (ha0.ggz.bluefir) does not match expected ambari server hostname (ha0). Aborting registration. Please check hostname,hostname -f and /etc/hosts file to confirm your hostname is setup correctly

INFO 2016-01-07 11:52:03,525 NetUtil.py:60 - Connecting to https://ha0.ggz.bluefir:8440/ca

如果已经错了,可以去每台机器/etc/ambari-agent/conf/ambari-agent.ini修改ambari-server主机信息

临时关闭transparent_hugepage

检查是否开启transparent_hugepage:

redhat使用下列命令:

cat /sys/kernel/mm/redhat_transparent_hugepage/enabled

其他系统使用下列命令:

cat /sys/kernel/mm/transparent_hugepage/enabled

always代表开启
不存在该文件就是没开启

使用下列命令临时关闭transparent_hugepage

echo never > /sys/kernel/mm/transparent_hugepage/defrag

没什么效果的话可以参考http://www.jb51.cc/article/p-enkqtisk-bhq.html来关闭transparent_hugepage。每个节点都要关闭。

安装启动ntp服务

每一台机器上都执行:

apt-get install ntp 
service ntp start

各节点间相互ssh免密码登录

可以使用ssh-copy-id命令也可以用自动化脚本来完成,详情可以参考我之前的博客http://www.jb51.cc/article/p-zonehcpe-pm.html

从Ambari Server主机下载并安装

执行下面的命令:

cd /etc/apt/sources.list.d

wget http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.2.0/ambari.list

然后再执行下面的命令:

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD

apt-get update

在安装ambari-server之前可以把ambari-server_2.2.2.0-460_amd64.deb拷贝到/var/cache/apt/archives/下

下载地址:

http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.2.0/pool/main/a/ambari-server/ambari-server_2.2.2.0-460_amd64.deb

然后执行下面的命令进行安装:

apt-get install ambari-server

接下来执行下面的命令进行配置,过程中全部回车默认即可:

ambari-server setup

过程中需要下载JDK,可以提前下载jdk-8u60-linux-x64.tar.gz,然后拷贝到/var/lib/ambari-server/resources/jdk-8u60-linux-x64.tar.gz

接下来执行下面的命令启动ambari-server:

ambari-server start

由于我之前安装过2.2.0版本,这次运行时出错了,log文件里面错误如下:

org.apache.ambari.server.AmbariException: Current database store version is not compatible with current server version,serverVersion=2.2.2.0,schemaVersion=2.2.0.0

运行下面的命令进行升级后重新启动,成功。

ambari-server upgrade

打开web页面进行集群的配置

访问http://amaster:8080 用户名 admin 密码 admin

出现下图所示的界面则说明安装成功。

参考资料

http://www.jb51.cc/article/p-xqdzcsoe-bhq.html

https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.2.2+from+Public+Repositories

相关文章

文章浏览阅读2.3k次,点赞4次,收藏22次。最近安装了CARLA预...
文章浏览阅读6.3k次,点赞5次,收藏15次。在清华镜像中下载U...
文章浏览阅读5k次。linux环境, python3.7.问题描述: 安装...
文章浏览阅读4.2k次,点赞4次,收藏17次。要安装这个 standa...
文章浏览阅读894次,点赞51次,收藏31次。在安卓使用vscode主...