manual.txt 26 KB

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