【转载】Hadoop可视化分析利器之Hue

时间:2025-05-12 21:07:44

http://qindongliang.iteye.com/blog/2212619

先来看下hue的架构图: 
【转载】Hadoop可视化分析利器之Hue

(1)Hue是什么?

Hue是一个可快速开发和调试Hadoop生态系统各种应用的一个基于浏览器的图形化用户接口。

(2)Hue能干什么?

1,访问HDFS和文件浏览 
2,通过web调试和开发hive以及数据结果展示 
3,查询solr和结果展示,报表生成 
4,通过web调试和开发impala交互式SQL Query 
5,spark调试和开发 
6,Pig开发和调试 
7,oozie任务的开发,监控,和工作流协调调度 
8,Hbase数据查询和修改,数据展示 
9,Hive的元数据(metastore)查询 
10,MapReduce任务进度查看,日志追踪 
11,创建和提交MapReduce,Streaming,Java job任务 
12,Sqoop2的开发和调试 
13,Zookeeper的浏览和编辑 
14,数据库(MySQL,PostGres,SQlite,Oracle)的查询和展示

(3)Hue怎么用或者什么时候应该用?

如果你们公司用的是CDH的hadoop,那么很幸运,Hue也是出自CDH公司,自家的东西用起来当然很爽。

如果你们公司用的是Apache Hadoop或者是HDP的hadoop,那么也没事,Hue是开源的,而且支持任何版本的hadoop。

关于什么时候用,这纯属一个锦上添花的功能,你完全可以不用hue,因为各种开源项目都有自己的使用方式和开发接口,hue只不过是统一了各个项目的开发方式在一个接口里而已,这样比较方便而已,不用你一会准备使用hive,就开一个hive的cli终端,一会用pig,你就得开一个pig的grunt,或者你又想查Hbase,又得需要开一个Hbase的shell终端。如果你们使用hadoop生态系统的组件很多的情况下,使用hue还是比较方便的,另外一个好处就是hue提供了一个web的界面来开发和调试任务,不用我们再频繁登陆Linux来操作了。

你可以在任何时候,只要能上网,就可以通过hue来开发和调试数据,不用再装Linux的客户端来远程登陆操作了,这也是B/S架构的好处。

(4)如何下载,安装和编译Hue?

centos系统,执行命令: 
yum install -y asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel  libtidy  libxml2-devel libxslt-devel make mysql mysql-devel openldap-devel python-devel   sqlite-devel openssl-devel  gmp-devel

1,hue的依赖(centos系统)

  1. ant
  2. asciidoc
  3. cyrus-sasl-devel
  4. cyrus-sasl-gssapi
  5. gcc
  6. gcc-c++
  7. krb5-devel
  8. libtidy (for unit tests only)
  9. libxml2-devel
  10. libxslt-devel
  11. make
  12. mvn (from maven package or maven3 tarball)
  13. mysql
  14. mysql-devel
  15. openldap-devel
  16. python-devel
  17. sqlite-devel
  18. openssl-devel (for version 7+)

2,散仙的在安装hue前,centos上已经安装好了,jdk,maven,ant,hadoop,hive,oozie等,环境变量如下:

  1. user="search"
  2. # java
  3. export JAVA_HOME="/usr/local/jdk"
  4. export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
  5. export PATH=$PATH:$JAVA_HOME/bin
  6. # ant
  7. export ANT_HOME=/usr/local/ant
  8. export CLASSPATH=$CLASSPATH:$ANT_HOME/lib
  9. export PATH=$PATH:$ANT_HOME/bin
  10. # maven
  11. export MAVEN_HOME="/usr/local/maven"
  12. export CLASSPATH=$CLASSPATH:$MAVEN_HOME/lib
  13. export PATH=$PATH:$MAVEN_HOME/bin
  14. ##Hadoop2.2的变量设置
  15. export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
  16. export HADOOP_HOME=/home/search/hadoop
  17. export HADOOP_MAPRED_HOME=$HADOOP_HOME
  18. export HADOOP_COMMON_HOME=$HADOOP_HOME
  19. export HADOOP_HDFS_HOME=$HADOOP_HOME
  20. export YARN_HOME=$HADOOP_HOME
  21. export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
  22. export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
  23. export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
  24. export CLASSPATH=.:$CLASSPATH:$HADOOP_COMMON_HOME:$HADOOP_COMMON_HOMEi/lib:$HADOOP_MAPRED_HOME:$HADOOP_HDFS_HOME:$HADOOP_HDFS_HOME
  25. # Hive
  26. export HIVE_HOME=/home/search/hive
  27. export HIVE_CONF_DIR=/home/search/hive/conf
  28. export CLASSPATH=$CLASSPATH:$HIVE_HOME/lib
  29. export PATH=$PATH:$HIVE_HOME/bin:$HIVE_HOME/conf
  30. export OOZIE_HOME="/home/search/oozie-4.1.0"
  31. export PATH=$PATH:$OOZIE_HOME/sbin:$OOZIE_HOME/bin

3,本文散仙主要是采用tar包的方式安装hue,除了tar包的方式,hue还能采用cm安装,当然这就与cdh的系统依赖比较大了。

hue最新的版本是3.8.1,散仙这里用的3.7.0的版本 
下载地址:https://github.com/cloudera/hue/releases

hue的github地址:https://github.com/cloudera/hue

4,下载完后,解压tar包,并进入hue的根目录执行命令 
make apps编译

