manual.txt 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. Hue Installation Guide
  2. ======================
  3. Introduction
  4. ------------
  5. Hue is a graphical user interface to operate and develop applications for
  6. Apache Hadoop. Hue applications are collected into a desktop-style environment
  7. and delivered as a Web application, requiring no additional installation for
  8. individual users.
  9. This guide describes how to install and configure a Hue tarball. For
  10. information about installing Hue packages, see
  11. http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-Installation-Guide/cdh5ig_cdh_hue_configure.html[Installing Hue].
  12. There is also a companion SDK guide that describes how to develop
  13. new Hue applications:
  14. link:sdk/sdk.html[Hue SDK Documentation]
  15. .Conventions Used in this Guide:
  16. * Commands that must be run with +root+ permission have a +#+ command prompt.
  17. * Commands that do not require +root+ permission have a +$+ command prompt.
  18. Hue Installation Instructions
  19. -----------------------------
  20. The following instructions describe how to install the Hue tarball on a
  21. multi-node cluster. You need to also install Hadoop and its satellite components
  22. (Oozie, Hive...) and update some Hadoop configuration files before running Hue.
  23. Install Hue
  24. ~~~~~~~~~~~
  25. Hue consists of a web service that runs on a special node in your cluster.
  26. Choose one node where you want to run Hue. This guide refers to that node as
  27. the _Hue Server_. For optimal performance, this should be one of the nodes
  28. within your cluster, though it can be a remote node as long as there are no
  29. overly restrictive firewalls. For small clusters of less than 10 nodes,
  30. you can use your existing master node as the Hue Server.
  31. You can download the Hue tarball here:
  32. gethue.tumblr.com/tagged/release
  33. Hue Dependencies
  34. ^^^^^^^^^^^^^^^^
  35. Hue employs some Python modules which use native code and requires
  36. certain development libraries be installed on your system. To install from the
  37. tarball, you must have the following installed:
  38. .Required Dependencies
  39. [grid="rows"]
  40. ```~
  41. Redhat,Ubuntu 10.04,Ubuntu 12.04/14.04
  42. ~~~~~~~~~~
  43. gcc,gcc,gcc
  44. g++,g++,g++
  45. libxml2-devel,libxml2-dev,libxml2-dev
  46. libxslt-devel,libxslt-dev,libxslt-dev
  47. cyrus-sasl-devel,libsasl2-dev,libsasl2-dev
  48. cyrus-sasl-gssapi,libsasl2-modules-gssapi-mit,libsasl2-modules-gssapi-mit
  49. mysql-devel,libmysqlclient-dev,libmysqlclient-dev
  50. python-devel,python-dev,python-dev
  51. python-setuptools,python-setuptools,python-setuptools
  52. python-simplejson,python-simplejson,python-simplejson
  53. sqlite-devel,libsqlite3-dev,libsqlite3-dev
  54. ant,ant,ant
  55. libsasl2-dev,cyrus-sasl-devel,libsasl2-dev
  56. libsasl2-modules-gssapi-mit,cyrus-sasl-gssapi,libsasl2-modules-gssapi-mit
  57. libkrb5-dev,krb5-devel,libkrb5-dev
  58. libtidy-0.99-0,libtidy,libtidy-0.99-0 (For unit tests only)
  59. mvn,mvn (From maven2 package or tarball),mvn (From maven2/maven3 package or tarball)
  60. openldap-dev / libldap2-dev,openldap-devel,libldap2-dev
  61. ~~~~~~~~~~
  62. The full list is here: https://github.com/cloudera/hue#development-prerequisites
  63. Build
  64. ^^^^^
  65. Configure `$PREFIX` with the path where you want to install Hue by running:
  66. $ PREFIX=/usr/share make install
  67. $ cd /usr/share/hue
  68. You can install Hue anywhere on your system, and run Hue as a non-root user.
  69. The Shell application needs root privileges to launch various sub-processes as
  70. the logged in users. `$USER` should be the group of the user running Hue (same as
  71. its username).
  72. It is a good practice to create a new user for Hue and either install Hue in
  73. that user's home directory, or in a directory within `/usr/share`.
  74. Troubleshooting the Hue Tarball Installation
  75. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  76. .Q: I moved my Hue installation from one directory to another and now Hue no
  77. longer functions correctly.
  78. A: Due to the use of absolute paths by some Python packages, you must run a
  79. series of commands if you move your Hue installation. In the new location, run:
  80. ----
  81. $ rm app.reg
  82. $ rm -r build
  83. $ make apps
  84. ----
  85. .Q: Why does "make install" compile other pieces of software?
  86. A: In order to ensure that Hue is stable on a variety of distributions and
  87. architectures, it installs a Python virtual environment which includes its
  88. dependencies. This ensures that the software can depend on specific versions
  89. of various Python libraries and you don't have to be concerned about missing
  90. software components.
  91. Install Hadoop
  92. -~~~~~~~~~~~~~
  93. Depending on which apps you need, you need to make sure that some Hadoop services
  94. are already setup (that way Hue can talk to them).
  95. .Dependency
  96. [grid="rows"]
  97. `-----------------------------------------------.------------------------
  98. Component Applications Notes
  99. -------------------------------------------------------------------------
  100. HDFS Core, Filebrowser HDFS access through WebHdfs or HttpFS
  101. MR1 JobBrowser, JobDesigner, Beeswax Job information access through hue-plugins
  102. MR2/YARN JobBrowser, JobDesigner, Beeswax Job information access through hue-plugins
  103. Oozie JobDesigner, Oozie Oozie access through REST API
  104. Hive Beeswax Requires HiveServer2
  105. HBase HBase Browser Requires Thrift 1 service
  106. Pig Pig Editor Requires Oozie
  107. Sqoop2 Sqoop Editor Requires Sqoop2 server
  108. Search Search Requires Solr server
  109. Impala Impala Editor Requires an Impalad
  110. ZooKeeper ZooKeeper Browser Requires ZooKeeper server and REST server
  111. Spark Spark Editor Requires Spark Jobserver
  112. --------------------------------------------------------------------------------------
  113. Hadoop Configuration
  114. ~~~~~~~~~~~~~~~~~~~~
  115. Configure WebHdfs
  116. ^^^^^^^^^^^^^^^^^
  117. You need to enable WebHdfs or run an HttpFS server. To turn on WebHDFS,
  118. add this to your `hdfs-site.xml` and *restart* your HDFS cluster.
  119. Depending on your setup, your `hdfs-site.xml` might be in `/etc/hadoop/conf`.
  120. <property>
  121. <name>dfs.webhdfs.enabled</name>
  122. <value>true</value>
  123. </property>
  124. You also need to add this to `core-site.html`.
  125. <property>
  126. <name>hadoop.proxyuser.hue.hosts</name>
  127. <value>*</value>
  128. </property>
  129. <property>
  130. <name>hadoop.proxyuser.hue.groups</name>
  131. <value>*</value>
  132. </property>
  133. If you place your Hue Server outside the Hadoop cluster, you can run
  134. an HttpFS server to provide Hue access to HDFS. The HttpFS service requires
  135. only one port to be opened to the cluster.
  136. Also add this in `httpfs-site.xml` which might be in `/etc/hadoop-httpfs/conf`.
  137. <property>
  138. <name>httpfs.proxyuser.hue.hosts</name>
  139. <value>*</value>
  140. </property>
  141. <property>
  142. <name>httpfs.proxyuser.hue.groups</name>
  143. <value>*</value>
  144. </property>
  145. Configure MapReduce 0.23+ (MR2)
  146. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  147. Hue is using only standard Hadoop APIs.
  148. Configure MapReduce 0.20 (MR1)
  149. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  150. Hue communicates with the JobTracker via the Hue plugins, which is a jar
  151. file that you place in your MapReduce `lib` directory.
  152. If you JobTracker and Hue are located on the same host, copy it over.
  153. $ cd /usr/share/hue
  154. $ cp desktop/libs/hadoop/java-lib/hue-plugins-*.jar /usr/lib/hadoop-0.20-mapreduce/lib
  155. If you JobTracker runs on a different host, you need to `scp` the Hue plugins
  156. jar to the JobTracker host.
  157. Then add this to your `mapred-site.xml` and *restart* your JobTracker.
  158. Depending on your setup, your `mapred-site.xml` might be in `/etc/hadoop/conf`.
  159. <property>
  160. <name>jobtracker.thrift.address</name>
  161. <value>0.0.0.0:9290</value>
  162. </property>
  163. <property>
  164. <name>mapred.jobtracker.plugins</name>
  165. <value>org.apache.hadoop.thriftfs.ThriftJobTrackerPlugin</value>
  166. <description>Comma-separated list of jobtracker plug-ins to be activated.</description>
  167. </property>
  168. You can confirm that the plugins are running correctly by tailing the daemon
  169. logs:
  170. $ tail --lines=500 /var/log/hadoop-0.20/hadoop*jobtracker*.log | grep ThriftPlugin
  171. 2009-09-28 16:30:44,337 INFO org.apache.hadoop.thriftfs.ThriftPluginServer: Starting Thrift server
  172. 2009-09-28 16:30:44,419 INFO org.apache.hadoop.thriftfs.ThriftPluginServer:
  173. Thrift server listening on 0.0.0.0:9290
  174. Configure Oozie
  175. ^^^^^^^^^^^^^^^
  176. Hue submits MapReduce jobs to Oozie as the logged in user. You need to
  177. configure Oozie to accept the `hue` user to be a proxyuser. Specify this in
  178. your `oozie-site.xml` (even in a non-secure cluster), and restart Oozie:
  179. <property>
  180. <name>oozie.service.ProxyUserService.proxyuser.hue.hosts</name>
  181. <value>*</value>
  182. </property>
  183. <property>
  184. <name>oozie.service.ProxyUserService.proxyuser.hue.groups</name>
  185. <value>*</value>
  186. </property>
  187. Further Hadoop Configuration and Caveats
  188. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  189. `HADOOP_CLASSPATH` Caveat
  190. ^^^^^^^^^^^^^^^^^^^^^^^^^
  191. If you are setting `$HADOOP_CLASSPATH` in your `hadoop-env.sh`, be sure
  192. to set it in such a way that user-specified options are preserved. For example:
  193. Correct:
  194. # HADOOP_CLASSPATH=<your_additions>:$HADOOP_CLASSPATH
  195. Incorrect:
  196. # HADOOP_CLASSPATH=<your_additions>
  197. This enables certain components of Hue to add to
  198. Hadoop's classpath using the environment variable.
  199. `hadoop.tmp.dir`
  200. ^^^^^^^^^^^^^^^^
  201. If your users are likely to be submitting jobs both using Hue and from the
  202. same machine via the command line interface, they will be doing so as the `hue`
  203. user if they're using Hue and via their own user account on the command line.
  204. This leads to some contention on the directory specified by `hadoop.tmp.dir`,
  205. which defaults to `/tmp/hadoop-${user.name}`. Specifically, `hadoop.tmp.dir`
  206. is used to unpack jars in `bin/hadoop jar`. One work around to this is
  207. to set `hadoop.tmp.dir` to `/tmp/hadoop-${user.name}-${hue.suffix}` in the
  208. core-site.xml file:
  209. <property>
  210. <name>hadoop.tmp.dir</name>
  211. <value>/tmp/hadoop-${user.name}${hue.suffix}</value>
  212. </property>
  213. Unfortunately, when the variable is unset, you'll end up
  214. with directories named `/tmp/hadoop-user_name-${hue.suffix}` in
  215. `/tmp`. Despite that, Hue will still work.
  216. IMPORTANT: The Beeswax server writes into a local directory on the Hue machine
  217. that is specified by `hadoop.tmp.dir` to unpack its jars. That directory
  218. needs to be writable by the `hue` user, which is the default user who starts
  219. Beeswax Server, or else Beeswax server will not start. You may also make that
  220. directory world-writable.
  221. Configuring Your Firewall for Hue
  222. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  223. Hue currently requires that the machines within your cluster can connect to
  224. each other freely over TCP. The machines outside your cluster must be able to
  225. open TCP port 8888 on the Hue Server (or the configured Hue web HTTP port)
  226. to interact with the system.
  227. Hive Configuration
  228. ~~~~~~~~~~~~~~~~~~
  229. Hue's Beeswax application helps you use Hive to query your data.
  230. It depends on a Hive Server 2 running in the cluster. Please read
  231. this section to ensure a proper integration.
  232. Your Hive data is stored in HDFS, normally under `/user/hive/warehouse`
  233. (or any path you specify as `hive.metastore.warehouse.dir` in your
  234. `hive-site.xml`). Make sure this location exists and is writable by
  235. the users whom you expect to be creating tables. `/tmp` (on the local file
  236. system) must be world-writable (1777), as Hive makes extensive use of it.
  237. [NOTE]
  238. In `hue.ini`, modify `hive_conf_dir` to point to the
  239. directory containing `hive-site.xml`.
  240. Configuring Hue
  241. ---------------
  242. Hue ships with a default configuration that will work for
  243. pseudo-distributed clusters. If you are running on a real cluster, you must
  244. make a few changes to the `hue.ini` configuration file (`/etc/hue/hue.ini` when installed from the
  245. package version) or `pseudo-distributed.ini` in `desktop/conf` when in development mode).
  246. The following sections describe the key configuration options you must make to configure Hue.
  247. [TIP]
  248. .Listing all Configuration Options
  249. ============================================================
  250. To list all available configuration options, run:
  251. $ /usr/share/hue/build/env/bin/hue config_help | less
  252. This commands outlines the various sections and options in the configuration,
  253. and provides help and information on the default values.
  254. ============================================================
  255. [TIP]
  256. .Viewing Current Configuration Options
  257. ============================================================
  258. To view the current configuration from within Hue, open:
  259. http://<hue>/dump_config
  260. ============================================================
  261. [TIP]
  262. .Using Multiple Files to Store Your Configuration
  263. ============================================================
  264. Hue loads and merges all of the files with extension `.ini`
  265. located in the `/etc/hue` directory. Files that are alphabetically later
  266. take precedence.
  267. ============================================================
  268. Web Server Configuration
  269. ~~~~~~~~~~~~~~~~~~~~~~~~
  270. These configuration variables are under the `[desktop]` section in
  271. the `hue.ini` configuration file.
  272. Specifying the Hue HTTP Address
  273. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  274. Hue uses CherryPy web server. You can use the following options to
  275. change the IP address and port that the web server listens on.
  276. The default setting is port 8888 on all configured IP addresses.
  277. # Webserver listens on this address and port
  278. http_host=0.0.0.0
  279. http_port=8888
  280. Specifying the Secret Key
  281. ^^^^^^^^^^^^^^^^^^^^^^^^^
  282. For security, you should also specify the secret key that is used for secure
  283. hashing in the session store. Enter a long series of random characters
  284. (30 to 60 characters is recommended).
  285. secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
  286. NOTE: If you don't specify a secret key, your session cookies will not be
  287. secure. Hue will run but it will also display error messages telling you to
  288. set the secret key.
  289. Authentication
  290. ^^^^^^^^^^^^^^
  291. By default, the first user who logs in to Hue can choose any
  292. username and password and becomes an administrator automatically. This
  293. user can create other user and administrator accounts. User information is
  294. stored in the Django database in the Django backend.
  295. The authentication system is pluggable. For more information, see the
  296. link:sdk/sdk.html[Hue SDK Documentation].
  297. Configuring Hue for SSL
  298. ^^^^^^^^^^^^^^^^^^^^^^^
  299. You can configure Hue to serve over HTTPS. To do so, you must install
  300. "pyOpenSSL" within Hue's context and configure your keys.
  301. To install `pyOpenSSL`, from the root of your Hue installation path,
  302. do the following steps:
  303. 1. Run this command:
  304. $ ./build/env/bin/easy_install pyOpenSSL
  305. 2. Configure Hue to use your private key by adding the following
  306. options to the `hue.ini` configuration file:
  307. ssl_certificate=/path/to/certificate
  308. ssl_private_key=/path/to/key
  309. 3. Ideally, you would have an appropriate key signed by a Certificate Authority.
  310. If you're just testing, you can create a self-signed key using the `openssl`
  311. command that may be installed on your system:
  312. ### Create a key
  313. $ openssl genrsa 1024 > host.key
  314. ### Create a self-signed certificate
  315. $ openssl req -new -x509 -nodes -sha1 -key host.key > host.cert
  316. [NOTE]
  317. .Self-signed Certificates and File Uploads
  318. ============================================================
  319. To upload files using the Hue File Browser over HTTPS requires
  320. using a proper SSL Certificate. Self-signed certificates don't
  321. work.
  322. ============================================================
  323. Hue Configuration for Hadoop
  324. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  325. These configuration variables are under the `[hadoop]` section in
  326. the `hue.ini` configuration file.
  327. HDFS Cluster
  328. ^^^^^^^^^^^^
  329. Hue only support one HDFS cluster currently. That cluster should be defined
  330. under the `[[[default]]]` sub-section.
  331. fs_defaultfs::
  332. This is the equivalence of `fs.defaultFS` (aka `fs.default.name`) in
  333. Hadoop configuration.
  334. webhdfs_url::
  335. You can also set this to be the HttpFS url. The default value is the HTTP
  336. port on the NameNode.
  337. hadoop_hdfs_home::
  338. This is the home of your Hadoop HDFS installation. It is the
  339. root of the Hadoop untarred directory, or usually
  340. `/usr/lib/hadoop`.
  341. hadoop_bin::
  342. Use this as the HDFS Hadoop launcher script, which is usually
  343. `/usr/bin/hadoop`.
  344. hadoop_conf_dir::
  345. This is the configuration directory of the HDFS, typically
  346. `/etc/hadoop/conf`.
  347. MapReduce (MR1) Cluster
  348. ^^^^^^^^^^^^^^^^^^^^^^^
  349. Hue only support one MapReduce cluster currently. That cluster should be defined
  350. under the `[[[default]]]` sub-section. Note that JobBrowser only works with MR1.
  351. jobtracker_host::
  352. The host running the JobTracker. In a secured environment, this needs to
  353. be the FQDN of the JobTracker host, and match the "host" portion of the
  354. `mapred' Kerberos principal full name.
  355. jobtracker_port::
  356. The port for the JobTracker IPC service.
  357. submit_to::
  358. If your Oozie is configured with to talk to a 0.20 MapReduce service, then
  359. set this to `true`. Hue will be submitting jobs to this MapReduce cluster.
  360. Yarn (MR2) Cluster
  361. ^^^^^^^^^^^^^^^^^^
  362. Hue only support one Yarn cluster currently. That cluster should be defined
  363. under the `[[[default]]]` sub-section.
  364. resourcemanager_host::
  365. The host running the ResourceManager.
  366. resourcemanager_port::
  367. The port for the ResourceManager IPC service.
  368. submit_to::
  369. If your Oozie is configured with to talk to a Yarn cluster, then
  370. set this to `true`. Hue will be submitting jobs to this Yarn cluster.
  371. But note that JobBrowser will not be able to show MR2 jobs.
  372. Beeswax Configuration
  373. ~~~~~~~~~~~~~~~~~~~~~
  374. In the `[beeswax]` section of the configuration file, you can
  375. _optionally_ specify the following:
  376. beeswax_server_host::
  377. The hostname or IP that the Hive Server should bind to. By
  378. default it binds to `localhost`, and therefore only serves local
  379. IPC clients.
  380. hive_home_dir::
  381. The base directory of your Hive installation.
  382. hive_conf_dir::
  383. The directory containing your `hive-site.xml` Hive
  384. configuration file.
  385. JobDesigner and Oozie Configuration
  386. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  387. In the `[liboozie]` section of the configuration file, you should
  388. specify:
  389. oozie_url::
  390. The URL of the Oozie service. It is the same as the `OOZIE_URL`
  391. environment variable for Oozie.
  392. UserAdmin Configuration
  393. ~~~~~~~~~~~~~~~~~~~~~~~
  394. In the `[useradmin]` section of the configuration file, you can
  395. _optionally_ specify the following:
  396. default_user_group::
  397. The name of a default group that is suggested when creating a
  398. user manually. If the LdapBackend or PamBackend are configured
  399. for doing user authentication, new users will automatically be
  400. members of the default group.
  401. Configuration Validation
  402. ~~~~~~~~~~~~~~~~~~~~~~~~
  403. Hue can detect certain invalid configuration. It will show a red alert icon on
  404. the top navigation bar. image:images/val.png[]
  405. To view the configuration of a running Hue instance, navigate to
  406. `http://myserver:8888/dump_config`, also accessible through the About
  407. application.
  408. Starting Hue from the Tarball
  409. -----------------------------
  410. After your cluster is running with the plugins enabled, you can start Hue on
  411. your Hue Server by running:
  412. # build/env/bin/supervisor
  413. This will start several subprocesses, corresponding to the different Hue
  414. components. Your Hue installation is now running.
  415. Administering Hue
  416. -----------------
  417. Now that you've installed and started Hue, you can feel free to skip ahead
  418. to the <<usage,Using Hue>> section. Administrators may want to refer to this
  419. section for more details about managing and operating a Hue installation.
  420. Hue Processes
  421. ~~~~~~~~~~~~~
  422. Process User
  423. ^^^^^^^^^^^^
  424. Filebrowser requires Hue to be running as the 'hue' user.
  425. Process Hierarchy
  426. ^^^^^^^^^^^^^^^^^
  427. A script called `supervisor` manages all Hue processes. The supervisor is a
  428. watchdog process -- its only purpose is to spawn and monitor other processes.
  429. A standard Hue installation starts and monitors the following processes:
  430. * `runcpserver` - a web server based on CherryPy that provides the core web
  431. functionality of Hue
  432. If you have installed other applications into your Hue instance, you may see
  433. other daemons running under the supervisor as well.
  434. You can see the supervised processes running in the output of `ps -f -u hue`:
  435. UID PID PPID C STIME TTY TIME CMD
  436. hue 8685 8679 0 Aug05 ? 00:01:39 /usr/share/hue/build/env/bin/python /usr/share/hue/build/env/bin/desktop runcpserver
  437. Note that the supervisor automatically restarts these processes if they fail for
  438. any reason. If the processes fail repeatedly within a short time, the supervisor
  439. itself shuts down.
  440. [[logging]]
  441. Hue Logging
  442. ~~~~~~~~~~~
  443. The Hue logs are found in `/var/log/hue`, or in a `logs` directory under your
  444. Hue installation root. Inside the log directory you can find:
  445. * An `access.log` file, which contains a log for all requests against the Hue
  446. web server.
  447. * A `supervisor.log` file, which contains log information for the supervisor
  448. process.
  449. * A `supervisor.out` file, which contains the stdout and stderr for the
  450. supervisor process.
  451. * A `.log` file for each supervised process described above, which contains
  452. the logs for that process.
  453. * A `.out` file for each supervised process described above, which contains
  454. the stdout and stderr for that process.
  455. If users on your cluster have problems running Hue, you can often find error
  456. messages in these log files. If you are unable to start Hue from the init
  457. script, the `supervisor.log` log file can often contain clues.
  458. Viewing Recent Log Messages Online
  459. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  460. In addition to logging `INFO` level messages to the `logs` directory, the Hue
  461. web server keeps a small buffer of log messages at all levels in memory. You can
  462. view these logs by visiting `http://myserver:8888/logs`. The `DEBUG` level
  463. messages shown can sometimes be helpful in troubleshooting issues.
  464. The Hue Database
  465. ~~~~~~~~~~~~~~~~
  466. Hue requires a SQL database to store small amounts of data, including user
  467. account information as well as history of job submissions and Hive queries.
  468. By default, Hue is configured to use the embedded database SQLite for this
  469. purpose, and should require no configuration or management by the administrator.
  470. However, MySQL is the recommended database to use. This section contains
  471. instructions for configuring Hue to access MySQL and other databases.
  472. Inspecting the Hue Database
  473. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  474. The default SQLite database used by Hue is located in: `/usr/share/hue/desktop/desktop.db`.
  475. You can inspect this database from the command line using the `sqlite3`
  476. program or typing `/usr/share/hue/build/env/bin/hue dbshell'. For example:
  477. # sqlite3 /usr/share/hue/desktop/desktop.db
  478. SQLite version 3.6.22
  479. Enter ".help" for instructions
  480. Enter SQL statements terminated with a ";"
  481. sqlite> select username from auth_user;
  482. admin
  483. test
  484. sample
  485. sqlite>
  486. It is strongly recommended that you avoid making any modifications to the
  487. database directly using SQLite, though this trick can be useful for management
  488. or troubleshooting.
  489. Backing up the Hue Database
  490. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  491. If you use the default SQLite database, then copy the `desktop.db` file to
  492. another node for backup. It is recommended that you back it up on a regular
  493. schedule, and also that you back it up before any upgrade to a new version of
  494. Hue.
  495. Configuring Hue to Access Another Database
  496. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  497. Although SQLite is the default database type, some advanced users may prefer
  498. to have Hue access an alternate database type. Note that if you elect to
  499. configure Hue to use an external database, upgrades may require more manual
  500. steps in the future.
  501. The following instructions are for MySQL, though you can also configure Hue to
  502. work with other common databases such as PostgreSQL and Oracle.
  503. [NOTE]
  504. .Tested Database Backends
  505. ============================================================
  506. Note that Hue has only been tested with SQLite and MySQL database backends.
  507. ============================================================
  508. Configuring Hue to Store Data in MySQL
  509. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  510. To configure Hue to store data in MySQL:
  511. 1. Create a new database in MySQL and grant privileges to a Hue user to manage
  512. this database.
  513. mysql> create database hue;
  514. Query OK, 1 row affected (0.01 sec)
  515. mysql> grant all on hue.* to 'hue'@'localhost' identified by 'secretpassword';
  516. Query OK, 0 rows affected (0.00 sec)
  517. 2. Shut down Hue if it is running.
  518. 3. To migrate your existing data to MySQL, use the following command to dump the
  519. existing database data to a text file. Note that using the ".json" extension
  520. is required.
  521. $ /usr/share/hue/build/env/bin/hue dumpdata > <some-temporary-file>.json
  522. 4. Open the `hue.ini` file in a text editor. Directly below the
  523. `[[database]]` line, add the following options (and modify accordingly for
  524. your MySQL setup):
  525. host=localhost
  526. port=3306
  527. engine=mysql
  528. user=hue
  529. password=secretpassword
  530. name=hue
  531. 5. As the Hue user, configure Hue to load the existing data and create the
  532. necessary database tables:
  533. $ /usr/share/hue/build/env/bin/hue syncdb --noinput
  534. $ mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;"
  535. $ /usr/share/hue/build/env/bin/hue loaddata <temporary-file-containing-dumped-data>.json
  536. Your system is now configured and you can start the Hue server as normal.
  537. [[usage]]
  538. Using Hue
  539. ---------
  540. After installation, you can use Hue by navigating to `http://myserver:8888/`.
  541. The following login screen appears:
  542. image:images/login.png[]
  543. The Help application guides users through the various installed applications.
  544. Supported Browsers
  545. ~~~~~~~~~~~~~~~~~~
  546. * Windows: Chrome, Firefox 3.6+, Internet Explorer 9+, Safari 5+
  547. * Linux : Chrome, Firefox 3.6+
  548. * Mac: Chrome, Firefox 3.6+, Safari 5+
  549. Feedback
  550. ~~~~~~~~
  551. Your feedback is welcome. The best way to send feedback is to join the
  552. https://groups.google.com/a/cloudera.org/group/hue-user[mailing list], and
  553. send e-mail, to mailto:hue-user@cloudera.org[hue-user@cloudera.org].
  554. Reporting Bugs
  555. ~~~~~~~~~~~~~~
  556. If you find that something doesn't work, it'll often be helpful to include logs
  557. from your server. (See the <<logging,Hue Logging>> section. Please include the
  558. logs as a zip (or cut and paste the ones that look relevant) and send those with
  559. your bug reports.
  560. image:images/logs.png[]