manual.txt 25 KB

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