# Configuration options for specifying the Desktop Database. For more info,
# see http://docs.djangoproject.com/en/1.4/ref/settings/#database-engine
# ------------------------------------------------------------------------
[[database]]
# Database engine is typically one of:
# postgresql_psycopg2, mysql, sqlite3 or oracle.
#
# Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
# Note for Oracle, options={"threaded":true} must be set in order to avoid crashes.
# Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
# Note for MariaDB use the 'mysql' engine.
## engine=sqlite3
## host=
## port=
## user=
## password=
## name=desktop/desktop.db
## options={}
以上是默认的。
hue默认使用sqlite作为元数据库,不推荐在生产环境中使用。会经常出现database is lock的问题。
[root@bigdatamaster hadoop]# mysql -uhive -phive
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.1.73 Source distribution
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show databases; ±-------------------+ | Database | ±-------------------+ | information_schema | | hive | | mysql | | oozie | | test | ±-------------------+ 5 rows in set (0.07 sec)
mysql>
因为,我这里是,用户为hive,密码也为hive,然后,数据库也为hive,所以如下:
# Configuration options for specifying the Desktop Database. For more info,
# see http://docs.djangoproject.com/en/1.4/ref/settings/#database-engine
# ------------------------------------------------------------------------
[[database]]
# Database engine is typically one of:
# postgresql_psycopg2, mysql, sqlite3 or oracle.
#
# Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
# Note for Oracle, options={"threaded":true} must be set in order to avoid crashes.
# Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
# Note for MariaDB use the 'mysql' engine.
engine=mysql
host=bigdatamaster
port=3306
user=hive
password=hive
name=hive
## options={}
# Configuration options for specifying the Desktop Database. For more info,
# see http://docs.djangoproject.com/en/1.4/ref/settings/#database-engine
# ------------------------------------------------------------------------
[[database]]
# Database engine is typically one of:
# postgresql_psycopg2, mysql, sqlite3 or oracle.
#
# Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
# Note for Oracle, options={"threaded":true} must be set in order to avoid crashes.
# Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
# Note for MariaDB use the 'mysql' engine.
engine=mysql
host=bigdatamaster
port=3306
user=hue
password=hue
name=hue
## options={}
You just installed Django’s auth system, which means you don’t have any superusers defined. Would you like to create one now? (yes/no): yes Username (leave blank to use ‘hadoop’): hue Email address: Password: hue Password (again): Superuser created successfully. Installing custom SQL … Installing indexes … Installed 0 object(s) from 0 fixture(s)
# Database options to send to the server when connecting.
# https://docs.djangoproject.com/en/1.4/ref/databases/
## options={}
# mysql, oracle, or postgresql configuration.
[[[mysql]]]
# Name to show </span><span style="color: #0000ff;">in</span><span style="color: #000000;"> the UI.
nice_name</span>=<span style="color: #800000;">"</span><span style="color: #800000;">My SQL DB</span><span style="color: #800000;">"</span><span style="color: #000000;">
# For MySQL and PostgreSQL, name </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> the name of the database.
# For Oracle, Name </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> instance of the Oracle server. For express edition
# </span><span style="color: #0000ff;">this</span> <span style="color: #0000ff;">is</span> <span style="color: #800000;">'</span><span style="color: #800000;">xe</span><span style="color: #800000;">'</span> by <span style="color: #0000ff;">default</span><span style="color: #000000;">.
name</span>=<span style="color: #000000;">hive
# Database backend to use. This can be:
# </span><span style="color: #800080;">1</span><span style="color: #000000;">. mysql
# </span><span style="color: #800080;">2</span><span style="color: #000000;">. postgresql
# </span><span style="color: #800080;">3</span><span style="color: #000000;">. oracle
engine</span>=<span style="color: #000000;">mysql
# IP or hostname of the database to connect to.
host</span>=<span style="color: #000000;">bigdatamaster
# Port the database server </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> listening to. Defaults are:
# </span><span style="color: #800080;">1</span>. MySQL: <span style="color: #800080;">3306</span><span style="color: #000000;">
# </span><span style="color: #800080;">2</span>. PostgreSQL: <span style="color: #800080;">5432</span><span style="color: #000000;">
# </span><span style="color: #800080;">3</span>. Oracle Express Edition: <span style="color: #800080;">1521</span><span style="color: #000000;">
port</span>=<span style="color: #800080;">3306</span><span style="color: #000000;">
# Username to authenticate with when connecting to the database.
user</span>=<span style="color: #000000;">hive
# Password matching the username to authenticate with when
# connecting to the database.
password</span>=<span style="color: #000000;">hive
# Database options to send to the server when connecting.
# https:</span><span style="color: #008000;">//</span><span style="color: #008000;">docs.djangoproject.com/en/1.4/ref/databases/</span>
## options={}</pre>
Api 错误:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Error 500 User: hadoop is not allowed to impersonate hue</title> </head> <body><h2>HTTP ERROR 500</h2> <p>Problem accessing /. Reason: <pre> User: hadoop is not allowed to impersonate hue</pre></p><h3>Caused by:</h3><pre>javax.servlet.ServletException: User: hadoop is not allowed to impersonate hue at org.apache.hadoop.hbase.thrift.ThriftHttpServlet.doPost(ThriftHttpServlet.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:767) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelE
无法访问:/user/hadoop。 Note: you are a Hue admin but not a HDFS superuser, "hdfs" or part of HDFS supergroup, "supergroup".
SecurityException: Failed to obtain user group information: org.apache.hadoop.security.authorize.AuthorizationException: User: hue is not allowed to impersonate hadoop (error 403)
The oozie is running, when I click WorkFlows, there appares a error
即,oozie启动后,当我在hue界面点击workfolws后,出现如下的错误
解决办法
Hue submits MapReduce jobs to Oozie as the logged in user. You need to configure Oozie to accept the hue user to be a proxyuser. Specify this in your oozie-site.xml (even in a non-secure cluster), and restart Oozie:
[kfk@bigdata-pro01 hue-3.9.0-cdh5.5.0]$ ./build/env/bin/supervisor
Traceback (most recent call last):
File "./build/env/bin/supervisor", line 9, in <module>
load_entry_point('desktop==3.9.0', 'console_scripts', 'supervisor')()
File "/opt/modules/hue-3.9.0-cdh5.5.0/desktop/core/src/desktop/supervisor.py", line 358, in main
_init_log(log_dir)
File "/opt/modules/hue-3.9.0-cdh5.5.0/desktop/core/src/desktop/supervisor.py", line 294, in _init_log
desktop.log.basic_logging(PROC_NAME, log_dir)
File "/opt/modules/hue-3.9.0-cdh5.5.0/desktop/core/src/desktop/log/__init__.py", line 146, in basic_logging
logging.config.fileConfig(log_conf)
File "/usr/lib64/python2.6/logging/config.py", line 84, in fileConfig
handlers = _install_handlers(cp, formatters)
File "/usr/lib64/python2.6/logging/config.py", line 162, in _install_handlers
h = klass(*args)
File "/usr/lib64/python2.6/logging/handlers.py", line 112, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib64/python2.6/logging/handlers.py", line 64, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib64/python2.6/logging/__init__.py", line 835, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib64/python2.6/logging/__init__.py", line 854, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/opt/modules/hue-3.9.0-cdh5.5.0/logs/supervisor.log'
解决办法: 只有build是root权限,其他都是普通用户。
问题二十三:
当前没有已配置的数据库。请转到您的 Hue 配置并在“rdbms”部分下方添加数据库。
以下是,默认的
###########################################################################
# Settings for the RDBMS application
###########################################################################
[librdbms]
The RDBMS app can have any number of databases configured in the databases
section. A database is known by its section name
(IE sqlite, mysql, psql, and oracle in the list below).
[[databases]] # sqlite configuration. ## [[[sqlite]]] # Name to show in the UI. ## nice_name=SQLite
# For SQLite, name defines the path to the database.
## name</span>=/tmp/<span style="color: #000000;">sqlite.db
# Database backend to use.
## engine</span>=<span style="color: #000000;">sqlite
# Database options to send to the server when connecting.
# https:</span><span style="color: #008000;">//</span><span style="color: #008000;">docs.djangoproject.com/en/1.4/ref/databases/</span>
## options=<span style="color: #000000;">{}
# mysql, oracle, or postgresql configuration.
## [[[mysql]]]
# Name to show </span><span style="color: #0000ff;">in</span><span style="color: #000000;"> the UI.
## nice_name</span>=<span style="color: #800000;">"</span><span style="color: #800000;">My SQL DB</span><span style="color: #800000;">"</span><span style="color: #000000;">
# For MySQL and PostgreSQL, name </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> the name of the database.
# For Oracle, Name </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> instance of the Oracle server. For express edition
# </span><span style="color: #0000ff;">this</span> <span style="color: #0000ff;">is</span> <span style="color: #800000;">'</span><span style="color: #800000;">xe</span><span style="color: #800000;">'</span> by <span style="color: #0000ff;">default</span><span style="color: #000000;">.
## name</span>=<span style="color: #000000;">mysqldb
# Database backend to use. This can be:
# </span><span style="color: #800080;">1</span><span style="color: #000000;">. mysql
# </span><span style="color: #800080;">2</span><span style="color: #000000;">. postgresql
# </span><span style="color: #800080;">3</span><span style="color: #000000;">. oracle
## engine</span>=<span style="color: #000000;">mysql
# IP or hostname of the database to connect to.
## host</span>=<span style="color: #000000;">localhost
# Port the database server </span><span style="color: #0000ff;">is</span><span style="color: #000000;"> listening to. Defaults are:
# </span><span style="color: #800080;">1</span>. MySQL: <span style="color: #800080;">3306</span><span style="color: #000000;">
# </span><span style="color: #800080;">2</span>. PostgreSQL: <span style="color: #800080;">5432</span><span style="color: #000000;">
# </span><span style="color: #800080;">3</span>. Oracle Express Edition: <span style="color: #800080;">1521</span><span style="color: #000000;">
## port</span>=<span style="color: #800080;">3306</span><span style="color: #000000;">
# Username to authenticate with when connecting to the database.
## user</span>=<span style="color: #000000;">example
# Password matching the username to authenticate with when
# connecting to the database.
## password</span>=<span style="color: #000000;">example
# Database options to send to the server when connecting.
# https:</span><span style="color: #008000;">//</span><span style="color: #008000;">docs.djangoproject.com/en/1.4/ref/databases/</span>
## options={}</pre>
很有可能,你在这个地方,没有细致地更改。
改为
# sqlite configuration.
[[[sqlite]]]
# Name to show in the UI.
nice_name=SQLite
# For SQLite, name defines the path to the database.
name</span>=/opt/modules/hue-<span style="color: #800080;">3.9</span>.<span style="color: #800080;">0</span>-cdh5.<span style="color: #800080;">5.0</span>/desktop/<span style="color: #000000;"><span style="font-size: 18px;"><strong><span style="color: #ff0000;">desktop.db</span></strong></span>
# Database backend to use.
engine</span>=<span style="color: #000000;">sqlite
# Database options to send to the server when connecting.
# https:</span><span style="color: #008000;">//</span><span style="color: #008000;">docs.djangoproject.com/en/1.4/ref/databases/</span>
## options={}</pre>
再,停掉mysql,重启mysql和hue
[kfk@bigdata-pro01 conf]$ sudo service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[kfk@bigdata-pro01 conf]$
[kfk@bigdata-pro01 hue-3.9.0-cdh5.5.0]$ ./build/env/bin/supervisor
[INFO] Not running as root, skipping privilege drop
starting server with options:
{'daemonize': False,
'host': 'bigdata-pro01.kfk.com',
'pidfile': None,
'port': 8888,
'server_group': 'hue',
'server_name': 'localhost',
'server_user': 'hue',
'ssl_certificate': None,
'ssl_cipher_list': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA',
'ssl_private_key': None,
'threads': 40,
'workdir': None}
即,Hue的服务器(名字为My SQL DB,一般是mysql, oracle, or postgresql)。通常用mysql。