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:
Set strict mode in /etc/my.cnf and restart MySQL:
Create a new database and grant privileges to a Hue user to manage this database. For example:
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.
(InnoDB only) Drop the foreign key that you retrieved in the previous step.
Delete the rows in the django_content_type table.
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.
Start the Hue service.
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.
相关文章推荐
- UIKit视图动画的微扩展
- UIKit视图动画的微扩展
- UIKit视图动画的微扩展
- 循环队列(Circular Queue)
- deque容器
- iOS中UITextField使用详解
- HDU-5297-Y sequence(容斥+迭代)
- 2016 UESTC Training Search Algorithm and StringB - Xiper的奇妙历险(2)(三维迷宫)
- (Leetcode 95+96)Unique Binary Search Trees 动态规划 分治
- HDU 4010 Query on The Trees(动态树)
- 对Map按key和value分别排序
- [leetcode]347. Top K Frequent Elements
- It is indirectly referenced from required .class files
- UIButtonAndNSTimer
- ora-00054:resource busy and acquire with nowait specified
- Hibernate中的query.setFirstResult(),query.setMaxResults();
- ORA-00054: resource busy and acquire with NOWAIT specified
- UML建模之时序图(Sequence Diagram)
- hdu 3397 Sequence operation(线段树区间覆盖,区间合并)
- UIWindow UIView UILable UIButton