Apache Ambari 01 - Ambari Mirror 安装部署

来源:互联网 发布:淘宝卖家学院光云科技 编辑:程序博客网 时间:2024/05/01 18:42

本文源自于:天天学 IT - 知识库


集群机器

主机 IP 地址 192.168.99.181 ambari-mirror 192.168.99.101 ambari-server 192.168.99.106 ambari-agent1 192.168.99.107 ambari-agent2

创建管理用户 hadoop(所有节点操作)

useradd hadoop

修改机器 hosts 文件(所有节点操作)

echo -e '192.168.99.181 ambari-mirror\n192.168.99.101 ambari-server\n192.168.99.106 ambari-agent1\n192.168.99.107 ambari-agent2' >> /etc/hosts

设置 hadoop 用户 sudo 免密码(所有节点操作)

使用 visudo 在第 99 行后加入

hadoop ALL=(ALL) NOPASSWD: ALL

配置 hadoop 用户免密钥登录(在 ambari-mirror 节点操作)

进入 hadoop 用户

su hadoop

生成密钥(一路回车即可)

ssh-keygen

追加到授权keys中

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

修改密钥权限

chmod 700 ~/.sshchmod 600 ~/.ssh/authorized_keys

拷贝密钥到其他节点(使用 root 用户,在 ambari-mirror 节点操作)

sudo scp -r /home/hadoop/.ssh/ root@ambari-server:/home/hadoop/sudo scp -r /home/hadoop/.ssh/ root@ambari-agent1:/home/hadoop/sudo scp -r /home/hadoop/.ssh/ root@ambari-agent2:/home/hadoop/

NTP服务(在所有节点操作)

安装服务:sudo yum install ntp设置开机启动:sudo systemctl enable ntpd启动服务:sudo systemctl start ntpd

防火墙(在所有节点操作)

关闭防火墙:sudo service firewalld stop

关闭selinux(在所有节点操作)

使用 /usr/sbin/sestatus -v 检查 selinux 如果是 enable 状态关闭

sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

使用 sudo reboot 重启电脑进入 hadoop 用户

设置UMASK(使用root用户,在所有节点操作)

echo umask 0022 >> /etc/profile && source /etc/profile

安装依赖包(使用 hadoop 用户,在 ambari-mirror 节点操作)

sudo yum install yum-utils createrepo httpd yum-plugin-priorities

设置pluginconf(使用root用户,在 ambari-mirror 节点操作)

echo 'gpgcheck=0' >> /etc/yum/pluginconf.d/priorities.conf

下载ambari安装源(使用hadoop用户,在ambari-mirror节点操作)

sudo wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari.repo  -O /etc/yum.repos.d/ambari.reposudo wget -nv http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/hdp.repo  -O /etc/yum.repos.d/HDP.repo

检查安装源可用性(使用hadoop用户,在ambari-mirror节点操作)

yum repolist

确保拥有hdp源即可

创建centos7文件夹(使用hadoop用户,在ambari-mirror节点操作)

sudo mkdir -p ambari/centos7 && cd /var/www/html/ambari/centos7/

同步ambari源到本地(使用hadoop用户,在ambari-mirror节点操作)

sudo reposync -r Updates-ambari-2.2.2.0sudo reposync -r HDP-2.4.2.0sudo reposync -r HDP-UTILS-1.1.0.20

生成本地仓库源数据(使用hadoop用户,在ambari-mirror节点操作)

创建 ambari metadata

sudo createrepo /var/www/html/ambari/centos7/Updates-ambari-2.2.2.0/

Spawning worker 0 with 8 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

创建hdp metadata

sudo createrepo /var/www/html/hdp/centos7/2.4.X/HDP-2.4.2.0/

Spawning worker 0 with 181 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

创建 hdp util metadata

shellsudo createrepo /var/www/html/hdp/centos7/2.4.X/HDP-UTILS-1.1.0.20/ 

Spawning worker 0 with 44 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

启动http服务(使用hadoop用户,在ambari-mirror节点操作)

sudo service httpd start

查看Ambari源可用性(使用hadoop用户,在ambari-mirror节点操作)

http://ambari-mirror/ambari/http://ambari-mirror/hdp/
0 0
原创粉丝点击