5,编译成功后,需要配置/home/search/hue/desktop/conf/pseudo-distributed.ini文件,里面包含了hdfs,yarn,mapreduce,hive,oozie,pig,spark,solr等的ip地址和端口号配置,可根据自己的情况设置,如果没有安装某个应用,那就无须配置,只不过这个应用在web上不能使用而已,并不会影响其他框架的使用。

一个例子如下:

  1. #####################################
  2. # DEVELOPMENT EDITION
  3. #####################################
  4. # Hue configuration file
  5. # ===================================
  6. #
  7. # For complete documentation about the contents of this file, run
  8. #       $ <hue_root>/build/env/bin/hue config_help
  9. #
  10. # All .ini files under the current directory are treated equally.  Their
  11. # contents are merged to form the Hue configuration, which can
  12. # can be viewed on the Hue at
  13. #       http://<hue_host>:<port>/dump_config
  14. ###########################################################################
  15. # General configuration for core Desktop features (authentication, etc)
  16. ###########################################################################
  17. [desktop]
  18. send_dbug_messages=1
  19. # To show database transactions, set database_logging to 1
  20. database_logging=0
  21. # Set this to a random string, the longer the better.
  22. # This is used for secure hashing in the session store.
  23. secret_key=search
  24. # Webserver listens on this address and port
  25. http_host=0.0.0.0
  26. http_port=8000
  27. # Time zone name
  28. time_zone=Asia/Shanghai
  29. # Enable or disable Django debug mode
  30. ## django_debug_mode=true
  31. # Enable or disable backtrace for server error
  32. ## http_500_debug_mode=true
  33. # Enable or disable memory profiling.
  34. ## memory_profiler=false
  35. # Server email for internal error messages
  36. ## django_server_email='hue@localhost.localdomain'
  37. # Email backend
  38. ## django_email_backend=django.core.mail.backends.smtp.EmailBackend
  39. # Webserver runs as this user
  40. server_user=search
  41. server_group=search
  42. # This should be the Hue admin and proxy user
  43. default_user=search
  44. # This should be the hadoop cluster admin
  45. default_hdfs_superuser=search
  46. # If set to false, runcpserver will not actually start the web server.
  47. # Used if Apache is being used as a WSGI container.
  48. ## enable_server=yes
  49. # Number of threads used by the CherryPy web server
  50. ## cherrypy_server_threads=10
  51. # Filename of SSL Certificate
  52. ## ssl_certificate=
  53. # Filename of SSL RSA Private Key
  54. ## ssl_private_key=
  55. # List of allowed and disallowed ciphers in cipher list format.
  56. # See http://www.openssl.org/docs/apps/ciphers.html for more information on cipher list format.
  57. ## ssl_cipher_list=DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2
  58. # LDAP username and password of the hue user used for LDAP authentications.
  59. # Set it to use LDAP Authentication with HiveServer2 and Impala.
  60. ## ldap_username=hue
  61. ## ldap_password=
  62. # Default encoding for site data
  63. ## default_site_encoding=utf-8
  64. # Help improve Hue with anonymous usage analytics.
  65. # Use Google Analytics to see how many times an application or specific section of an application is used, nothing more.
  66. ## collect_usage=true
  67. # Support for HTTPS termination at the load-balancer level with SECURE_PROXY_SSL_HEADER.
  68. ## secure_proxy_ssl_header=false
  69. # Comma-separated list of Django middleware classes to use.
  70. # See https://docs.djangoproject.com/en/1.4/ref/middleware/ for more details on middlewares in Django.
  71. ## middleware=desktop.auth.backend.LdapSynchronizationBackend
  72. # Comma-separated list of regular expressions, which match the redirect URL.
  73. # For example, to restrict to your local domain and FQDN, the following value can be used:
  74. # ^\/.*$,^http:\/\/www.mydomain.com\/.*$
  75. ## redirect_whitelist=
  76. # Comma separated list of apps to not load at server startup.
  77. # e.g.: pig,zookeeper
  78. ## app_blacklist=
  79. # The directory where to store the auditing logs. Auditing is disable if the value is empty.
  80. # e.g. /var/log/hue/audit.log
  81. ## audit_event_log_dir=
  82. # Size in KB/MB/GB for audit log to rollover.
  83. ## audit_log_max_file_size=100MB
  84. #poll_enabled=false
  85. # Administrators
  86. # ----------------
  87. [[django_admins]]
  88. ## [[[admin1]]]
  89. ## name=john
  90. ## email=john@doe.com
  91. # UI customizations
  92. # -------------------
  93. [[custom]]
  94. # Top banner HTML code
  95. #banner_top_html=Search Team Hadoop Manager
  96. # Configuration options for user authentication into the web application
  97. # ------------------------------------------------------------------------
  98. [[auth]]
  99. # Authentication backend. Common settings are:
  100. # - django.contrib.auth.backends.ModelBackend (entirely Django backend)
  101. # - desktop.auth.backend.AllowAllBackend (allows everyone)
  102. # - desktop.auth.backend.AllowFirstUserDjangoBackend
  103. #     (Default. Relies on Django and user manager, after the first login)
  104. # - desktop.auth.backend.LdapBackend
  105. # - desktop.auth.backend.PamBackend
  106. # - desktop.auth.backend.SpnegoDjangoBackend
  107. # - desktop.auth.backend.RemoteUserDjangoBackend
  108. # - libsaml.backend.SAML2Backend
  109. # - libopenid.backend.OpenIDBackend
  110. # - liboauth.backend.OAuthBackend
  111. #     (New oauth, support Twitter, Facebook, Google+ and Linkedin
  112. ## backend=desktop.auth.backend.AllowFirstUserDjangoBackend
  113. # The service to use when querying PAM.
  114. ## pam_service=login
  115. # When using the desktop.auth.backend.RemoteUserDjangoBackend, this sets
  116. # the normalized name of the header that contains the remote user.
  117. # The HTTP header in the request is converted to a key by converting
  118. # all characters to uppercase, replacing any hyphens with underscores
  119. # and adding an HTTP_ prefix to the name. So, for example, if the header
  120. # is called Remote-User that would be configured as HTTP_REMOTE_USER
  121. #
  122. # Defaults to HTTP_REMOTE_USER
  123. ## remote_user_header=HTTP_REMOTE_USER
  124. # Ignore the case of usernames when searching for existing users.
  125. # Only supported in remoteUserDjangoBackend.
  126. ## ignore_username_case=false
  127. # Ignore the case of usernames when searching for existing users to authenticate with.
  128. # Only supported in remoteUserDjangoBackend.
  129. ## force_username_lowercase=false
  130. # Users will expire after they have not logged in for 'n' amount of seconds.
  131. # A negative number means that users will never expire.
  132. ## expires_after=-1
  133. # Apply 'expires_after' to superusers.
  134. ## expire_superusers=true
  135. # Configuration options for connecting to LDAP and Active Directory
  136. # -------------------------------------------------------------------
  137. [[ldap]]
  138. # The search base for finding users and groups
  139. ## base_dn="DC=mycompany,DC=com"
  140. # URL of the LDAP server
  141. ## ldap_url=ldap://auth.mycompany.com
  142. # A PEM-format file containing certificates for the CA's that
  143. # Hue will trust for authentication over TLS.
  144. # The certificate for the CA that signed the
  145. # LDAP server certificate must be included among these certificates.
  146. # See more here http://www.openldap.org/doc/admin24/tls.html.
  147. ## ldap_cert=
  148. ## use_start_tls=true
  149. # Distinguished name of the user to bind as -- not necessary if the LDAP server
  150. # supports anonymous searches
  151. ## bind_dn="CN=ServiceAccount,DC=mycompany,DC=com"
  152. # Password of the bind user -- not necessary if the LDAP server supports
  153. # anonymous searches
  154. ## bind_password=
  155. # Pattern for searching for usernames -- Use <username> for the parameter
  156. # For use when using LdapBackend for Hue authentication
  157. ## ldap_username_pattern="uid=<username>,ou=People,dc=mycompany,dc=com"
  158. # Create users in Hue when they try to login with their LDAP credentials
  159. # For use when using LdapBackend for Hue authentication
  160. ## create_users_on_login = true
  161. # Synchronize a users groups when they login
  162. ## sync_groups_on_login=false
  163. # Ignore the case of usernames when searching for existing users in Hue.
  164. ## ignore_username_case=false
  165. # Force usernames to lowercase when creating new users from LDAP.
  166. ## force_username_lowercase=false
  167. # Use search bind authentication.
  168. ## search_bind_authentication=true
  169. # Choose which kind of subgrouping to use: nested or suboordinate (deprecated).
  170. ## subgroups=suboordinate
  171. # Define the number of levels to search for nested members.
  172. ## nested_members_search_depth=10
  173. [[[users]]]
  174. # Base filter for searching for users
  175. ## user_filter="objectclass=*"
  176. # The username attribute in the LDAP schema
  177. ## user_name_attr=sAMAccountName
  178. [[[groups]]]
  179. # Base filter for searching for groups
  180. ## group_filter="objectclass=*"
  181. # The username attribute in the LDAP schema
  182. ## group_name_attr=cn
  183. [[[ldap_servers]]]
  184. ## [[[[mycompany]]]]
  185. # The search base for finding users and groups
  186. ## base_dn="DC=mycompany,DC=com"
  187. # URL of the LDAP server
  188. ## ldap_url=ldap://auth.mycompany.com
  189. # A PEM-format file containing certificates for the CA's that
  190. # Hue will trust for authentication over TLS.
  191. # The certificate for the CA that signed the
  192. # LDAP server certificate must be included among these certificates.
  193. # See more here http://www.openldap.org/doc/admin24/tls.html.
  194. ## ldap_cert=
  195. ## use_start_tls=true
  196. # Distinguished name of the user to bind as -- not necessary if the LDAP server
  197. # supports anonymous searches
  198. ## bind_dn="CN=ServiceAccount,DC=mycompany,DC=com"
  199. # Password of the bind user -- not necessary if the LDAP server supports
  200. # anonymous searches
  201. ## bind_password=
  202. # Pattern for searching for usernames -- Use <username> for the parameter
  203. # For use when using LdapBackend for Hue authentication
  204. ## ldap_username_pattern="uid=<username>,ou=People,dc=mycompany,dc=com"
  205. ## Use search bind authentication.
  206. ## search_bind_authentication=true
  207. ## [[[[[users]]]]]
  208. # Base filter for searching for users
  209. ## user_filter="objectclass=Person"
  210. # The username attribute in the LDAP schema
  211. ## user_name_attr=sAMAccountName
  212. ## [[[[[groups]]]]]
  213. # Base filter for searching for groups
  214. ## group_filter="objectclass=groupOfNames"
  215. # The username attribute in the LDAP schema
  216. ## group_name_attr=cn
  217. # Configuration options for specifying the Desktop Database. For more info,
  218. # see http://docs.djangoproject.com/en/1.4/ref/settings/#database-engine
  219. # ------------------------------------------------------------------------
  220. [[database]]
  221. # Database engine is typically one of:
  222. # postgresql_psycopg2, mysql, sqlite3 or oracle.
  223. #
  224. # Note that for sqlite3, 'name', below is a a path to the filename. For other backends, it is the database name.
  225. # Note for Oracle, options={'threaded':true} must be set in order to avoid crashes.
  226. # Note for Oracle, you can use the Oracle Service Name by setting "port=0" and then "name=<host>:<port>/<service_name>".
  227. ## engine=sqlite3
  228. ## host=
  229. ## port=
  230. ## user=
  231. ## password=
  232. ## name=desktop/desktop.db
  233. ## options={}
  234. # Configuration options for specifying the Desktop session.
  235. # For more info, see https://docs.djangoproject.com/en/1.4/topics/http/sessions/
  236. # ------------------------------------------------------------------------
  237. [[session]]
  238. # The cookie containing the users' session ID will expire after this amount of time in seconds.
  239. # Default is 2 weeks.
  240. ## ttl=1209600
  241. # The cookie containing the users' session ID will be secure.
  242. # Should only be enabled with HTTPS.
  243. ## secure=false
  244. # The cookie containing the users' session ID will use the HTTP only flag.
  245. ## http_only=false
  246. # Use session-length cookies. Logs out the user when she closes the browser window.
  247. ## expire_at_browser_close=false
  248. # Configuration options for connecting to an external SMTP server
  249. # ------------------------------------------------------------------------
  250. [[smtp]]
  251. # The SMTP server information for email notification delivery
  252. host=localhost
  253. port=25
  254. user=
  255. password=
  256. # Whether to use a TLS (secure) connection when talking to the SMTP server
  257. tls=no
  258. # Default email address to use for various automated notification from Hue
  259. ## default_from_email=hue@localhost
  260. # Configuration options for Kerberos integration for secured Hadoop clusters
  261. # ------------------------------------------------------------------------
  262. [[kerberos]]
  263. # Path to Hue's Kerberos keytab file
  264. ## hue_keytab=
  265. # Kerberos principal name for Hue
  266. ## hue_principal=hue/hostname.foo.com
  267. # Path to kinit
  268. ## kinit_path=/path/to/kinit
  269. # Configuration options for using OAuthBackend (Core) login
  270. # ------------------------------------------------------------------------
  271. [[oauth]]
  272. # The Consumer key of the application
  273. ## consumer_key=XXXXXXXXXXXXXXXXXXXXX
  274. # The Consumer secret of the application
  275. ## consumer_secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  276. # The Request token URL
  277. ## request_token_url=https://api.twitter.com/oauth/request_token
  278. # The Access token URL
  279. ## access_token_url=https://api.twitter.com/oauth/access_token
  280. # The Authorize URL
  281. ## authenticate_url=https://api.twitter.com/oauth/authorize
  282. ###########################################################################
  283. # Settings to configure SAML
  284. ###########################################################################
  285. [libsaml]
  286. # Xmlsec1 binary path. This program should be executable by the user running Hue.
  287. ## xmlsec_binary=/usr/local/bin/xmlsec1
  288. # Entity ID for Hue acting as service provider.
  289. # Can also accept a pattern where '<base_url>' will be replaced with server URL base.
  290. ## entity_id="<base_url>/saml2/metadata/"
  291. # Create users from SSO on login.
  292. ## create_users_on_login=true
  293. # Required attributes to ask for from IdP.
  294. # This requires a comma separated list.
  295. ## required_attributes=uid
  296. # Optional attributes to ask for from IdP.
  297. # This requires a comma separated list.
  298. ## optional_attributes=
  299. # IdP metadata in the form of a file. This is generally an XML file containing metadata that the Identity Provider generates.
  300. ## metadata_file=
  301. # Private key to encrypt metadata with.
  302. ## key_file=
  303. # Signed certificate to send along with encrypted metadata.
  304. ## cert_file=
  305. # A mapping from attributes in the response from the IdP to django user attributes.
  306. ## user_attribute_mapping={'uid':'username'}
  307. # Have Hue initiated authn requests be signed and provide a certificate.
  308. ## authn_requests_signed=false
  309. # Have Hue initiated logout requests be signed and provide a certificate.
  310. ## logout_requests_signed=false
  311. # Username can be sourced from 'attributes' or 'nameid'.
  312. ## username_source=attributes
  313. # Performs the logout or not.
  314. ## logout_enabled=true
  315. ###########################################################################
  316. # Settings to configure OpenId
  317. ###########################################################################
  318. [libopenid]
  319. # (Required) OpenId SSO endpoint url.
  320. ## server_endpoint_url=https://www.google.com/accounts/o8/id
  321. # OpenId 1.1 identity url prefix to be used instead of SSO endpoint url
  322. # This is only supported if you are using an OpenId 1.1 endpoint
  323. ## identity_url_prefix=https://app.onelogin.com/openid/your_company.com/
  324. # Create users from OPENID on login.
  325. ## create_users_on_login=true
  326. # Use email for username
  327. ## use_email_for_username=true
  328. ###########################################################################
  329. # Settings to configure OAuth
  330. ###########################################################################
  331. [liboauth]
  332. # NOTE:
  333. # To work, each of the active (i.e. uncommented) service must have
  334. # applications created on the social network.
  335. # Then the "consumer key" and "consumer secret" must be provided here.
  336. #
  337. # The addresses where to do so are:
  338. # Twitter:  https://dev.twitter.com/apps
  339. # Google+ : https://cloud.google.com/
  340. # Facebook: https://developers.facebook.com/apps
  341. # Linkedin: https://www.linkedin.com/secure/developer
  342. #
  343. # Additionnaly, the following must be set in the application settings:
  344. # Twitter:  Callback URL (aka Redirect URL) must be set to http://YOUR_HUE_IP_OR_DOMAIN_NAME/oauth/social_login/oauth_authenticated
  345. # Google+ : CONSENT SCREEN must have email address
  346. # Facebook: Sandbox Mode must be DISABLED
  347. # Linkedin: "In OAuth User Agreement", r_emailaddress is REQUIRED
  348. # The Consumer key of the application
  349. ## consumer_key_twitter=
  350. ## consumer_key_google=
  351. ## consumer_key_facebook=
  352. ## consumer_key_linkedin=
  353. # The Consumer secret of the application
  354. ## consumer_secret_twitter=
  355. ## consumer_secret_google=
  356. ## consumer_secret_facebook=
  357. ## consumer_secret_linkedin=
  358. # The Request token URL
  359. ## request_token_url_twitter=https://api.twitter.com/oauth/request_token
  360. ## request_token_url_google=https://accounts.google.com/o/oauth2/auth
  361. ## request_token_url_linkedin=https://www.linkedin.com/uas/oauth2/authorization
  362. ## request_token_url_facebook=https://graph.facebook.com/oauth/authorize
  363. # The Access token URL
  364. ## access_token_url_twitter=https://api.twitter.com/oauth/access_token
  365. ## access_token_url_google=https://accounts.google.com/o/oauth2/token
  366. ## access_token_url_facebook=https://graph.facebook.com/oauth/access_token
  367. ## access_token_url_linkedin=https://api.linkedin.com/uas/oauth2/accessToken
  368. # The Authenticate URL
  369. ## authenticate_url_twitter=https://api.twitter.com/oauth/authorize
  370. ## authenticate_url_google=https://www.googleapis.com/oauth2/v1/userinfo?access_token=
  371. ## authenticate_url_facebook=https://graph.facebook.com/me?access_token=
  372. ## authenticate_url_linkedin=https://api.linkedin.com/v1/people/~:(email-address)?format=json&oauth2_access_token=
  373. # Username Map. Json Hash format.
  374. # Replaces username parts in order to simplify usernames obtained
  375. # Example: {"@sub1.domain.com":"_S1", "@sub2.domain.com":"_S2"}
  376. # converts 'email@sub1.domain.com' to 'email_S1'
  377. ## username_map={}
  378. # Whitelisted domains (only applies to Google OAuth). CSV format.
  379. ## whitelisted_domains_google=
  380. ###########################################################################
  381. # Settings for the RDBMS application
  382. ###########################################################################
  383. [librdbms]
  384. # The RDBMS app can have any number of databases configured in the databases
  385. # section. A database is known by its section name
  386. # (IE sqlite, mysql, psql, and oracle in the list below).
  387. [[databases]]
  388. # sqlite configuration.
  389. ## [[[sqlite]]]
  390. # Name to show in the UI.
  391. ## nice_name=SQLite
  392. # For SQLite, name defines the path to the database.
  393. ## name=/tmp/sqlite.db
  394. # Database backend to use.
  395. ## engine=sqlite
  396. # Database options to send to the server when connecting.
  397. # https://docs.djangoproject.com/en/1.4/ref/databases/
  398. ## options={}
  399. # mysql, oracle, or postgresql configuration.
  400. ## [[[mysql]]]
  401. # Name to show in the UI.
  402. ## nice_name="My SQL DB"
  403. # For MySQL and PostgreSQL, name is the name of the database.
  404. # For Oracle, Name is instance of the Oracle server. For express edition
  405. # this is 'xe' by default.
  406. ## name=mysqldb
  407. # Database backend to use. This can be:
  408. # 1. mysql
  409. # 2. postgresql
  410. # 3. oracle
  411. ## engine=mysql
  412. # IP or hostname of the database to connect to.
  413. ## host=localhost
  414. # Port the database server is listening to. Defaults are:
  415. # 1. MySQL: 3306
  416. # 2. PostgreSQL: 5432
  417. # 3. Oracle Express Edition: 1521
  418. ## port=3306
  419. # Username to authenticate with when connecting to the database.
  420. ## user=example
  421. # Password matching the username to authenticate with when
  422. # connecting to the database.
  423. ## password=example
  424. # Database options to send to the server when connecting.
  425. # https://docs.djangoproject.com/en/1.4/ref/databases/
  426. ## options={}
  427. ###########################################################################
  428. # Settings to configure your Hadoop cluster.
  429. ###########################################################################
  430. [hadoop]
  431. # Configuration for HDFS NameNode
  432. # ------------------------------------------------------------------------
  433. [[hdfs_clusters]]
  434. # HA support by using HttpFs
  435. [[[default]]]
  436. # Enter the filesystem uri
  437. fs_defaultfs=hdfs://h1:8020
  438. # NameNode logical name.
  439. logical_name=h1
  440. # Use WebHdfs/HttpFs as the communication mechanism.
  441. # Domain should be the NameNode or HttpFs host.
  442. # Default port is 14000 for HttpFs.
  443. webhdfs_url=http://h1:50070/webhdfs/v1
  444. # Change this if your HDFS cluster is Kerberos-secured
  445. security_enabled=false
  446. # Default umask for file and directory creation, specified in an octal value.
  447. umask=022
  448. hadoop_conf_dir=/home/search/hadoop/etc/hadoop
  449. # Configuration for YARN (MR2)
  450. # ------------------------------------------------------------------------
  451. [[yarn_clusters]]
  452. [[[default]]]
  453. # Enter the host on which you are running the ResourceManager
  454. resourcemanager_host=h1
  455. # The port where the ResourceManager IPC listens on
  456. resourcemanager_port=8032
  457. # Whether to submit jobs to this cluster
  458. submit_to=True
  459. # Resource Manager logical name (required for HA)
  460. ## logical_name=
  461. # Change this if your YARN cluster is Kerberos-secured
  462. ## security_enabled=false
  463. # URL of the ResourceManager API
  464. resourcemanager_api_url=http://h1:8088
  465. # URL of the ProxyServer API
  466. proxy_api_url=http://h1:8088
  467. # URL of the HistoryServer API
  468. history_server_api_url=http://h1:19888
  469. # HA support by specifying multiple clusters
  470. # e.g.
  471. # [[[ha]]]
  472. # Resource Manager logical name (required for HA)
  473. ## logical_name=my-rm-name
  474. # Configuration for MapReduce (MR1)
  475. # ------------------------------------------------------------------------
  476. [[mapred_clusters]]
  477. [[[default]]]
  478. # Enter the host on which you are running the Hadoop JobTracker
  479. jobtracker_host=h1
  480. # The port where the JobTracker IPC listens on
  481. #jobtracker_port=8021
  482. # JobTracker logical name for HA
  483. ## logical_name=
  484. # Thrift plug-in port for the JobTracker
  485. ## thrift_port=9290
  486. # Whether to submit jobs to this cluster
  487. submit_to=False
  488. # Change this if your MapReduce cluster is Kerberos-secured
  489. ## security_enabled=false
  490. # HA support by specifying multiple clusters
  491. # e.g.
  492. # [[[ha]]]
  493. # Enter the logical name of the JobTrackers
  494. # logical_name=my-jt-name
  495. ###########################################################################
  496. # Settings to configure the Filebrowser app
  497. ###########################################################################
  498. [filebrowser]
  499. # Location on local filesystem where the uploaded archives are temporary stored.
  500. ## archive_upload_tempdir=/tmp
  501. ###########################################################################
  502. # Settings to configure liboozie
  503. ###########################################################################
  504. [liboozie]
  505. # The URL where the Oozie service runs on. This is required in order for
  506. # users to submit jobs. Empty value disables the config check.
  507. ## oozie_url=http://localhost:11000/oozie
  508. oozie_url=http://h1:11000/oozie
  509. # Requires FQDN in oozie_url if enabled
  510. ## security_enabled=false
  511. # Location on HDFS where the workflows/coordinator are deployed when submitted.
  512. remote_deployement_dir=/user/hue/oozie/deployments
  513. ###########################################################################
  514. # Settings to configure the Oozie app
  515. ###########################################################################
  516. [oozie]
  517. # Location on local FS where the examples are stored.
  518. local_data_dir=apps/oozie/examples/
  519. # Location on local FS where the data for the examples is stored.
  520. ## sample_data_dir=...thirdparty/sample_data
  521. # Location on HDFS where the oozie examples and workflows are stored.
  522. remote_data_dir=apps/oozie/workspaces
  523. # Maximum of Oozie workflows or coodinators to retrieve in one API call.
  524. oozie_jobs_count=100
  525. # Use Cron format for defining the frequency of a Coordinator instead of the old frequency number/unit.
  526. ## enable_cron_scheduling=true
  527. enable_cron_scheduling=true
  528. ###########################################################################
  529. # Settings to configure Beeswax with Hive
  530. ###########################################################################
  531. [beeswax]
  532. # Host where HiveServer2 is running.
  533. # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
  534. hive_server_host=h1
  535. # Port where HiveServer2 Thrift server runs on.
  536. hive_server_port=10000
  537. # Hive configuration directory, where hive-site.xml is located
  538. hive_conf_dir=/home/search/hive/conf
  539. # Timeout in seconds for thrift calls to Hive service
  540. server_conn_timeout=120
  541. # Set a LIMIT clause when browsing a partitioned table.
  542. # A positive value will be set as the LIMIT. If 0 or negative, do not set any limit.
  543. browse_partitioned_table_limit=250
  544. # A limit to the number of rows that can be downloaded from a query.
  545. # A value of -1 means there will be no limit.
  546. # A maximum of 65,000 is applied to XLS downloads.
  547. download_row_limit=1000000
  548. # Hue will try to close the Hive query when the user leaves the editor page.
  549. # This will free all the query resources in HiveServer2, but also make its results inaccessible.
  550. ## close_queries=false
  551. # Thrift version to use when communicating with HiveServer2
  552. ## thrift_version=5
  553. [[ssl]]
  554. # SSL communication enabled for this server.
  555. ## enabled=false
  556. # Path to Certificate Authority certificates.
  557. ## cacerts=/etc/hue/cacerts.pem
  558. # Path to the private key file.
  559. ## key=/etc/hue/key.pem
  560. # Path to the public certificate file.
  561. ## cert=/etc/hue/cert.pem
  562. # Choose whether Hue should validate certificates received from the server.
  563. ## validate=true
  564. ###########################################################################
  565. # Settings to configure Pig
  566. ###########################################################################
  567. [pig]
  568. # Location of piggybank.jar on local filesystem.
  569. local_sample_dir=/home/search/hue/apps/pig/examples
  570. # Location piggybank.jar will be copied to in HDFS.
  571. remote_data_dir=/home/search/pig/examples
  572. ###########################################################################
  573. # Settings to configure Sqoop
  574. ###########################################################################
  575. [sqoop]
  576. # For autocompletion, fill out the librdbms section.
  577. # Sqoop server URL
  578. server_url=http://h1:12000/sqoop
  579. ###########################################################################
  580. # Settings to configure Proxy
  581. ###########################################################################
  582. [proxy]
  583. # Comma-separated list of regular expressions,
  584. # which match 'host:port' of requested proxy target.
  585. ## whitelist=(localhost|127\.0\.0\.1):(50030|50070|50060|50075)
  586. # Comma-separated list of regular expressions,
  587. # which match any prefix of 'host:port/path' of requested proxy target.
  588. # This does not support matching GET parameters.
  589. ## blacklist=
  590. ###########################################################################
  591. # Settings to configure Impala
  592. ###########################################################################
  593. [impala]
  594. # Host of the Impala Server (one of the Impalad)
  595. ## server_host=localhost
  596. # Port of the Impala Server
  597. ## server_port=21050
  598. # Kerberos principal
  599. ## impala_principal=impala/hostname.foo.com
  600. # Turn on/off impersonation mechanism when talking to Impala
  601. ## impersonation_enabled=False
  602. # Number of initial rows of a result set to ask Impala to cache in order
  603. # to support re-fetching them for downloading them.
  604. # Set to 0 for disabling the option and backward compatibility.
  605. ## querycache_rows=50000
  606. # Timeout in seconds for thrift calls
  607. ## server_conn_timeout=120
  608. # Hue will try to close the Impala query when the user leaves the editor page.
  609. # This will free all the query resources in Impala, but also make its results inaccessible.
  610. ## close_queries=true
  611. # If QUERY_TIMEOUT_S > 0, the query will be timed out (i.e. cancelled) if Impala does not do any work
  612. # (compute or send back results) for that query within QUERY_TIMEOUT_S seconds.
  613. ## query_timeout_s=600
  614. ###########################################################################
  615. # Settings to configure HBase Browser
  616. ###########################################################################
  617. [hbase]
  618. # Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'.
  619. # Use full hostname with security.
  620. ## hbase_clusters=(Cluster|localhost:9090)
  621. # HBase configuration directory, where hbase-site.xml is located.
  622. ## hbase_conf_dir=/etc/hbase/conf
  623. # Hard limit of rows or columns per row fetched before truncating.
  624. ## truncate_limit = 500
  625. # 'buffered' is the default of the HBase Thrift Server and supports security.
  626. # 'framed' can be used to chunk up responses,
  627. # which is useful when used in conjunction with the nonblocking server in Thrift.
  628. ## thrift_transport=buffered
  629. ###########################################################################
  630. # Settings to configure Solr Search
  631. ###########################################################################
  632. [search]
  633. # URL of the Solr Server
  634. solr_url=http://172.21.50.41:8983/solr/
  635. # Requires FQDN in solr_url if enabled
  636. ## security_enabled=false
  637. ## Query sent when no term is entered
  638. ## empty_query=*:*
  639. ###########################################################################
  640. # Settings to configure Solr Indexer
  641. ###########################################################################
  642. [indexer]
  643. # Location of the solrctl binary.
  644. ## solrctl_path=/usr/bin/solrctl
  645. # Location of the solr home.
  646. ## solr_home=/usr/lib/solr
  647. # Zookeeper ensemble.
  648. ## solr_zk_ensemble=localhost:2181/solr
  649. # The contents of this directory will be copied over to the solrctl host to its temporary directory.
  650. ## config_template_path=/../hue/desktop/libs/indexer/src/data/solr_configs
  651. ###########################################################################
  652. # Settings to configure Job Designer
  653. ###########################################################################
  654. [jobsub]
  655. # Location on local FS where examples and template are stored.
  656. ## local_data_dir=..../data
  657. # Location on local FS where sample data is stored
  658. ## sample_data_dir=...thirdparty/sample_data
  659. ###########################################################################
  660. # Settings to configure Job Browser
  661. ###########################################################################
  662. [jobbrowser]
  663. # Share submitted jobs information with all users. If set to false,
  664. # submitted jobs are visible only to the owner and administrators.
  665. ## share_jobs=true
  666. ###########################################################################
  667. # Settings to configure the Zookeeper application.
  668. ###########################################################################
  669. [zookeeper]
  670. [[clusters]]
  671. [[[default]]]
  672. # Zookeeper ensemble. Comma separated list of Host/Port.
  673. # e.g. localhost:2181,localhost:2182,localhost:2183
  674. host_ports=zk1:2181
  675. # The URL of the REST contrib service (required for znode browsing)
  676. ## rest_url=http://localhost:9998
  677. ###########################################################################
  678. # Settings to configure the Spark application.
  679. ###########################################################################
  680. [spark]
  681. # URL of the REST Spark Job Server.
  682. server_url=http://h1:8080/
  683. ###########################################################################
  684. # Settings for the User Admin application
  685. ###########################################################################
  686. [useradmin]
  687. # The name of the default user group that users will be a member of
  688. ## default_user_group=default
  689. ###########################################################################
  690. # Settings for the Sentry lib
  691. ###########################################################################
  692. [libsentry]
  693. # Hostname or IP of server.
  694. ## hostname=localhost
  695. # Port the sentry service is running on.
  696. ## port=8038
  697. # Sentry configuration directory, where sentry-site.xml is located.
  698. ## sentry_conf_dir=/etc/sentry/conf

