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

相关文章

1.安装过程出现0x00000000指令引用的0x00000000内存该内存不能为written 如果你安装的是inux系统 需要在...
写在全面:如果根据以下教程涉及到只读文件需要更改文件权限才能需修改文件内容,参考我的另一篇博客:...
写在前面:以下步骤中需要在终端输入命令,电脑端查看博客的朋友可以直接复制粘贴到终端,手机端查看的...
ubuntu16.04和18.04更换国内源 写在前面:安装好ubuntu双系统后,默认的软件更新源是国外的,在国内使用...
ubuntu双系统启动时卡死解决办法(在ubuntu16.04和18.04测试无误) 问题描述: 在安装完ubuntu双系统后...
又来造轮子了。。。。。。。。。。。。。。。。 今天使用w3af向文件中写入的时候,发现没有write权限,...