manual.txt 27 KB

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