赞
踩
</div>
<!--一个博主专栏付费入口-->
<!--一个博主专栏付费入口结束-->
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-833878f763.css">
<div id="content_views" class="markdown_views prism-atom-one-dark">
<!-- flowchart 箭头图标 勿删 -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
</svg>
<p></p><div class="toc"><h3><a name="t0"></a><a name="t0"></a>文章目录</h3><ul><li><a href="#1__1" rel="nofollow" target="_self">1. 介绍</a></li><ul><li><a href="#11_Ambari_2" rel="nofollow" target="_self">1.1 Ambari</a></li><li><a href="#12_HDP_5" rel="nofollow" target="_self">1.2 HDP</a></li><li><a href="#13_HDPUTILS_7" rel="nofollow" target="_self">1.3 HDP-UTILS</a></li></ul><li><a href="#2__9" rel="nofollow" target="_self">2. 准备工作</a></li><ul><li><a href="#21_AmbariHDP_10" rel="nofollow" target="_self">2.1 Ambari、HDP版本介绍</a></li><li><a href="#22__14" rel="nofollow" target="_self">2.2 搭建环境准备</a></li><ul><li><a href="#221__15" rel="nofollow" target="_self">2.2.1 软件要求</a></li><li><a href="#222__26" rel="nofollow" target="_self">2.2.2 软件下载(在下载的过程中,建议使用迅雷下载)</a></li></ul><li><a href="#23__34" rel="nofollow" target="_self">2.3 集群节点规划准备</a></li></ul><li><a href="#3__41" rel="nofollow" target="_self">3. 搭建虚拟机</a></li><ul><li><a href="#31_yumhdp_43" rel="nofollow" target="_self">3.1 搭建yum.hdp虚拟机</a></li><li><a href="#32_yumhdp_106" rel="nofollow" target="_self">3.2 配置yum.hdp虚拟机</a></li><ul><li><a href="#321_IP_107" rel="nofollow" target="_self">3.2.1 配置静态IP</a></li><li><a href="#322__122" rel="nofollow" target="_self">3.2.2 防火墙设置</a></li><li><a href="#323_hostname_131" rel="nofollow" target="_self">3.2.3 设置hostname</a></li><li><a href="#324_yum_138" rel="nofollow" target="_self">3.2.4 设置阿里开源镜像yum源</a></li><li><a href="#325_ntp_143" rel="nofollow" target="_self">3.2.5 安装时间同步服务(ntp)</a></li><li><a href="#326_JDK_152" rel="nofollow" target="_self">3.2.6 安装并配置JDK</a></li><li><a href="#327_SelinuxTHPTHPHadoopCPU_163" rel="nofollow" target="_self">3.2.7 关闭Selinux和THP(如果不关闭THP,Hadoop的系统CPU使用率很高)</a></li><li><a href="#328__189" rel="nofollow" target="_self">3.2.8 最大打开文件要求</a></li></ul><li><a href="#33_yumhdp_200" rel="nofollow" target="_self">3.3 克隆yum.hdp虚拟机</a></li><ul><li><a href="#331__203" rel="nofollow" target="_self">3.3.1 开始克隆</a></li><li><a href="#332__221" rel="nofollow" target="_self">3.3.2 修改参数</a></li><li><a href="#333_nd00hdpmysql_233" rel="nofollow" target="_self">3.3.3 在nd-00.hdp虚拟机上安装mysql</a></li><li><a href="#334_mysqlDB_274" rel="nofollow" target="_self">3.3.4 在mysql数据库创建相应的用户和DB</a></li><li><a href="#335__330" rel="nofollow" target="_self">3.3.5 免密登录</a></li></ul></ul><li><a href="#4_yumhdpAmbari_347" rel="nofollow" target="_self">4. 在yum.hdp上安装Ambari</a></li><ul><li><a href="#41_yum_348" rel="nofollow" target="_self">4.1 安装yum相关工具</a></li><li><a href="#42_Apache_httpd_354" rel="nofollow" target="_self">4.2 安装Apache httpd</a></li><li><a href="#43__Repo_380" rel="nofollow" target="_self">4.3 配置本地 Repo</a></li><ul><li><a href="#431_Ambari_381" rel="nofollow" target="_self">4.3.1 配置Ambari</a></li><li><a href="#431_HDPHDPUTILS_388" rel="nofollow" target="_self">4.3.1 配置HDP和HDP-UTILS</a></li><li><a href="#432_AmbarirepoHDPrepo_411" rel="nofollow" target="_self">4.3.2 分发Ambari.repo和HDP.repo</a></li><li><a href="#433__418" rel="nofollow" target="_self">4.3.3 生成本地源</a></li></ul></ul><li><a href="#5_AmbariServer_445" rel="nofollow" target="_self">5. 安装Ambari-Server</a></li><ul><li><a href="#51_nd00hdp__446" rel="nofollow" target="_self">5.1 nd-00.hdp 节点安装</a></li><li><a href="#52_AmbariServer_665" rel="nofollow" target="_self">5.2 启动Ambari-Server</a></li><li><a href="#53_Agent_683" rel="nofollow" target="_self">5.3 安装Agent</a></li><li><a href="#54_Ambari_web_689" rel="nofollow" target="_self">5.4 访问Ambari web页面</a></li></ul><li><a href="#6__693" rel="nofollow" target="_self">6. 开始安装集群</a></li></ul></div><p></p>
组件 | 描述 |
---|---|
虚拟操作系统 | Centos7.5 |
Ambari | 2.7.3 |
HDP | 3.1.0.0 |
HDP-GPL | 3.1.0.0 |
HDP-UTILS | 1.1.0.22 |
MySQL | 5.7 |
OracleJDK8 | JDK 1.8.0_77 |
X86 | X86-64 |
Hostname | IP | Functions | 内存 | 磁盘 |
---|---|---|---|---|
yum.hdp | 192.168.121.77 | Ambari/HDP packages | 1G | 50G |
nd-00.hdp | 192.168.121.100 | Ambari Server | 3G | 50G |
nd-01.hdp | 192.168.121.101 | Compute node | 2G | 50G |
nd-02.hdp | 192.168.121.102 | Compute node | 2G | 50G |
[root@yum ~]# cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
[root@yum ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
ulimit -Sn
ulimit -Hn
ulimit -n 10000
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service # 启动mysql
systemctl status mysqld.service # 查看mysql状态
systemctl stop mysqld.service # 关闭mysql
systemctl enable mysqld.service # 开机自启
set global validate_password_policy=0;
set global validate_password_length=1;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
yum -y remove mysql57-community-release-el7-10.noarch
在[mysqld]下添加
collation_server=utf8_general_ci
character_set_server=utf8
default-storage-engine=INNODB
在[client]下添加(如果没有[client],则创建)
default_character-set=utf8
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> create database ambari character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'ambari'@'%'IDENTIFIED BY 'Ambari123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> create database hive character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'hive'@'%'IDENTIFIED BY 'Hive123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> create database oozie character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'oozie'@'%'IDENTIFIED BY 'Oozie123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> create database ranger character set utf8;
Query OK, 1 row affected (0.04 sec)
mysql> CREATE USER 'rangeradmin'@'%'IDENTIFIED BY 'Ranger123';
Query OK, 0 rows affected (0.18 sec)
mysql> GRANT ALL PRIVILEGES ON rangeradmin.* TO 'rangeradmin'@'%';
Query OK, 0 rows affected (0.02 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)
yum install mysql-connector-java
ls /usr/share/java
[root@nd-00 ~]# ssh-keygen -t rsa # 一路回车
[root@nd-00 ~]# ssh-copy-id nd-00.hdp # 输入密码
[root@nd-00 ~]# ssh-copy-id nd-01.hdp # 输入密码
[root@nd-00 ~]# ssh-copy-id nd-02.hdp # 输入密码
[root@nd-01 ~]# ssh-keygen -t rsa # 一路回车
[root@nd-01 ~]# ssh-copy-id nd-01.hdp # 输入密码
[root@nd-01 ~]# ssh-copy-id nd-02.hdp # 输入密码
[root@yum ~]# yum install yum-utils -y
[root@yum ~]# yum repolist
[root@yum ~]# yum install createrepo -y
[root@yum ~]# yum install httpd -y
[root@yum ~]# mkdir /var/www/html/ambari
[root@yum ~]# mkdir /var/www/html/hdp
[root@yum ~]# mkdir /var/www/html/hdp/HDP-UTILS-1.1.0.22
[root@yum ~]# tar -zxvf ambari-2.7.3.0-centos7.tar.gz -C /var/www/html/ambari/
[root@yum ~]# tar -zxvf HDP-3.1.0.0-centos7-rpm.tar.gz -C /var/www/html/hdp/
[root@yum ~]# tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.22/
[root@yum ~]# systemctl start httpd # 启动httpd
[root@yum ~]# systemctl status httpd # 查看httpd状态
[root@yum ~]# systemctl enable httpd # 设置httpd开机自启
wget -O /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari.repo
#VERSION_NUMBER=3.1.0.0-78
[HDP-3.1.0.0]
name=HDP Version - HDP-3.1.0.0
baseurl=http://192.168.121.77/hdp/HDP/centos7
gpgcheck=1
gpgkey=http://192.168.121.77/hdp/HDP/centos7/3.1.0.0-78/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://192.168.121.77/hdp/HDP-UTILS-1.1.0.22
gpgcheck=1
gpgkey=http://192.168.121.77/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@yum yum.repos.d]# scp ambari.repo HDP.repo nd-00.hdp:$PWD
[root@yum yum.repos.d]# scp ambari.repo HDP.repo nd-01.hdp:$PWD
[root@yum yum.repos.d]# scp ambari.repo HDP.repo nd-02.hdp:$PWD
[root@yum ~]# createrepo /var/www/html/hdp/HDP/centos7/
Spawning worker 0 with 51 pkgs
Spawning worker 1 with 50 pkgs
Spawning worker 2 with 50 pkgs
Spawning worker 3 with 50 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@yum ~]# createrepo /var/www/html/hdp/HDP-UTILS-1.1.0.22/
Spawning worker 0 with 4 pkgs
Spawning worker 1 with 4 pkgs
Spawning worker 2 with 4 pkgs
Spawning worker 3 with 4 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@nd-00 ~]# yum install ambari-server
[root@nd-00 ~]# 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...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Custom JDK
==============================================================================
Enter choice (1): 2 # 选择自定义jdk
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_77 # jdk安装路径
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)? y
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 (1): 3 # 选择安装的mysql
Hostname (localhost): nd-00 # 配置hostname
Port (3306): # 默认
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata): # 密码不显示
Re-enter password:
Configuring ambari database...
Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? y
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 # 此处需注意,启动ambari之前需要执行此句
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.7.3.0.139.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. # 安装成功
# 使用root登录,设置允许远程登录
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'localhost' IDENTIFIED BY 'Ambari123';
Query OK, 0 rows affected, 1 warning (0.03 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'%' IDENTIFIED BY 'Ambari123';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
[root@nd-00 ~]# mysql -u ambari -p -h nd-00
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| ambari |
±-------------------+
2 rows in set (0.03 sec)
mysql> use ambari;
Database changed
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
mysql> show tables;
±------------------------------+
| Tables_in_ambari |
±------------------------------+
| ClusterHostMapping |
| QRTZ_BLOB_TRIGGERS |
| QRTZ_CALENDARS |
| QRTZ_CRON_TRIGGERS |
| QRTZ_FIRED_TRIGGERS |
| QRTZ_JOB_DETAILS |
| QRTZ_LOCKS |
| QRTZ_PAUSED_TRIGGER_GRPS |
| QRTZ_SCHEDULER_STATE |
| QRTZ_SIMPLE_TRIGGERS |
| QRTZ_SIMPROP_TRIGGERS |
| QRTZ_TRIGGERS |
| adminpermission |
| adminprincipal |
| adminprincipaltype |
| adminprivilege |
| adminresource |
| adminresourcetype |
| alert_current |
| alert_definition |
| alert_group |
| alert_group_target |
| alert_grouping |
| alert_history |
| alert_notice |
| alert_target |
| alert_target_states |
| ambari_configuration |
| ambari_operation_history |
| ambari_sequences |
| artifact |
| blueprint |
| blueprint_configuration |
| blueprint_setting |
| clusterconfig |
| clusters |
| clusterservices |
| clusterstate |
| confgroupclusterconfigmapping |
| configgroup |
| configgrouphostmapping |
| execution_command |
| extension |
| extensionlink |
| groups |
| host_role_command |
| host_version |
| hostcomponentdesiredstate |
| hostcomponentstate |
| hostconfigmapping |
| hostgroup |
| hostgroup_component |
| hostgroup_configuration |
| hosts |
| hoststate |
| kerberos_descriptor |
| kerberos_keytab |
| kerberos_keytab_principal |
| kerberos_principal |
| key_value_store |
| kkp_mapping_service |
| members |
| metainfo |
| permission_roleauthorization |
| remoteambaricluster |
| remoteambariclusterservice |
| repo_applicable_services |
| repo_definition |
| repo_os |
| repo_tags |
| repo_version |
| request |
| requestoperationlevel |
| requestresourcefilter |
| requestschedule |
| requestschedulebatchrequest |
| role_success_criteria |
| roleauthorization |
| servicecomponent_version |
| servicecomponentdesiredstate |
| serviceconfig |
| serviceconfighosts |
| serviceconfigmapping |
| servicedesiredstate |
| setting |
| stack |
| stage |
| topology_host_info |
| topology_host_request |
| topology_host_task |
| topology_hostgroup |
| topology_logical_request |
| topology_logical_task |
| topology_request |
| upgrade |
| upgrade_group |
| upgrade_history |
| upgrade_item |
| user_authentication |
| users |
| viewentity |
| viewinstance |
| viewinstancedata |
| viewinstanceproperty |
| viewmain |
| viewparameter |
| viewresource |
| viewurl |
| widget |
| widget_layout |
| widget_layout_user_widget |
±------------------------------+
111 rows in set (0.00 sec)
[root@nd-00 ~]# ambari-server start
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start......................................................
Server started listening on 8080
DB configs consistency check: no errors and warnings were found.
Ambari Server ‘start’ completed successfully.
yum -y install ambari-agent
[root@nd-00 ~]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
</div>
<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-b6c3c6d139.css" rel="stylesheet">
</div>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。