Hue:Configuring Hue to Store Data in MySQL

  1. 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)
  2. Shut down Hue if it is running.
  3. To migrate your existing data to MySQL, use the following command to dump the existing database data to a text file. Note that using the ".json" extension is required.

    $ /usr/share/hue/build/env/bin/hue dumpdata > <some-temporary-file>.json
  4. Open the hue.ini file in a text editor. Directly below the [[database]] line, add the following options (and modify accordingly for your MySQL setup):

    host=localhost
    port=3306
    engine=mysql
    user=hue
    password=secretpassword
    name=hue
  5. As the Hue user, configure Hue to load the existing data and create the necessary database tables:

    $ /usr/share/hue/build/env/bin/hue syncdb --noinput
    $ mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;"
    $ /usr/share/hue/build/env/bin/hue loaddata <temporary-file-containing-dumped-data>.json

Your system is now configured and you can start the Hue server as normal.

Note: The above commands will produce some errors when the hue daemon has been installed without

mysql configuration. 

My practise is that alter the database config in hue.ini in the original tarball and then run

PREFIX=/path/to/hue-install-parent-dir make install

a. delete the old hue database in mysql

b.

#hue syncdb --noinput
#hue migrate

References

http://cloudera.github.io/hue/docs-3.5.0/manual.html

猜你喜欢

转载自ylzhj02.iteye.com/blog/2039827
HUE
今日推荐