Ambari2.7.4+HDP3.1.4是最后一个免费版本,新版本需要收费。
需要实现SSH互通,主机名修改,hosts添加,关闭安全子系统,时间同步,安装JDK1.8等
安装httpd
yum install -y yum-utils createrepo httpd
systemctl start httpd
systemctl enable httpd
访问地址:http://172.16.21.43/
网站目录:/var/www/html
cd ~
# ambari
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0/ambari-2.7.4.0-centos7.tar.gz
# hdp
wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0/HDP-3.1.4.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
wgethttp://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.4.0/HDP-GPL-3.1.4.0-centos7-gpl.tar.gz
完成下载后
mkdir /var/www/html/ambari
tar -vzxf ambari-2.7.4.0-centos7.tar.gz -C /var/www/html/ambari
tar -zxvf HDP-3.1.4.0-centos7-rpm.tar.gz -C /var/www/html/ambari
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/ambari
tar -zxvf HDP-GPL-3.1.4.0-centos7-gpl.tar.gz -C /var/www/html/ambari
访问 http://172.16.21.43/ambari
可能会缺少/ambari/ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins和/ambari/ambari/centos7/2.7.4.0-118/repodata/repomd.xml,可以去他的公共仓库下载。
cd /etc/yum.repos.d/
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0/ambari.repo
wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0/hdp.repo
wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.4.0/hdp.gpl.repo
修改内容
修改baseUrl和gpgkey内容为本地地址,不再说明,注意地址!
分发
scp ambari.repo root@hadoop1:/etc/yum.repos.d/
scp ambari.repo root@hadoop2:/etc/yum.repos.d/
scp ambari.repo root@hadoop3:/etc/yum.repos.d/
安装依赖
yum install python-devel -y
yum install ambari-server -y
必须是5.7版本!
wget https://repo.mysql.com/mysql57-community-release-el7.rpm
rpm -Uvh mysql57-community-release-el7.rpm
yum -y install mysql-community-server
密码强度
set global validate_password_policy=0;
set global validate_password_length=1;
安装过程不再展示了,可以查看本人博客MySQL8.0.x的安装,需要新建用户和数据库ambari。
执行脚本:/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
放置驱动:/usr/share/java/mysql-connector-java-5.1.31.jar
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):ambari
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): 2
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/java/jdk1.8.0_251-amd64
Validating JDK on Ambari Server...done.
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...
GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? n
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): 3
Hostname (localhost):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (ambari_12345):
Configuring ambari database...
Enter full path to custom jdbc driver: /usr/share/java/mysql-connector-java-5.1.31.jar
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.7.4.0.118.jar
....
Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
打开 ambari
ambari-server start
访问:http://172.16.21.43:8080
账号:admin/admin
点击开始配置
(1)创建集群
(2)选择版本
选择本地仓库,只保留redhat7,并且填上地址
参考:
http://172.16.21.43/ambari/HDP/centos7/3.1.4.0-315/
http://172.16.21.43/ambari/HDP-UTILS/centos7/1.1.0.22/
hadoop1
hadoop2
hadoop3
公钥
cat ~/.ssh/id_rsa
安装hive需要指定驱动
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.31.jarr