Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari - Mysql setup

Ambari - Mysql setup

Expert Contributor

Hello

I am installing a new HDP 2.3 cluster and Hive and several other services will be using mysql as seen in the customize services section.

Will the ambari setup install mysql? or do i have to install mysql on each server before continuing with the installation?

Regards

10 REPLIES 10

Re: Ambari - Mysql setup

New Contributor

@Ahmad Debbas Yes, the automated install will install mysql as part of the installation. Please see this doc for more information on what databases are installed as part of the ambari installation: http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_Installing_HDP_AMB/content/_database_requ...

Re: Ambari - Mysql setup

Expert Contributor

Hello, the first reply stated i have to manually install mysql.

whose answer is more accurate? :D

Re: Ambari - Mysql setup

New Contributor

To be more specific, as shown in the doc, by default the Ambari automated installation will install a Postgres DB for Ambari, a mysql DB for Hive, and a Derby DB for Oozie. If you want to back Ambari with mysql, the information provided above by Sri is helpful. If you want to go with the default installation DB's, after installation you can configure Ranger or Oozie with mysql as the DB.

Re: Ambari - Mysql setup

Expert Contributor

ok thanks! i will keep using Postgres DB for Ambari

Highlighted

Re: Ambari - Mysql setup

Mentor

@afdebbas 

Postgres is delivered with HDP as the derby database if you want to use Oracle,MariaDB,MySQL or MS SQL then you have to manually install them. This is to response to your question or doubt in an earlier post. That said Derby databases are not recommended for  UAT or production

 

Re: Ambari - Mysql setup

Mentor

@afdebbas 

 

Addendum

Having diffrenet databases for different components

  • Postgres DB for Ambari
  • mysql DB for Hive
  • Derby DB for Oozie

Gives you a big management overhead if you intend to script and automate some processes, my 20 cents advise start allover with MariaDB [ opensource spinoff of MySQL] or MySQL db  some licensing  to factor in for all components inproduction etc

Re: Ambari - Mysql setup

@Ahmad Debbas

Yes. Ambari will download the mysql. For example if you are installing HIVE service and going to select mysql database for hive then ambari will download mysql package for HIVE service. Same for other services.

Re: Ambari - Mysql setup

Expert Contributor

Hello, the first reply stated i have to manually install mysql.

whose answer is more accurate? :D

Re: Ambari - Mysql setup

@Ahmad Debbas

You have to install DDL before setting up the Ambari

To set up MySQL for use with Ambari:

  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

    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 database using the schema script.

      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.

      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.

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

Please follow as shown in the link https://docs.hortonworks.com/HDPDocuments/Ambari-2.1.1.0/bk_ambari_reference_guide/content/_using_am...

In the same way you have for hive Link, Oozie Link, Hue ... Please let me know if you are looking for something different

Don't have an account?
Coming from Hortonworks? Activate your account here