Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
avatar
Community Manager

From Ambari 2.6, for all MYSQL_SERVER components in a blueprint, the mysql-connector-java.jar needs to be manually installed and registered. This video describes how to install and register MySQL connector to replace the embedded database instance that is by default used by Ambari Server.

 

 

For certain services, Cloudbreak allows registering an existing RDBMS instance as an external source for a database. After registering the RDBMS with Cloudbreak, it can be used for multiple clusters. However, as this configuration needs to be used by Ambari before its installation, MySQL Connector needs to be connected the remote MySQL database.

8345_1.jpeg

To manually install and register MySQL connector, do the following: 

 
Preparing MySQL Database Server 
  1. Install MySQL Server on CentOS Linux 7:
    # yum -y localinstall https://dev.mysql.com/get/mysql57-community-release-el7-8.
    noarch.rpm 
    # yum -y install mysql-community-server 
    # systemctl start mysqld.service
    
    
  2. Complete the MySQL initial setup. Depending on MySQL version, use user blank password for MySQL root or get the password from mysqld.log:
    # grep password /var/log/mysqld.log
    # mysql_secure_installation
  3. Create a user for Ambari, grant permissions and create the initial Database: 
    # mysql -u root -p
    CREATE USER 'ambari'@'%' IDENTIFIED BY 'Hadoop1234!';
    GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
    CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'Hadoop1234!';
    GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
    FLUSH PRIVILEGES;
    CREATE DATABASE ambari01;

 

Configure Cloudbreak to use MySQL External Database

  1. Create a pre-ambari-start recipe to install the mysql-connector-java.jar:
    #!/bin/bash # Provide the JDBC Connector JAR file. 
    # During cluster creation, Cloudbreak uses /opts/jdbc-drivers directory 
    for the JAR file yum -y localinstall 
    https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm yum -y 
    install mysql-connector-java* if [[ ! -d /opt/jdbc-drivers ]] 
    then mkdir /opt/jdbc-drivers cp /usr/share/java/mysql-connector-java.jar 
    /opt/jdbc-drivers/mysql-connector-java.jar fi
    8345_2.jpeg
  2. Register the database configuration: Database:
    MySQL MySQL Server: MySQL_DB_IP/FQDN MySQL User: 
    ambari MySQL Password: Hadoop1234! JDBC Connector JAR URL: 
    Empty JDBC Connection jdbc:mysql://MySQL_DB_IP/FQDN:Port/ambari01
    8345_3.jpeg
557 Views
0 Kudos