您的位置:首页 > 产品设计 > UI/UE

CDH HUE配置自定义MySql数据库

2016-05-28 18:20 357 查看
ref:http://www.cloudera.com/documentation/enterprise/latest/topics/cm_ig_mysql.html#cmig_topic_5_5

For information about installing and configuring a MySQL database , see MySQL
Database.

In the Cloudera Manager Admin Console, go to the Hue service status page.

Select Actions > Stop. Confirm you want to stop the service
by clicking Stop.

Select Actions > Dump Database. Confirm you want to dump the
database by clicking Dump Database.

Note the host to which the dump was written under Step in the Dump Database Command window. You can also find it by selecting Commands > Recent
Commands > Dump Database.

Open a terminal window for the host and go to the dump file in /tmp/hue_database_dump.json.

Remove all JSON objects with useradmin.userprofile in the model field, for example:
{
"pk": 14,
"model": "useradmin.userprofile",
"fields":
{ "creation_method": "EXTERNAL", "user": 14, "home_directory": "/user/tuser2" }
},


Set strict mode in /etc/my.cnf and restart MySQL:
[mysqld]
sql_mode=STRICT_ALL_TABLES


Create a new database and grant privileges to a Hue user to manage this database. For example:
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)


In the Cloudera Manager Admin Console, click the Hue service.

Click the Configuration tab.

Select Scope > All.

Select Category > Database.

Specify the settings for Hue Database Type, Hue Database Hostname, Hue Database Port, Hue
Database Username, Hue Database Password, and Hue Database Name. For example, for a MySQL database on the local host, you might use the following values:

Hue Database Type = mysql

Hue Database Hostname = host

Hue Database Port = 3306

Hue Database Username = hue

Hue Database Password = secretpassword

Hue Database Name = hue

Optionally restore the Hue data to the new database:

Select Actions > Synchronize Database.

Determine the foreign key ID.
$ mysql -uhue -psecretpassword
mysql > SHOW CREATE TABLE auth_permission;


(InnoDB only) Drop the foreign key that you retrieved in the previous step.
mysql > ALTER TABLE auth_permission DROP FOREIGN KEY content_type_id_refs_id_XXXXXX;


Delete the rows in the django_content_type table.
mysql > DELETE FROM hue.django_content_type;


In Hue service instance page, click Actions > Load Database.
Confirm you want to load the database by clicking Load Database.

(InnoDB only) Add back the foreign key.
mysql > ALTER TABLE auth_permission ADD FOREIGN KEY (content_type_id) REFERENCES django_content_type (id);


Start the Hue service.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: