Ambari安裝會將安裝等信息寫入數據庫,建議使用自己安裝的Mysql數據庫,也可以不安裝而使用默認數據庫PostgreSQL
版本要求:
- PostgreSQL 8
- PostgreSQL 9.1.13+,9.3, 9.4***
- MariaDB 10*
- MySQL 5.6
- Oracle 11gr2
- Oracle 12c**
按你係統來選擇源:http://downloads.mariadb.org/mariadb/repositories/
Here is your custom MariaDB YUM repository entry for CentOS. Copy and paste it into a file under /etc/yum.repos.d/ (we suggest naming the file MariaDB.repo or something similar).
# MariaDB 10.1 CentOS repository list - created 2016-12-09 06:03 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
After the file is in place, install MariaDB with:
$ sudo yum install MariaDB-server MariaDB-client
If you haven't already accepted the MariaDB GPG key, you will be prompted to do so. See "Installing MariaDB with yum"for detailed information.
安裝完成後創建ambari數據庫及用戶,登錄root用戶執行下面語句:
createdatabase ambari characterset utf8 ;CREATEUSER'ambari'@'%'IDENTIFIED BY'Ambari-123';GRANTALLPRIVILEGESON *.* TO'ambari'@'%';
FLUSH PRIVILEGES;
如果要安裝Hive,再創建Hive數據庫和用戶 再執行下面的語句:
createdatabase hive characterset utf8 ;CREATEUSER'hive'@'%'IDENTIFIED BY'Hive-123';GRANTALLPRIVILEGESON *.* TO'hive'@'%';
FLUSH PRIVILEGES;
如果要安裝Oozie,再創建Oozie數據庫和用戶 再執行下面的語句:
createdatabase oozie characterset utf8 ;CREATEUSER'oozie'@'%'IDENTIFIED BY'Oozie-123';GRANTALLPRIVILEGESON *.* TO'oozie'@'%';
FLUSH PRIVILEGES;
安裝Ambari
$ yum install ambari-server -y
配置Ambari
$ ambari-server setup
下面是配置執行流程,按照提示操作
(1) 提示是否自定義設置。輸入:y
Customize user account for ambari-server daemon [y/n] (n)? y
(2)ambari-server 賬號。輸入:ambari
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
(3)設置JDK。輸入:3
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[] Custom JDK
==============================================================================
Enter choice (1): 3
(4)如果上面選擇3自定義JDK,則需要設置JAVA_HOME。輸入:/opt/java/jdk1.8.0_112
WARNING: JDK must be installed onall hosts and JAVA_HOME must be valid onall 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 onall hosts.
Path to JAVA_HOME: /opt/java/jdk1.8.0_112
Validating JDK on Ambari Server...done.
Completing setup...
(5)數據庫配置。選擇:y
Configuring database...
Enter advanced database configuration [y/n] (n)? y
(6)選擇數據庫類型。輸入:3
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (3): 3
(7)設置數據庫的具體配置信息,根據實際情況輸入,如果和括號內相同,則可以直接回車。
Hostname (localhost):
Port ():
Database name (ambari):
Username (ambari):
Enter Database Password (Ambari-123):
(8)將Ambari數據庫腳本導入到數據庫
如果使用自己定義的數據庫,必須在啓動Ambari服務之前導入Ambari的sql腳本
用Ambari用戶(上面設置的用戶)登錄mysql
mysql -u ambari -p
use ambari
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
(9)啓動Amabri
$ ambari-server start
(10)成功啓動後在瀏覽器輸入Ambari地址:
http://sy-001.hadoop:8080/