Adding Druid to a cluster
Also available as:
PDF

Set up MySQL for Druid

If you chose MySQL as the metadata store for Druid during the installation, you must set up the MySQL connector and follow a few steps to configure the database.

  1. Enter the command for your operating system to install the MySQL connector:
    • RHEL, Centos, Linux: yum install mysql-connector-java*
    • SLES: zypper install mysql-connector-java*
    • Ubuntu: apt-get install libmysql-java
  2. On the Ambari server host, run the command to set up the connector:
    ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/mysql/mysql-connector-java.jar
  3. Confirm that Ambari copies the mysql-connector-java.jar /usr/share/java.
  4. Create a Druid database by executing the following command, replacing <DRUIDDATABASE> with the Druid database name.
    # mysql -u root -p
    CREATE DATABASE <DRUIDDATABASE> DEFAULT CHARACTER
    SET utf8;                   
  5. On the mysql command line, create a Druid user with sufficient superuser permissions:
    CREATE USER '<DRUIDUSER>'@'%' IDENTIFIED BY '<DRUIDPASSWORD>';
    GRANT ALL PRIVILEGES ON <DRUIDDATABASE>.* TO '<DRUIDUSER>'@'%’;
    FLUSH PRIVILEGES;