编译好的目录如下:

  1. -rw-rw-r--  1 search search  2782 5月  19 06:04 app.reg
  2. -rw-rw-r--  1 search search  2782 5月  19 05:41 app.reg.bak
  3. drwxrwxr-x 22 search search  4096 5月  20 01:05 apps
  4. drwxrwxr-x  3 search search  4096 5月  19 05:41 build
  5. drwxr-xr-x  2 search search  4096 5月  19 05:40 data
  6. drwxrwxr-x  7 search search  4096 5月  20 01:29 desktop
  7. drwxrwxr-x  2 search search  4096 5月  19 05:41 dist
  8. drwxrwxr-x  7 search search  4096 5月  19 05:40 docs
  9. drwxrwxr-x  3 search search  4096 5月  19 05:40 ext
  10. -rw-rw-r--  1 search search 11358 5月  19 05:38 LICENSE.txt
  11. drwxrwxr-x  2 search search  4096 5月  20 01:29 logs
  12. -rw-rw-r--  1 search search  8121 5月  19 05:41 Makefile
  13. -rw-rw-r--  1 search search  8505 5月  19 05:41 Makefile.sdk
  14. -rw-rw-r--  1 search search  3093 5月  19 05:40 Makefile.tarball
  15. -rw-rw-r--  1 search search  3498 5月  19 05:41 Makefile.vars
  16. -rw-rw-r--  1 search search  2302 5月  19 05:41 Makefile.vars.priv
  17. drwxrwxr-x  2 search search  4096 5月  19 05:41 maven
  18. -rw-rw-r--  1 search search   801 5月  19 05:40 NOTICE.txt
  19. -rw-rw-r--  1 search search  4733 5月  19 05:41 README.rst
  20. -rw-rw-r--  1 search search    52 5月  19 05:38 start.sh
  21. -rw-rw-r--  1 search search    65 5月  19 05:41 stop.sh
  22. drwxrwxr-x  9 search search  4096 5月  19 05:38 tools
  23. -rw-rw-r--  1 search search   932 5月  19 05:41 VERSION

