EsharEditor / ambari-hue-service

Ambari stack service for easily installing and managing Hue on HDP cluster
Apache License 2.0
107 stars 68 forks source link

An Ambari Service for Hue

Ambari service for easily installing and managing Hue on HDP cluster.

Authors:

Version

Setup

Deploy Hue on existing cluster

On bottom left -> Actions -> Add service -> check Hue server -> Next -> Next -> Change any config you like (e.g. install dir, port) -> Next -> Deploy

get service status

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X GET http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE

start service

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Start $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE

stop service

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE


#### Configuring Cluster and HUE
Hue uses a configuration file to understand information about Hadoop cluster and where to connect to. We’ll need to configure our Hadoop cluster to accept connections from HUE, and add our cluster information to the HUE configuration file. We’ll need to reconfigure our HDFS, Hive (WebHcatalog), and Oozie services to take advantage of HUE’s features.[tutorials from Hue](http://gethue.com/hadoop-hue-3-on-hdp-installation-tutorial/?replytocom=50032)

  - http://gethue.com/hadoop-hue-3-on-hdp-installation-tutorial/?replytocom=50032

#### Hue Service Action
![Image](../branch-2.0.0/screenshots/5.png?raw=true)
- UserSync: synchronize users from the current system or Ldap server
- DatabaseSync: synchronize metastore from SQLite

#### Use Hue
- The Hue webUI login page should come up at the below link: 
http://$HUE_HOSTNAME:8888
![Image](../branch-2.0.0/screenshots/6.png?raw=true)

#### Remove service

- To remove the Hue service: 
  - Stop the service via Ambari
  - Unregister the service by running below from Ambari node

export SERVICE=HUE export PASSWORD=admin export AMBARI_HOST=localhost

detect name of cluster

output=curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' http://$AMBARI_HOST:8080/api/v1/clusters CLUSTER=echo $output | sed -n 's/.*"cluster_name" : "\([^\"]*\)".*/\1/p'

unregister service from ambari

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X DELETE http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE

if above errors out, run below first to fully stop the service

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE

- Remove artifacts

rm -rf /usr/local/hue* rm -rf /var/log/hue rm -rf /var/run/hue rm /usr/hdp/current/hadoop-client/lib/hue-plugins-3.11.0-SNAPSHOT.jar