1.ambari 官网地址:http://ambari.apache.org
2.下载ambari
[hadoop@slavenode7 hadoop]$
wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.0.1/ambari.repo
100%[==========================================================>] 252 --.-K/s in 0s
2016-10-13 13:47:49 (30.5 MB/s) - “ambari.repo” saved [252/252]
3.拷贝到yum库里
[hadoop@slavenode7 hadoop]$ su -
Password:
[root@slavenode7 ~]# cp /opt/hadoop/ambari.repo /etc/yum.repos.d/
[root@slavenode7 ~]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: Updates-ambari-2.0.1 base extras updates
Cleaning up Everything
[root@slavenode7 ~]# yum list|grep ambari
ambari-server.noarch 2.0.1-45
[root@slavenode7 ~]# yum install ambari-server
4.把数据库连接jar放在java目录里
cp /opt/hadoop/mysql-connector-java-5.1.36-bin.jar /usr/share/java
5在mysql中创建用户
[hadoop@masternode1 hadoop]$ mysql -uroot -h127.0.0.1 -p
Enter password:
mysql> CREATE USER 'ambari' IDENTIFIED BY 'ambari';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES on *.* TO 'ambari'@'masternode1' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql>grant all privileges on ambari.* to ambari@'%' identified by 'ambari';
mysql>grant all on ambari.* to “root@masternode1 identified by “root123″;
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[hadoop@masternode1 hadoop]$ mysql -h masternode1 -uambari
mysql> create database ambari;
Query OK, 1 row affected (0.00 sec)
[hadoop@masternode1 hadoop]$ scp mysql-connector-java-5.1.36/mysql-connector-java-5.1.36-bin.jar root@slavenode7:/usr/share/java
mysql-connector-java-5.1.36-bin.jar 100% 949KB 949.2KB/s 00:00
导入数据库
mysql ambari -uambari -p < /opt/hadoop/Ambari-DDL-MySQL-CREATE.sql
7.导入数据库
mysql ambari -uambari -p < /opt/hadoop/Ambari-DDL-MySQL-CREATE.sql
[root@slavenode7 ~]# ambari-server setup
Using python /usr/bin/python2.6
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Ambari-server daemon is configured to run under user 'root'. Change this setting [y/n] (n)?
Adjusting ambari-server permissions and ownership...
Checking iptables...
Checking JDK...
Do you want to change Oracle JDK [y/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
[4] - PostgreSQL
==============================================================================
Enter choice (1): 3
Hostname (masternode1): masternode1
Port (3306):
Database name (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata):
Re-enter password:
Configuring ambari database...
Copying JDBC drivers to server resources...
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.0.1.45.jar
.
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
http://192.168.230.238:8080/#/login
[root@slavenode7 bin]# ambari-server start
Using python /usr/bin/python2.6
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
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....................
Ambari Server 'start' completed successfully.
http://192.168.230.238:8080/#/login
进入登陆界面,默认用户名密码为admin/admin。