hue使用mysql作為元數據庫
hue默認使用sqlite作為元數據庫,不推薦在生產環境中使用。會經常出現database is lock的問題。
解決方法:
其實官網也有解決方法,不過過程似乎有點問題。而且並不適合3.7之后的版本。我現在使用的是3.11,以下是總結的最快的切換方法。
1、先在mysql里面創建數據庫hue
create database hue default character set utf8 default collate utf8_general_ci; grant all on hue.* to 'hue'@'%' identified by 'huepassword'; select * from information_schema.schemata; quit
注意:更改huepassword密碼
部分主機出現無法登陸故障 mysql:ERROR 1045 (28000): Access denied for user 'hue'@'localhost' (using password: YES)
使用root賬戶登錄mysql,然后修改hue的密碼
grant all privileges on *.* to hue@localhost identified by 'huepassowrd' with grant option;
2、修改hue.ini
[[database]]
engine=mysql
host=slave1
port=3306
user=hadoop
password=hadoop
name=hue
完成以上的這個配置,啟動Hue,通過瀏覽器訪問,會發生錯誤,原因是mysql數據庫沒有被初始化
DatabaseError: (1146, "Table 'hue.desktop_settings' doesn't exist")
3, 初始化數據庫
cd hue-release-4.0.1/build/env/ bin/hue syncdb bin/hue migrate
執行完以后,可以在mysql中看到,hue相應的表已經生成。
啟動hue, 能夠正常訪問了