ambari部署

1.环境信息

CentOS6.5 10.0.0.41 node1 mysql, ambari server
CentOS6.5 10.0.0.42 node2
CentOS6.5 10.0.0.43 node3

2.创建ambari用户并初始化密码
2.1创建用户

[root@node1 ~]# for i in {41..43}; do ssh 10.0.0.$i "groupadd ambari && useradd -g ambari -d /home/ambari ambari"; done

2.2初始化密码

[root@node1 ~]# for i in {41..43}; do ssh 10.0.0.$i "echo '123456' | passwd --stdin ambari"; done

3.ambari用户之间打通key
3.1生成key

#切换到ambari用户下
[root@node1 ~]# su - ambari
#执行keygen
[ambari@node1 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/opt/ambari/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /opt/ambari/.ssh/id_rsa.
Your public key has been saved in /opt/ambari/.ssh/id_rsa.pub.
The key fingerprint is:
db:0f:64:75:d9:7a:4e:ce:e8:f0:96:96:24:71:c0:cd ambari@bgs-8p80-udp-01
The key's randomart image is:
+--[ RSA 2048]----+
| . o |
| o Eo |
| ..o .|
| ..... |
| S o o. o|
| = . .B |
| . o .o.o+|
| o += |
| .oo |
+-----------------+
[ambari@node1 ~]# for i in {41..43};do ssh-copy-id [email protected].$i;done
#此时需要输入一遍41-43的ambari密码

3.2验证是否打通

[ambari@node1 ~]# for i in {41..43};do ssh 10.0.0.$i "echo Ok";done
It's Ok
It's Ok
It's Ok
#此时输出3遍It's Ok即为没问题

4.root用户之间打通key
4.1生成key

[root@node1 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
db:0f:64:75:d9:7a:4e:ce:e8:f0:96:96:24:71:c0:cd root@bgs-8p80-udp-01
The key's randomart image is:
+--[ RSA 2048]----+
| . o |
| o Eo |
| ..o .|
| ..... |
| S o o. o|
| = . .B |
| . o .o.o+|
| o += |
| .oo |
+-----------------+
[root@node1 ~]# for i in {41..43};do ssh-copy-id [email protected].$i;done
#此时需要输入一遍41-43的root密码

4.2验证是否打通

[root@node1 ~]# for i in {41..43};do ssh 10.0.0.$i "echo "It's Ok";done
It's Ok
It's Ok
It's Ok
#此时输出3遍It's Ok即为没问题

5.ambari数据库创建

[ambari@node1 soft]# mysql -uroot -p
mysql> create database ambari character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> create user ambari identified by 'baifendian';
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on ambari.* to 'ambari'@'localhost' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> grant all privileges on ambari.* to 'ambari'@'172.24.8.80' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on ambari.* to 'ambari'@'bgs-8p80-maxin' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on ambari.* to 'ambari'@'%' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye
[ambari@node1 soft]

6.hive数据库创建

[ambari@node1 soft]# mysql -uroot -p
mysql> create database hive character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> create user hive identified by 'baifendian';
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on hive.* to 'hive'@'localhost' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on hive.* to 'hive'@'172.24.8.80' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on hive.* to 'hive'@'bgs-8p80-maxin' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on hive.* to 'hive'@'%' identified BY '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

7.ambari安装

[root@node1 soft]# yum install ambari-server
[root@node1 soft]# 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...
[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.
Path to JAVA_HOME: /opt/java
Validating JDK on Ambari Server...done.
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
Hostname (localhost): 10.0.0.41
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)?
Extracting system views...
ambari-admin-2.5.1.0.159.jar ...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
[ambari@bgs-8p80-udp-01 soft]#

8.ambari数据库脚本导入

[ambari@node1 soft]# mysql -uambari -p
mysql> use ambari;
Database changed
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
Query OK, 0 rows affected (0.00 sec)
  
... ...
  
Query OK, 54 rows affected (0.01 sec)
Records: 54  Duplicates: 0  Warnings: 0
  
Query OK, 53 rows affected (0.01 sec)
Records: 53  Duplicates: 0  Warnings: 0
  
Query OK, 1 row affected (0.01 sec)
Records: 1  Duplicates: 0  Warnings: 0
  
Query OK, 14 rows affected (0.00 sec)
Records: 14  Duplicates: 0  Warnings: 0
... ...
 
mysql> quit;
Bye

9.启动ambari

[ambari@node1 soft]# 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.

10.设置Setup-JDBC

[ambari@node1 soft]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

11.访问ambari界面
http://10.0.0.41:8080/#/login

你可能感兴趣的:(ambari)