安装mysql
yum install mariadb* -y
service mariadb start
chkconfig mariadb on
配置mariadb
mysql_secure_installation
创建ambari依赖数据库
use mysql;
update user set Host='%' where user='root' and Host='127.0.0.1';
FLUSH PRIVILEGES;
CREATE DATABASE `ambari` DEFAULT CHARACTER SET utf8;
use ambari;
CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `hive` DEFAULT CHARACTER SET latin1 ;
use hive;
CREATE USER 'hive'@'%' IDENTIFIED BY 'hivepasswd';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `oozie` DEFAULT CHARACTER SET latin1 ;
use oozie;
CREATE USER 'oozie'@'%' IDENTIFIED BY 'ooziepasswd';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `ranger` DEFAULT CHARACTER SET latin1 ;
use ranger;
CREATE USER 'ranger'@'%' IDENTIFIED BY 'rangerpasswd';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%';
CREATE USER 'rangeradmin'@'%' IDENTIFIED BY 'rangeradminpasswd';
GRANT ALL PRIVILEGES ON *.* TO 'rangeradmin'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `rangerkms` DEFAULT CHARACTER SET latin1 ;
use rangerkms;
CREATE USER 'rangerkms'@'%' IDENTIFIED BY 'rangerkmspasswd';
GRANT ALL PRIVILEGES ON *.* TO 'rangerkms'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `druid` DEFAULT CHARACTER SET utf8 ;
use druid;
CREATE USER 'druid'@'%' IDENTIFIED BY 'druidpasswd';
GRANT ALL PRIVILEGES ON *.* TO 'druid'@'%';
FLUSH PRIVILEGES;
CREATE DATABASE `superset` DEFAULT CHARACTER SET latin1 ;
use superset;
CREATE USER 'superset'@'%' IDENTIFIED BY 'supersetpasswd';
GRANT ALL PRIVILEGES ON *.* TO 'superset'@'%';
FLUSH PRIVILEGES;
创建ambari元数据
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
安装ambari-server
yum -y install ambari-server
配置ambari
[root@hadoop3 jdk1.8.0_202-amd64]
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):
Adjusting ambari-server permissions and ownership...
Checking firewall status...
WARNING: iptables is running. Confirm the necessary Ambari ports are accessible. Refer to the Ambari documentation for more details on ports.
OK to continue [y/n] (y)?
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Custom JDK
==============================================================================
Enter choice (1): 2
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_202-amd64
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)?
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): hadoop2
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata):
Configuring ambari database...
Enter full path to custom jdbc driver: /root/mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar
Copying /root/mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar to /usr/share/java
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
Proceed with configuring remote database connection properties [y/n] (y)?
Extracting system views...
ambari-admin-2.7.5.0.72.jar
....
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
service ambari-server start
chkconfig ambari-server on
第一次报错
[root@hadoop3 ~]
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
ERROR: Exiting with exit code -1.
REASON: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.
修改该异常
[root@hadoop3 ~]
[root@hadoop3 ~]
[root@hadoop3 ~]
[root@hadoop3 ~]
Using python /usr/bin/python
Setup ambari-server
Copying /usr/share/java/mysql-connector-java-5.1.40-bin.jar to /var/lib/ambari-server/resources/mysql-connector-java-5.1.40-bin.jar
Creating symlink /var/lib/ambari-server/resources/mysql-connector-java-5.1.40-bin.jar to /var/lib/ambari-server/resources/mysql-connector-java.jar
If you are updating existing jdbc driver jar for mysql with mysql-connector-java-5.1.40-bin.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server 'setup' completed successfully.
再次启动 启动成功
输入默认用户名密码admin/admin 由此可以通过ambari的安装界面进行集群安装和管理。
|