不多说,直接上干货!

  Hue配置文件里,提及到,提供有postgresql_psycopg2, mysql, sqlite3 or oracle。

   注意:Hue本身用到的是sqlite3。

  在哪里呢,怎么看呢?

  desktop.db这个就是Hue用的 sqlite3数据库。

  1. https://www.cloudera.com/documentation/enterprise/latest/topics/cdh_ig_hue_config.html#concept_ezg_b2s_hl

    首先,看下官网的参考步骤

  1. http://archive.cloudera.com/cdh5/cdh/5/hue-3.9.0-cdh5.5.0/manual.html

一、以下是默认的配置文件

  1. # Configuration options for specifying the Desktop Database. For more info,
  2. # see http://docs.djangoproject.com/en/1.4/ref/settings/#database-engine
  3. # ------------------------------------------------------------------------
  4. [[database]]
  5. # Database engine is typically one of:
  6. # postgresql_psycopg2, mysql, sqlite3 or oracle.
  7. #
  8. # Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name.
  9. # Note for Oracle, options={"threaded":true} must be set in order to avoid crashes.
  10. # Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
  11. # Note for MariaDB use the 'mysql' engine.
  12. ## engine=sqlite3
  13. ## host=
  14. ## port=
  15. ## user=
  16. ## password=
  17. ## name=desktop/desktop.db
  18. ## options={}

  1. ###########################################################################
  2. # Settings for the RDBMS application
  3. ###########################################################################
  4.  
  5. [librdbms]
  6. # The RDBMS app can have any number of databases configured in the databases
  7. # section. A database is known by its section name
  8. # (IE sqlite, mysql, psql, and oracle in the list below).
  9.  
  10. [[databases]]
  11. # sqlite configuration.
  12. ## [[[sqlite]]]
  13. # Name to show in the UI.
  14. ## nice_name=SQLite
  15.  
  16. # For SQLite, name defines the path to the database.
  17. ## name=/tmp/sqlite.db
  18.  
  19. # Database backend to use.
  20. ## engine=sqlite
  21.  
  22. # Database options to send to the server when connecting.
  23. # https://docs.djangoproject.com/en/1.4/ref/databases/
  24. ## options={}
  25.  
  26. # mysql, oracle, or postgresql configuration.
  27. ## [[[mysql]]]
  28. # Name to show in the UI.
  29. ## nice_name="My SQL DB"
  30.  
  31. # For MySQL and PostgreSQL, name is the name of the database.
  32. # For Oracle, Name is instance of the Oracle server. For express edition
  33. # this is 'xe' by default.
  34. ## name=mysqldb
  35.  
  36. # Database backend to use. This can be:
  37. # . mysql
  38. # . postgresql
  39. # . oracle
  40. ## engine=mysql
  41.  
  42. # IP or hostname of the database to connect to.
  43. ## host=localhost
  44.  
  45. # Port the database server is listening to. Defaults are:
  46. # . MySQL:
  47. # . PostgreSQL:
  48. # . Oracle Express Edition:
  49. ## port=
  50.  
  51. # Username to authenticate with when connecting to the database.
  52. ## user=example
  53.  
  54. # Password matching the username to authenticate with when
  55. # connecting to the database.
  56. ## password=example
  57.  
  58. # Database options to send to the server when connecting.
  59. # https://docs.djangoproject.com/en/1.4/ref/databases/
  60. ## options={}

