Hue:Configuring Hue to Store Data in MySQL

本文介绍了如何在MySQL中为Hue创建新的数据库并授予权限,包括迁移现有数据的具体步骤。涉及MySQL命令、Hue配置文件修改及使用Hue命令进行数据同步等内容。
  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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值