6,启动hue,执行命令:build/env/bin/supervisor

  1. [search@h1 hue]$ build/env/bin/supervisor
  2. [INFO] Not running as root, skipping privilege drop
  3. starting server with options {'ssl_certificate': None, 'workdir': None, 'server_name': 'localhost', 'host': '0.0.0.0', 'daemonize': False, 'threads': 10, 'pidfile': None, 'ssl_private_key': None, 'server_group': 'search', 'ssl_cipher_list': 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2', 'port': 8000, 'server_user': 'search'}

然后我们就可以访问安装机ip+8000端口来查看了:

【转载】Hadoop可视化分析利器之Hue

工具箱界面: 
【转载】Hadoop可视化分析利器之Hue
hive的界面:

【转载】Hadoop可视化分析利器之Hue

在配置hive(散仙这里是0.13的版本)的时候,需要注意以下几个方面:

hive的metastrore的服务和hiveserver2服务都需要启动 
执行下面命令 
bin/hive --service metastore 
bin/hiveserver2 
除此之外,还需要关闭的hive的SAL认证,否则,使用hue访问会出现问题。 
注意下面三项的配置

  1. <property>
  2. <name>hive.metastore.warehouse.dir</name>
  3. <value>/user/hive/warehouse</value>
  4. <description>location of default database for the warehouse</description>
  5. </property>
  6. <property>
  7. <name>hive.server2.thrift.port</name>
  8. <value>10000</value>
  9. <description>Port number of HiveServer2 Thrift interface.
  10. Can be overridden by setting $HIVE_SERVER2_THRIFT_PORT</description>
  11. </property>
  12. <property>
  13. <name>hive.server2.thrift.bind.host</name>
  14. <value>h1</value>
  15. <description>Bind host on which to run the HiveServer2 Thrift interface.
  16. Can be overridden by setting $HIVE_SERVER2_THRIFT_BIND_HOST</description>
  17. </property>
  18. <property>
  19. <name>hive.server2.authentication</name>
  20. <value>NOSASL</value>
  21. <description>
  22. Client authentication types.
  23. NONE: no authentication check
  24. LDAP: LDAP/AD based authentication
  25. KERBEROS: Kerberos/GSSAPI authentication
  26. CUSTOM: Custom authentication provider
  27. (Use with property hive.server2.custom.authentication.class)
  28. PAM: Pluggable authentication module.
  29. </description>
  30. </property>

除了上面的配置外,还需要把hive.server2.long.polling.timeout的参数值,默认是5000L给改成5000,否则使用beenline连接时候,会出错,这是hive的一个bug。

pig的界面:

【转载】Hadoop可视化分析利器之Hue
solr的界面如下:

【转载】Hadoop可视化分析利器之Hue

最后需要注意一点,hue也需要在hadoop的core-site.xml里面配置相应的代理用户,示例如下:

  1. <property>
  2. <name>hadoop.proxyuser.hue.hosts</name>
  3. <value>*</value>
  4. </property>
  5. <property>
  6. <name>hadoop.proxyuser.hue.groups</name>
  7. <value>*</value>
  8. </property>

ok至此,我们的hue已经能完美工作了,我们可以根据自己的需要,定制相应的app插件,非常灵活!