二、以下是跟我机器集群匹配的配置文件(非HA集群下怎么配置Hue的database模块)

  1. ###########################################################################
  2. # Settings for the RDBMS application
  3. ###########################################################################
  4.  
  5. [librdbms]
  6. # The RDBMS app can have any number of databases configured in the databases
  7. # section. A database is known by its section name
  8. # (IE sqlite, mysql, psql, and oracle in the list below).
  9.  
  10. [[databases]]
  11. # sqlite configuration.
  12. [[[sqlite]]]
  13. # Name to show in the UI.
  14. nice_name=SQLite
  15.  
  16. # For SQLite, name defines the path to the database.
  17. name=/home/hadoop/app/hue/desktop/desktop.db
  18.  
  19. # Database backend to use.
  20. engine=sqlite

  1. # mysql, oracle, or postgresql configuration.
  2. [[[mysql]]]
  3. # Name to show in the UI.
  4. nice_name="My SQL DB"
  5.  
  6. # For MySQL and PostgreSQL, name is the name of the database.
  7. # For Oracle, Name is instance of the Oracle server. For express edition
  8. # this is 'xe' by default.
  9. name=test
  10.  
  11. # Database backend to use. This can be:
  12. # . mysql
  13. # . postgresql
  14. # . oracle
  15. engine=mysql
  16.  
  17. # IP or hostname of the database to connect to.
  18. host=bigdatamaster
  19.  
  20. # Port the database server is listening to. Defaults are:
  21. # . MySQL:
  22. # . PostgreSQL:
  23. # . Oracle Express Edition:
  24. port=
  25.  
  26. # Username to authenticate with when connecting to the database.
  27. user=root
  28.  
  29. # Password matching the username to authenticate with when
  30. # connecting to the database.
  31. password=rootroot
  32.  
  33. # Database options to send to the server when connecting.
  34. # https://docs.djangoproject.com/en/1.4/ref/databases/
  35. ## options={}

  

  当然,这里,也可以用hive里安装的mysql里的数据库hive(命名)。(我一般用这种)

  

  1. hive> show databases;
  2. OK
  3. default
  4. hive
  5. Time taken: 0.074 seconds, Fetched: row(s)
  6. hive>

  1. # mysql, oracle, or postgresql configuration.
  2. [[[mysql]]]
  3. # Name to show in the UI.
  4. nice_name="My SQL DB"
  5.  
  6. # For MySQL and PostgreSQL, name is the name of the database.
  7. # For Oracle, Name is instance of the Oracle server. For express edition
  8. # this is 'xe' by default.
  9. name=hive
  10.  
  11. # Database backend to use. This can be:
  12. # . mysql
  13. # . postgresql
  14. # . oracle
  15. engine=mysql
  16.  
  17. # IP or hostname of the database to connect to.
  18. host=bigdatamaster
  19.  
  20. # Port the database server is listening to. Defaults are:
  21. # . MySQL:
  22. # . PostgreSQL:
  23. # . Oracle Express Edition:
  24. port=
  25.  
  26. # Username to authenticate with when connecting to the database.
  27. user=hive
  28.  
  29. # Password matching the username to authenticate with when
  30. # connecting to the database.
  31. password=hive
  32.  
  33. # Database options to send to the server when connecting.
  34. # https://docs.djangoproject.com/en/1.4/ref/databases/
  35. ## options={}

  最后的界面,如下

