manual.txt 27 KB

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