1 SUDO权限及机器名标准化
使用root用户登录:
1)添加用户hadoop
groupadd hadoop
useradd -g hadoop hadoop
passwd hadoop dtsw1234
2)sudo权限配置
chmod u+w /etc/sudoers
vim /etc/sudoers
...
hadoop ALL=(ALL) NOPASSWD:ALL
...
chmod u-w /etc/sudoers
【注:更改完成后记得关闭写权限,sudoers修改注意位置,不可直接加至末尾或开头】
使用hadoop用户,机器名标准化
sudo hostnamectl set-hostname dtsw-001
sudo vim /etc/hosts
11111.11.11.11 qq
2 SSH无密码登录
hadoop用户执行: ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@aa
3 安装元数据库(MySQL为例)
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
sudo rpm -ivh mysql57-community-release-el7-8.noarch.rpm --nodeps --force
sudo yum install mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
找到初始密码,设置新密码
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
mysql> Enter password: (输入刚才查询到的随机密码)
mysql> SET PASSWORD FOR 'root'@'da1'= "aaa";
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'aa' WITH
GRANT OPTION;
mysql>FLUSH PRIVILEGES;
创建ambari元数据库
create database ambari character set utf8 ;
CREATE USER 'ambari'@'%'IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;
4 安装Ambari
4.1 安装ambari-server
sudo yum install ambari-server
4.2 ambari-server设置
sudo ambari-server setup
Customize user account for ambari-server daemon [y/n] (n)? 输入y
Enter user account for ambari-server daemon (root):ambariAdjusting ambari-server
permissions and ownership... 输入ambari
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] 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.4.3 将ambari数据库导入
4.4 启动ambari-server
5 安装向导
Path to JAVA_HOME: /opt/java/jdk1.8.0_121/opt/jdk/jdk1.8.0_121
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
Enter choice (1): 3
Hostname (localhost):dtsw-001
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata):
Re-enter password:
Configuring ambari database...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against
the database 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.6.2.0.155.jar
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
4.3 将ambari数据库导入
mysql -uambari -pbigdata
mysql> use ambari;
Database changed
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
4.4 启动ambari-server
sudo ambari-server start
访问 ip:8080
添加版本如下操作
http://ip:81/repo/HDP/centos7/3.1.0.0-78/HDP-3.1.0.0-78.xml
http://ip:81/repo/HDP/centos7/3.1.0.0-78
http://ip:81/repo/HDP-UTILS/centos7/1.1.0.22
http://ip:81/repo/HDP-GPL/centos7/3.1.0.0-78