三、以下是跟我机器集群匹配的配置文件(HA集群下怎么配置Hue的database模块)

 

  1. <configuration>
  2. <property>
  3. <name>javax.jdo.option.ConnectionURL</name>
  4. <value>jdbc:mysql://bigdata-pro01.kfk.com:3306/metastore?createDatabaseIfNotExist=true</value>
  5. </property>
  6. <property>
  7. <name>javax.jdo.option.ConnectionDriverName</name>
  8. <value>com.mysql.jdbc.Driver</value>
  9. </property>
  10. <property>
  11. <name>javax.jdo.option.ConnectionUserName</name>
  12. <value>root</value>
  13. </property>
  14. <property>
  15. <name>javax.jdo.option.ConnectionPassword</name>
  16. <value>root</value>
  17. </property>
  18. <property>
  19. <name>hive.cli.print.header</name>
  20. <value>true</value>
  21. <description>Whether to print the names of the columns in query output.</description>
  22. </property>
  23. <property>
  24. <name>hive.cli.print.current.db</name>
  25. <value>true</value>
  26. <description>Whether to include the current database in the Hive prompt.</description>
  27. </property>
  28. <property>
  29. <name>hbase.zookeeper.quorum</name>
  30. <value>bigdata-pro01.kfk.com,bigdata-pro02.kfk.com,bigdata-pro03.kfk.com</value>
  31. </property>
  32. </configuration>

  所以,我这里设置如下:

  1. ###########################################################################
  2. # Settings for the RDBMS application
  3. ###########################################################################
  4.  
  5. [librdbms]
  6. # The RDBMS app can have any number of databases configured in the databases
  7. # section. A database is known by its section name
  8. # (IE sqlite, mysql, psql, and oracle in the list below).
  9.  
  10. [[databases]]
  11. # sqlite configuration.
  12. [[[sqlite]]]
  13. # Name to show in the UI.
  14. nice_name=SQLite
  15.  
  16. # For SQLite, name defines the path to the database.
  17. name=/opt/modules/hue-3.9.-cdh5.5.0/desktop/desktop.db
  18.  
  19. # Database backend to use.
  20. engine=sqlite
  21.  
  22. # Database options to send to the server when connecting.
  23. # https://docs.djangoproject.com/en/1.4/ref/databases/
  24. ## options={}
  25.  
  26. # mysql, oracle, or postgresql configuration.
  27. [[[mysql]]]
  28. # Name to show in the UI.
  29. nice_name="My SQL DB"
  30.  
  31. # For MySQL and PostgreSQL, name is the name of the database.
  32. # For Oracle, Name is instance of the Oracle server. For express edition
  33. # this is 'xe' by default.
  34. name=metastore
  35.  
  36. # Database backend to use. This can be:
  37. # . mysql
  38. # . postgresql
  39. # . oracle
  40. engine=mysql
  41.  
  42. # IP or hostname of the database to connect to.
  43. host=bigdata-pro01.kfk.com
  44.  
  45. # Port the database server is listening to. Defaults are:
  46. # . MySQL:
  47. # . PostgreSQL:
  48. # . Oracle Express Edition:
  49. port=
  50.  
  51. # Username to authenticate with when connecting to the database.
  52. user=root
  53.  
  54. # Password matching the username to authenticate with when
  55. # connecting to the database.
  56. password=root
  57.  
  58. # Database options to send to the server when connecting.
  59. # https://docs.djangoproject.com/en/1.4/ref/databases/
  60. ## options={}

  然后,关闭mysql,再重启mysql,重启一下hue。

 再,停掉mysql,重启mysql和hue

  1. [kfk@bigdata-pro01 conf]$ sudo service mysqld restart
  2. Stopping mysqld: [ OK ]
  3. Starting mysqld: [ OK ]
  4. [kfk@bigdata-pro01 conf]$
  1.  

  1. [kfk@bigdata-pro01 hue-3.9.0-cdh5.5.0]$ ./build/env/bin/supervisor
  2. [INFO] Not running as root, skipping privilege drop
  3. starting server with options:
  4. {'daemonize': False,
  5. 'host': 'bigdata-pro01.kfk.com',
  6. 'pidfile': None,
  7. 'port': 8888,
  8. 'server_group': 'hue',
  9. 'server_name': 'localhost',
  10. 'server_user': 'hue',
  11. 'ssl_certificate': None,
  12. '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',
  13. 'ssl_private_key': None,
  14. 'threads': 40,
  15. 'workdir': None}
  1.  

总结:

    即,Hue的服务器(名字为My SQL DB,一般是mysql, oracle, or postgresql)。通常用mysql。

      那么,它的数据库是metastore,是在hive里新建的mysql来充当它的元数据库。

  1. <property>
  2. <name>javax.jdo.option.ConnectionURL</name>
  3. <value>jdbc:mysql://master:3306/metastore?createDatabaseIfNotExist=true</value>
  4. </property>

    Hue的服务器(名字为SQLite),那么它的数据库是/opt/modules/hue-3.9.0-cdh5.5.0/desktop/desktop.db

欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑
 
 
 

同时,大家可以关注我的个人博客

   http://www.cnblogs.com/zlslch/   和     http://www.cnblogs.com/lchzls/      http://www.cnblogs.com/sunnyDream/   

   详情请见:http://www.cnblogs.com/zlslch/p/7473861.html

  人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
  目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获

