Configuring Hue

This topic includes the following information about configuring Hue:

Hue Configuration Files and Safety Valves

All Hue configuration properties are stored in hue.ini but only a subset are exposed in Cloudera Manager.

Properties that are not exposed (such as the Authentication Backend for SAML) can be configured in Cloudera Manager with "safety-valves."

Configuration Files

Hue roles are configured with three .ini files that are read in order (with the last one, hue_safety_valve_server.ini, taking precedence):
  • hue.ini
  • hue_safety_valve.ini
  • hue_safety_valve_server.ini.
ls -ltr /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_SERVER | tail -1 | awk '{print $9}'`


Advanced Safety-valves

In Cloudera Manager, all Hue properties and safety-valves can be found on the tab, Hue > Configuration.

The field for hue_safety_valve.ini is service-wide and affects all Hue roles listed on the Instances tab. The field for hue_safety_valve_server.ini only affects Hue Server role instances.



Environment Safety-valves

Environment safety-valves let you configure environment variables across the service or for specific role instances. These safety-valves lack headers.



Hue Logs and Paths

This section explains the logs generated by Cloudera Manager about each Hue role instance and those generated by the Hue service itself.

Hue Logs

There are two sets of Hue log files:
  • Standard stream logs for the starting/stopping of each role supervised by Cloudera Manager:

  • Hue log4j logs when the service is running:

Standard Stream Logs

Cloudera Manager logs the starting and stopping of each supervised Hue process in standard stream logs (stdout.log, stderr.log).

When the Hue service restarts, Cloudera Manager generates a new directory for each supervised process (of a Hue role instance):
ls -vrl /var/run/cloudera-scm-agent/process | grep HUE



It writes to a nested logs directory for each running instance:

Configuration errors are written here because they prevent Hue servers and load balancers from starting properly.

The Supervisor
The supervisor is a watchdog process and supervisor.conf manages all Hue processes; its only purpose is to spawn and monitor other processes. A standard Hue installation starts and monitors the runcpserver process, which provides the core web functionality for Hue.

For each Hue role, Cloudera Manager looks to the appropriate supervisor.conf for instructions on how to start the server.

# Hue Server Process Directory
cd /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_SERVER | tail -1 | awk '{print $9}'`
cat supervisor.conf
[program:288-hue-HUE_SERVER]
command=cmf-redactor "/usr/lib64/cmf/service/hue/hue.sh" "runcpserver"
autostart=true
directory=/run/cloudera-scm-agent/process/288-hue-HUE_SERVER
stdout_logfile=/run/cloudera-scm-agent/process/288-hue-HUE_SERVER/logs/stdout.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stderr_logfile=/run/cloudera-scm-agent/process/288-hue-HUE_SERVER/logs/stderr.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=10
environment= ...
# Hue Load Balancer Process Directory
cd /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_LOAD | tail -1 | awk '{print $9}'`
cat supervisor.conf
[program:258-hue-HUE_LOAD_BALANCER]
command=cmf-redactor "/usr/lib64/cmf/service/hue/httpd.sh"
...

If you installed other applications into your Hue instance, you may see other daemons running under the supervisor as well. Supervisor automatically restarts these processes if they fail for any reason. If they fail repeatedly in a short period of time, the supervisor itself shuts down.

Hue Service Django Logs

Once the Hue service is up and running, Hue generates logs in /var/log/hue using log4j. Load balancer logs are in /var/run/httpd.
Hue Service Logs

Log Name

Description
access.log Filtered list of successful attempts to access Hue Web UI
audit.log Audit log visible in Cloudera Navigator
collectstatic.log Static files that support Hue Web UI (images, JavaScript files, CSS, ...)
error.log Filtered list of all nontrivial errors
kt_renewer.log Kerberos ticket renews
metrics_hue_server.log Populates charts in Cloudera Manager
migrate.log Database and table migrations + First Run of Hue server
runcpserver.log Hue (CherryPy) web server info (CP server runs Django core)
syncdb.log Database and table creations

Enable DEBUG

DEBUG is available for the Hue Django logs in /var/log/hue.

By default, the Hue service writes INFO level messages and keeps a small buffer of log messages at all levels in memory.

There are two ways to enable DEBUG messages for all the logs in /var/log/hue :
  • Cloudera Manager: Go to Hue > Configuration, check Enable Django Debug Mode, and Save Changes > Restart.
  • Hue Web UI: Go to the Home page, select Server Logs, and check Force Debug Level. Debug is enabled on-the-fly.

Hue Paths

This section is a cheat sheet for navigating a managed deployment of Hue.

$HUE_HOME

HUE_HOME is a reference to the location of your Hue installation.
  • For package installs, this is usually /usr/lib/hue/
  • For parcel installs, this is usually, /opt/cloudera/parcels/CDH/lib/hue/
The CDH directory is actually a symbolic link to the directory with the latest parcels:
ls -l /opt/cloudera/parcels


You can Run Hue Shell Commands from this location.

Hue Role Instance Process Directories

Cloudera Manager creates dynamic process directories to manage each Hue role instance:
cd /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_SERVER | tail -1 | awk '{print $9}'`
cd /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_LOAD | tail -1 | awk '{print $9}'`

Hue Server Configuration Files

Hue Configuration Files and Safety Valves (hue.ini) and corresponding safety valve files, are in each Hue Server process directory:
ls -l /var/run/cloudera-scm-agent/process/`ls -valrt /var/run/cloudera-scm-agent/process | grep HUE_SERVER | tail -1 | awk '{print $9}'`