--- title: "Operations" date: 2019-03-13T18:28:09-07:00 draft: false weight: 2 --- ## Quick Start Wizard The Quick Start wizard allows you to perform the following Hue setup operations by clicking the tab of each step or sequentially by clicking Next in each screen: 1. **Check Configuration** validates your Hue configuration. It will note any potential misconfiguration and provide hints as to how to fix them. You can edit the configuration file described in the next section or use Cloudera Manager, if installed, to manage your changes. 2. **Examples** contains links to install examples into the Hive, Impala, MapReduce, Spark, Oozie, Solr Dashboard and Pig Editor applications. 3. **Users** contains a link to the User Admin application to create or import users and a checkbox to enable and disable collection of usage information. ## Configuration Displays a list of the installed Hue applications and their configuration. The location of the folder containing the Hue configuration files is shown at the top of the page. Hue configuration settings are in the hue.ini configuration file. Click the tabs under **Configuration Sections and Variables** to see the settings configured for each application. For information on configuring these settings, see Hue Configuration in the Hue installation manual. Hue ships with a default configuration that will work for pseudo-distributed clusters. If you are running on a real cluster, you must make a few changes to the `hue.ini` configuration file (`/etc/hue/hue.ini` when installed from the package version) or `pseudo-distributed.ini` in `desktop/conf` when in development mode). The following sections describe the key configuration options you must make to configure Hue.
[desktop] instrumentation=trueIf `django_debug_mode` is enabled, instrumentation is automatically enabled. This flag appends the response time and the total peak memory used since Hue started for every logged request. ### Instrumentation enabled
[17/Apr/2018 15:18:43 -0700] access INFO 127.0.0.1 admin - "POST /jobbrowser/jobs/ HTTP/1.1" `returned in 97ms (mem: 135mb)`### Instrumentation not enabled
[23/Apr/2018 10:59:01 -0700] INFO 127.0.0.1 admin - "POST /jobbrowser/jobs/ HTTP/1.1" returned in 88ms## Database Hue requires a SQL database to store small amounts of data, including user account information as well as history of job submissions and Hive queries. By default, Hue is configured to use the embedded database SQLite for this purpose, and should require no configuration or management by the administrator. However, MySQL is the recommended database to use. This section contains instructions for configuring Hue to access MySQL and other databases. ### Inspecting the Database The default SQLite database used by Hue is located in: `/usr/share/hue/desktop/desktop.db`. You can inspect this database from the command line using the `sqlite3` program or typing `/usr/share/hue/build/env/bin/hue dbshell'. For example: sqlite3 /usr/share/hue/desktop/desktop.db SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select username from auth_user; admin test sample sqlite> It is strongly recommended that you avoid making any modifications to the database directly using SQLite, though this trick can be useful for management or troubleshooting. ### Backing up the Database If you use the default SQLite database, then copy the `desktop.db` file to another node for backup. It is recommended that you back it up on a regular schedule, and also that you back it up before any upgrade to a new version of Hue. ### Configuring to Access Another Database Although SQLite is the default database type, some advanced users may prefer to have Hue access an alternate database type. Note that if you elect to configure Hue to use an external database, upgrades may require more manual steps in the future. The following instructions are for MySQL, though you can also configure Hue to work with other common databases such as PostgreSQL and Oracle.
mysql> create database hue;
Query OK, 1 row affected (0.01 sec)
mysql> grant all on hue.* to 'hue'@'localhost' identified by 'secretpassword';
Query OK, 0 rows affected (0.00 sec)
2. Shut down Hue if it is running.
3. To migrate your existing data to MySQL, use the following command to dump the
existing database data to a text file. Note that using the ".json" extension
is required.
/usr/share/hue/build/env/bin/hue dumpdata > $some-temporary-file.json
4. Open the `hue.ini` file in a text editor. Directly below the
`[[database]]` line, add the following options (and modify accordingly for
your MySQL setup):
host=localhost
port=3306
engine=mysql
user=hue
password=secretpassword
name=hue
5. As the Hue user, configure Hue to load the existing data and create the
necessary database tables:
/usr/share/hue/build/env/bin/hue syncdb --noinput
mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;"
/usr/share/hue/build/env/bin/hue loaddata $temporary-file-containing-dumped-data.json
Your system is now configured and you can start the Hue server as normal.