This beta version of Ambari HAWQ View provides live query monitoring directly in Ambari UI, displaying a list of queries running in a HAWQ cluster. This allows admins to see the database activity on the UI in a user-friendly interface. The view front-end is based on EmberJS framework. The Java backend extends the framework provided by the ambari-views project. The front-end polls the REST API every 5 seconds, querying the pg_stat_activity view and rendering reformatted data on the UI.
How to Deploy:
Deployment simply requires copying the hawq-view jar to the ambari-server host and restarting ambari-server.
a) The HAWQ View instance connects to the HAWQ Master through JDBC. Ensure that HAWQ pg_hba.conf is updated to allow JDBC connections from the ambari_server_host for the HAWQ View backend user account with access to pg_stat_activity view (you may use use gpadmin out-of-the-box for demo purposes).
SSH into the HAWQ Master host and update pg_hba.conf (in HAWQ Master Directory, e.g /data/hawq/master) to allow connections. Example of entry needed in pg_hba.conf, where 192.168.64.101 is the ambari_server_host and gpadmin is used to run the HAWQ View instance:
host all gpadmin 192.168.64.101/32 trust
Restart HAWQ Master via Ambari or CLI for pg_hba.conf changes to take effect.
b) Ensure that the steps above have been completed before proceeding. In Ambari UI, navigate to Admin > Manage Ambari > Views page. You should see a HAWQ view in the list. Click on Create Instance under HAWQ View. Under Settings section, provide the HAWQ username and password of the backend user account with access to pg_stat_activity view (the same user that was added to pg_hba.conf above).
Once saved, the view will be created and operational. Submit some (long running) queries and ensure they are displayed on the HAWQ View. You may hover over the queries to see the SQL statements.