阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6.5下安装Ambari

129次阅读
没有评论

共计 2751 个字符,预计需要花费 7 分钟才能阅读完成。

Linux 系统:CentOS 6.5

一、准备工作:
1. 基本工具
yum
rpm
scp
curl
wget
pdsh
前几个一般系统都自带了,pdsh 需要自己装:yum install pdsh
这个命令没有成功执行 自己下载 pdsh.tar.bz2,用 tar -jxvf filename.tar.bz 解压。之后进入 filename 文件夹,执行./configure, 然后执行 make 和 make install 命令。安装结束。

另:使用 yum install pdsh 没有成功的问题安装 epel 即可解决。epel 是一个提供高质量软件包的项目。安装过程如下:
1. 查看是否安装:rpm -q epel-release
2. 若没有,使用 rpm 命令安装:rpm -ivh http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm(也可手动下载安装包安装)
3. 成功后查看其所依附的软件包:rpm -qR epel-release
4. 导入 key:rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
5. 安装 yum-priority:yum install yum-priorities
6.cd /etc/yum.repos.d
  ls |grep epel
7. 安装 pdsh 即可:yum install pdsh

ambari 文档上说“The Python version shipped with SUSE 11, 2.6.0-8.12.2, has a critical bug that may cause the Ambari Agent to fail with 24 hours. If you are installing on
SUSE 11, please update all your hosts to Python version 2.6.8-0.15.1.”
使用 yum update python 命令更新 python 版本。

2. 分别配置 /etc/hosts 和 /etc/sysconfig/network
以 ambari 节点下修改 hosts 文件为例:(本机 192.168.235.138,master 节点 ip 地址为 192.168.235.139,slave 节点 ip 地址为 192.168.235.140)

127.0.0.1 ambari
::1 ambari

192.168.235.139  master
192.168.235.140  slave

(修改主机名,比如改为 ambari:
hostname ambari
vi /etc/sysconfig/network 在里面设置 ambari
不必重启)

3. 设置免密码登陆:
[root@ambari ~]# ssh-keygen
[root@ambari ~]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[root@ambari ~]# scp ~/.ssh/authorized_keys master:/root/.ssh/
[root@ambari ~]# scp ~/.ssh/authorized_keys slave:/root/.ssh/

4. 关闭 SELinux:
暂时关闭命令:setenforce 0
永久关闭命令:vi /etc/selinux/config
将其中的 SELinux 设置:为 SELINUX=disabled

5. 关闭防火墙:
永久关闭:chkconfig iptables off
关闭:/etc/init.d/iptables stop
(也可在 setup 中设置开机不开启防火墙)

6. 设置关闭 packagekit
vi /etc/yum/pluginconf.d/refresh-packagekit.conf
将 enabled 设为 0

7. Optional: Configure the Local Repositorie(没有联网,或者配置很大的集群并想保持带宽)
参考:http://ambari.apache.org/1.2.2/installing-Hadoop-using-ambari/content/ambari-chap1-6.html

二、安装
1. 下载 repo 文件
wget http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA/ambari.repo
cp ambari.repo /etc/yum.repos.d

2. 安装 epel repository
yum install epel-release
查看是否配置成功,命令:
yum repolist
若成功,则应显示(不同系统可能稍有不同):

repo id repo name status

HDP-UTILS-1.1.0.16 Hortonworks Data Platform Utils Version – HDP-UTILS-1. 61

Updates-ambari-1.x ambari-1.x – Updates 65

ambari-1.x Ambari 1.x 5

base CentOS-6 – Base 6,367

epel Extra Packages for Enterprise Linux 6 – x86_64 10,633

extras CentOS-6 – Extras 14

updates CentOS-6 – Updates 0

repolist: 17,145

之后安装 ambari bits:

yum install ambari-server
这个命令同时安装了 PostgreSQL。

3. 执行命令:ambari-server setup
如果还没有关闭 SELinux,执行这个命令的过程中会提示,选择 y。然后会配置 PostgreSQL,选择 y 自动下载安装 jdk。之后配置数据库,选 n 使用默认数据库用户名 ambari-server 和密码 bigdata,选 y 自己创建用户名密码。

执行命令 ambari-server start 启动服务。在浏览器中输入“主机名:8080”进入登陆界面,默认用户名密码为 admin/admin。

可以修改端口号:
在 /etc/ambari-server/conf/ambari.properties 文件增加
client.api.port=<port_number>

查看 ambari 进程:ps -ef | grep Ambari
停止 ambari 进程:ambari-server stop
重启 ambari 进程:ambari-server restart

Hadoop 集群监控工具 Ambari 安装 http://www.linuxidc.com/Linux/2014-06/103208.htm

使用 Ambari 快速部署 Hadoop 大数据环境 http://www.linuxidc.com/Linux/2014-05/101531.htm

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2751字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中