Apache Ambari Administration
Also available as:
PDF
loading table of contents...

Using Ambari with MySQL/MariaDB

To set up MySQL for use with Ambari:

Steps

  1. On the Ambari Server host, install the connector.

    1. Install the connector

      RHEL/CentOS/Oracle Linux

      yum install mysql-connector-java 

      SLES

      zypper install mysql-connector-java

      Debian/Ubuntu

      apt-get install libmysql-java
    2. Confirm that .jar is in the Java share directory.

      ls /usr/share/java/mysql-connector-java.jar
    3. Make sure the .jar file has the appropriate permissions - 644.

  2. Create a user for Ambari and grant it permissions.

    • For example, using the MySQL database admin utility:

       # mysql -u root -p 
      CREATE USER '<AMBARIUSER>'@'%' IDENTIFIED BY '<AMBARIPASSWORD>';
      GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'%';
      CREATE USER '<AMBARIUSER>'@'localhost' IDENTIFIED BY '<AMBARIPASSWORD>';
      GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'localhost';
      CREATE USER '<AMBARIUSER>'@'<AMBARISERVERFQDN>' IDENTIFIED BY '<AMBARIPASSWORD>';
      GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'<AMBARISERVERFQDN>';
      FLUSH PRIVILEGES;
    • Where <AMBARIUSER> is the Ambari user name, <AMBARIPASSWORD> is the Ambari user password and <AMBARISERVERFQDN> is the Fully Qualified Domain Name of the Ambari Server host.

  3. Load the Ambari Server database schema.

    • You must pre-load the Ambari database schema into your MySQL/MariaDB database using the schema script. Run the script in the same location where you find the Ambari-DDL-MySQL-CREATE.sql file. You should find the Ambari-DDL-MySQL-CREATE.sql file in the /var/lib/ambari-server/resources/ directory of the Ambari Server host, after you have installed Ambari Server.

      mysql -u <AMBARIUSER> -p

      CREATE DATABASE <AMBARIDATABASE>;

      USE <AMBARIDATABASE>;
      SOURCE Ambari-DDL-MySQL-CREATE.sql;
    • Where <AMBARIUSER> is the Ambari user name and <AMBARIDATABASE> is the Ambari database name.

  4. When setting up the Ambari Server, select Advanced Database Configuration > Option [3] MySQL/MariaDB and enter the credentials you defined in Step 2. for user name, password and database name.