Configure Hue to Store Data in MySQL or MariaDB
About this task
Procedure
-
To configure Hue to store data in MySQL, create a new database in MySQL and
grant privileges to a Hue user to manage this database.
mysql> create database hue; Query OK, 1 row affected (0.01 sec) mysql> grant all on hue.* to 'hue'@'localhost' identified by 'secretpassword'; Query OK, 0 rows affected (0.00 sec)
-
Configure the database connection parameters in the
[desktop][[database]]
section ofhue.ini
. Set the following properties with your database connection parameters:[desktop] ... [[database]] engine=mysql host=<host> port=3306 user=<user> password='<password>' name=<database>
Example of configuration:[desktop] ... [[database]] engine=mysql host=node1 port=3306 user=hue password=hue_password name=hue
If the connection is secured through SSL/TLS, specify the CA, Cert, and Key paths, as shown in the following example:[desktop] [[database]] ... options='{"ssl": {"key": "/path/to/client-key.pem", "cert": "/path/to/client-cert.pem", "ca": "/path/to/ca.pem"}}'
You can find detailed documentation for other options in the Django Connecting to the Database documentation. -
Perform the initial data migration:
sudo /opt/mapr/server/configure.sh -R
-
Restart Hue:
maprcli node services -name hue -action restart -nodes <node_with_hue>