对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071) 

HUE配置文件hue.ini 的database模块详解(包含qlite、mysql、 psql、和oracle)(图文详解)(分HA集群和非HA集群)的更多相关文章

  1. HUE配置文件hue.ini 的hive和beeswax模块详解(图文详解)(分HA集群和非HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  2. 全网最详细的Windows系统里Oracle 11g R2 Database服务器端(64bit)的下载与安装(图文详解)

    不多说,直接上干货! 环境: windows10系统(64位) 最好先安装jre或jdk(此软件用来打开oracle自带的可视化操作界面,不装也没关系:可以安装plsql,或者直接用命令行操作) Or ...

  3. HUE配置文件hue.ini 的hdfs_clusters模块详解(图文详解)(分HA集群和非HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  4. HUE配置文件hue.ini 的yarn_clusters模块详解(图文详解)(分HA集群和非HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  5. HUE配置文件hue.ini 的hbase模块详解(图文详解)(分HA集群和非HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  6. HUE配置文件hue.ini 的Spark模块详解(图文详解)(分HA集群和HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  7. HUE配置文件hue.ini 的impala模块详解(图文详解)(分HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  8. HUE配置文件hue.ini 的filebrowser模块详解(图文详解)(分HA集群和非HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  9. HUE配置文件hue.ini 的zookeeper模块详解(图文详解)(分HA集群)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

随机推荐

  1. iphone“连接到icloud是出错”的可能原因

    百度没能解决"连接到icloud是出错",突然发现是因为禁止了"设置"访问WIFI和蜂窝网络(第三张图所示). ​

  2. mysql中要根据某个逗号分割的字符串关联查询另一张表的数据

    首先观察下面的查询 select * from company where f_id in ('210','205','208') select * from company where f_id i ...

  3. Go语言的传参和传引用[转]

    目录[-] 传参和传引用的问题 传slice不是传引用! 什么叫传引用? 为什么传slice不是传引用? 为什么很多人误以为slice是传引用呢? 传指针和传引用是等价的吗? 所有类型的函数参数都是传 ...

  4. Windows10+Python3+BeautifulSoup4 安装

    用正则表达式来提取网页中的内容是相当麻烦的,这里介绍一个可以从HTML或XML文件中提取数据的Python库:Beautiful Soup.它能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文档的 ...

  5. spring 3.X与jdk 1.8不兼容

    1.报错(部分) 2.解决 虽然Spring的jdk要求如下,但是spring 3与jdk1.8不兼容(使用的是spring 3.2) 在eclipse将jdk版本下调.这里将JDK调到1.7(在ec ...

  6. Lucene.net 性能《第八篇》

    一.IndexReader性能分析 IndexReader完成了打开所有索引文件和提供底层reader API等繁重的工作,而IndexSearch则要简单得多.由于打开一个IndexReader需要 ...

  7. crosss compile VLC with OpenMAX on ARM board(RockChip RK3399),in order to use Hard Acceleration when decode video

    reference:http://www.x90x90x90.com/en/raspberry-pi-3-howto-compile-vlc-with-hardware-acceleration/ 1 ...

  8. hdu 1205 吃糖果【鸽巢原理】

    题目 这道题不难,看别人博客的时候发现大家都说用鸽巢原理,这是个什么鬼,于是乎百度之. 1.把某种糖果看做隔板,如果某种糖果有n个,那么就有n+1块区域,至少需要n-1块其他种糖果才能使得所有隔板不挨 ...

  9. 无限存储之胖文本数据库TTD(Thick Text Database)

    无限存储之胖文本数据库TTD(Thick Text Database) 阅读:  评论:  作者:Rybby  日期:  来源:rybby.com 所谓的“胖”就是多.大.丰富的意思,像我们平时看到的 ...

  10. ajax如何向后台传递数组,在后台该如何接收的问题(项目积累)

    一.后台如何接收从前台接收的数组: 使用request.getParameterValues(String xxx); <input type="text" name=&qu ...