Ambari基础

介绍

安装

部署环境

主机名 IP 操作系统 角色
node1.wanglibing.com 10.10.1.31 CentOS7 本地库
Ambari Server
node2.wanglibing.com 10.10.1.32 CentOS7 Ambari Client
node3.wanglibing.com 10.10.1.33 CentOS7 Ambari Client
node4.wanglibing.com 10.10.1.21 CentOS7 Ambari Client

准备

配置项 说明
关闭防火墙 全部
关闭Selinux 全部
设置NTP 全部
安装JDK 全部
配置ip 全部
配置hostname 全部
配置最大打开文件要求 全部

配置最大打开文件要求

建议的最大打开文件描述符数为10000或更多。要检查为最大打开文件描述符数设置的当前值,请在每个主机上执行以下shell命令:

1
2
$ ulimit -Sn
$ ulimit -Hn

如果输出不大于10000,请运行以下命令将其设置为合适的默认值:

1
$ ulimit -n 10000

配置NTP

1
2
$ yum install -y ntp
$ systemctl enable ntpd

部署本地存储库

安装http server

1
2
3
$ yum install -y httpd
$ systemctl start httpd
$ systemctl enable httpd

默认web目录:/var/www/html

配置源

1
2
3
4
5
6
7
8
9
$ cd /usr/local/
$ wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.1.0/ambari-2.7.1.0-centos7.tar.gz
$ wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.0.1.0/HDP-3.0.1.0-centos7-rpm.tar.gz
$ wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
$ wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.0.1.0/HDP-GPL-3.0.1.0-centos7-gpl.tar.gz
$ tar zxvf ambari-2.7.1.0-centos7.tar.gz -C /var/www/html/
$ tar zxvf HDP-3.0.1.0-centos7-rpm.tar.gz -C /var/www/html/
$ tar zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/
$ tar zxvf HDP-GPL-3.0.1.0-centos7-gpl.tar.gz -C /var/www/html/

配置免密登陆

1
2
3
4
5
$ ssh-keygen
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ scp -p ~/.ssh/id_rsa.pub root@10.10.1.32:/root/.ssh/authorized_keys
$ scp -p ~/.ssh/id_rsa.pub root@10.10.1.33:/root/.ssh/authorized_keys
$ scp -p ~/.ssh/id_rsa.pub root@10.10.1.21:/root/.ssh/authorized_keys

部署Ambari Server

安装jdk

Ubuntu

1
2
$ rpm -ivh jdk-8u191-linux-x64.rpm
$ java -version

配置公共源

1
2
3
4
$ cd /etc/yum.repos.d/
# 配置ambari源
$ wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.1.0/ambari.repo
$ wget -nv http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.0.1.0/hdp.repo

配置本地源

在配置公共源的基础上修改:
ambari.repo

1
2
3
4
5
6
7
8
#VERSION_NUMBER=2.7.1.0-169
[ambari-2.7.1.0]
name=ambari Version - ambari-2.6.1.5
baseurl=http://10.10.1.31/ambari/centos7/2.7.1.0-169/
gpgcheck=1
gpgkey=http://10.10.1.31/ambari/centos7/2.7.1.0-169/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

hdp.repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#VERSION_NUMBER=3.0.1.0-187
[HDP-3.0.1.0]
name=HDP Version - HDP-3.0.1.0
baseurl=http://10.10.1.31/HDP/centos7/3.0.1.0-187
gpgcheck=1
gpgkey=http://10.10.1.31/HDP/centos7/3.0.1.0-187/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://10.10.1.31/HDP-UTILS/centos7/1.1.0.22
gpgcheck=1
gpgkey=http://10.10.1.31/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

检查源列表

1
$ yum repolist

安装ambari-server

1
$ yum install -y ambari-server

配置ambari-server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$ ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)?
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
Checking GPL software agreement...
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)?
Configuring database...
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take up to a minute.
Initializing database ... OK


About to start PostgreSQL
Configuring local database...
Configuring PostgreSQL...
Restarting PostgreSQL
Creating schema and user...
done.
Creating tables...
done.
Extracting system views...
ambari-admin-2.7.1.0.169.jar
....
Ambari repo file doesnot contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

启动ambari-server

1
$ ambari-server start

访问ambari server

参数
URL http://10.10.1.31:8080/
用户名 admin
密码 admin

重新安装ambari server

在执行ambari-server setup时出现错误或者感觉里面的选项错误时要重新执行时先执行

1
$ ambari-server reset

后再执行

1
$ ambari-server setup

部署集群

Launch Install Wizard

1.png

Get Started

2.png

Select Version

OS Name Base URL
redhat7 HDP-3.0 http://10.10.1.31/HDP/centos7/3.0.1.0-187
redhat7 HDP-3.0-GPL http://10.10.1.31/HDP-GPL/centos7/3.0.1.0-187
redhat7 HDP-UTILS-1.1.0.22 http://10.10.1.31/HDP-UTILS/centos7/1.1.0.22

Install Options

查看私钥:

1
$ cat ~/.ssh/id_rsa

3.png
4.png

Confirm Hosts

5.png

Choose File System

6.png

勾选如下:

  • HDFS
  • ZooKeeper
  • Ambari Metrics

Assign Masters

7.png

Assign Slaves and Clients

8.png

参考

公共存储库

坚持原创技术分享,您的支持将鼓励我继续创作!