1 安装前准备
1.1 主机列表
本次实验选择4台主机,1台作为Ambari Server主机,3台作为Ambari Agent
节点ip | OS版本 | jdk版本 | hostname -f | 安装软件 |
---|---|---|---|---|
192.168.0.1 | RHEL7.4 | openjdk-1.8.0.131 | ambari1 | Ambari Server |
192.168.0.2 | RHEL7.4 | openjdk-1.8.0.131 | ambari2 | Ambari Agent |
192.168.0.3 | RHEL7.4 | openjdk-1.8.0.131 | ambari3 | Ambari Agent |
192.168.0.4 | RHEL7.4 | openjdk-1.8.0.131 | ambari4 | Ambari Agent |
注意:
- Ambari Server主机到Ambari Agent主机免密登录
- 关闭防火墙
- 开启NTP服务
安装JDK
yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64/
设置UTF8字符集
cat << EOF > /etc/locale.conf
LANG="en_US.UTF-8"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:zh_CN.gb18030:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
EOF
软件包下载:
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/hdp_31_repositories.html
https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/ambari_repositories.html
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari-2.7.3.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
配置YUM源
cat << EOF > /etc/yum.repos.d/rhelex.repo
[redhatex]
name=redhatex
baseurl=ftp://192.168.0.1/pub/rhel7ex/
enabled=1
gpgcheck=0
gpgkey=
EOFcat << EOF > /etc/yum.repos.d/ambari.repo
#VERSION_NUMBER=2.7.3.0-139
[ambari-2.7.3.0]
name=ambari Version - ambari-2.7.3.0
baseurl=http://192.168.0.1:18080/ambari2.7.3/centos7/2.7.3.0-139/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/ambari2.7.3/centos7/2.7.3.0-139/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
EOFcat << EOF > /etc/yum.repos.d/hdp.repo
#VERSION_NUMBER=3.0.1.0-187
[HDP-3.0.1.0-187]
name=HDP Version - HDP-3.0.1.0-187
baseurl=http://192.168.0.1:18080/HDP-3.0.1.0/centos7/3.0.1.0-187/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/HDP-3.0.1.0/centos7/3.0.1.0-187/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://192.168.0.1:18080/HDP-UTILS-1.1.0.22/centos7/1.1.0.22/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/HDP-UTILS-1.1.0.22/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
EOF
2 安装Ambari Server on PostgreSQL
这里跟2.6版本安装基本一样
yum install -y ambari-server
# 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):root Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... Do you want to change Oracle JDK [y/n] (n)? y [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Custom JDK ============================================================================== Enter choice (1): 3 WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts. WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts. Path to JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64/ Validating JDK on Ambari Server...done. Checking GPL software agreement... Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? Y Configuring database... ============================================================================== Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ============================================================================== Enter choice (3): 1 ####如果主机字符集编码未设置正确,可能会启动报错,具体可以查看日志/var/log/ambari-server/ambari-server.log Database admin user (postgres): postgres Database name (ambari): ambari Postgres schema (ambari): ambari Username (ambari): ambari Enter Database Password (bigdata): Default properties detected. Using built-in database. Configuring ambari database... Checking PostgreSQL... Running initdb: This may take up to a minute. About to start PostgreSQL Configuring local database... Configuring PostgreSQL... Backup for pg_hba found, reconfiguration not required Creating schema and user... done. Creating tables... done. Extracting system views... ............ Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.
ambari-server start
通过浏览器访问http://192.168.0.1:8080测试是否正常启动,默认用户名密码为admin/admin。