Adding Query Processor service to a cluster

The Query Processor service indexes Hive and Tez events and provides APIs to access them. It is required if you want to view the Queries tab (query history and query details) on the Hue Job Browser.

You can either install the Query Processor service as a dependency while adding the Hue service or after adding the Hue service.

This task assumes that you already have a database installed on a host in your cluster. On CDP, Hue Query Processor supports PostgreSQL, MySQL, and Oracle databases. The supported PostgreSQL database version for Hue Query Processor is 9.6 and higher.

Next, you need to create a database for the Query Processor service with the required roles. To create the Query Processor database:
  1. SSH into your database host as a root user.
  2. Start the database terminal by running the following commands:
    (PostgreSQL)
    sudo -u postgres psql
    (MySQL)
    systemctl start mysqld
    (Oracle)
    sqlplus / as sysdba
  3. Run the following statement while specifying the username, password, and a database name for the Query Processor:
    (PostgreSQL)
    CREATE ROLE [***QP-USER***] WITH LOGIN PASSWORD '[***QP-PASSWORD***]';
    ALTER ROLE [***QP-USER***] CREATEDB;
    CREATE DATABASE [***QP-DATABASE***];
    GRANT ALL PRIVILEGES ON DATABASE [***QP-DATABASE***] TO [***QP-USER***];
    (MySQL)
    CREATE USER [***QP-USER***] IDENTIFIED BY '[***QP-PASSWORD***]';
    CREATE DATABASE [***QP-DATABASE***];
    USE [***QP-DATABASE***];
    GRANT ALL PRIVILEGES ON [***QP-DATABASE***].* TO [***QP-USER***]; 
    (Oracle)
    CREATE USER [***QP-USER***] IDENTIFIED BY [***QP-PASSWORD***];
    GRANT ALL PRIVILEGES TO [***QP-USER***];
  1. Log in to the CDP Management Console as an Administrator.
  2. Go to your environment and click on CM UI to open Cloudera Manager.
  3. Go to Clusters > > Add Service.
  4. Select Query Processor on the Add Service to Cluster page and click Continue.
    The required dependencies are automatically selected.
  5. Select the host on which you want to install the Query Processor by clicking View By Host. Then click Continue.
  6. Select the database type, and specify the database hostname, database name, and username and password to access the database on the Setup Database page and click Test Connection.
    After the connection is verified, click Continue.
  7. On the Review Changes page, accept the default settings and click Continue.
    If Kerberos or Auto-TLS are set up on your Data Hub cluster, then the corresponding settings are automatically configured.
    The Command Details page is displayed, which shows the status of the installation and configuration.
  8. Click Continue if the operation is successful.
  9. Click Finish on the Summary page.
You are redirected to the Cloudera Manager home page. You can now see the Query Processor service listed within your cluster.
(Optional) To view the Queries tab on the Job Browser page in Hue, you must enable the Query Processor Service option in Hue configurations using Cloudera Manager.