Support Questions
Find answers, ask questions, and share your expertise

How to restore older hive-site config given a known tag via REST

Explorer

If I know the tag for a previous hive-site configuration how can instruct REST to restore to it? The only thing I've found is for restoring a level higher (HIVE), but I don't know that version. And is there a document that describes these types of task?

4 REPLIES 4

Super Guru
@Neil Watson

Below example curl call should help you

curl -u admin:admin -H 'X-Requested-By:admin' -X PUT 'http://localhost:8080/api/v1/clusters/cc' -d '{
  "Clusters": {
    "desired_service_config_versions": {
      "service_name" : "HDFS",
      "service_config_version" : 1,
      "service_config_version_note" : "Manual rollback to service config version 1 (HDFS)"
    }
  }
}'

Please refer https://cwiki.apache.org/confluence/display/AMBARI/Service+Config+Versions+API+usage for more details.

Hope this helps.

Explorer

I tried that, but specifying a service_name of hive-site results in a 404.

@Neil Watson

It is not good idea of restoring the specific sub config types. better you operate/modify at service level rather than at sub config types level.

@Neil Watson

As per my understanding you will not be able to modify/update sub config types, you will have to do at service level.

If you don't know the service level version then first try to find out the version number.

You can run API to get all the version of HIVE

http://AMBARIHOST:8080/api/v1/clusters/test/configurations/service_config_versions?service_name=HIVE

From the output you can find your hive-site config version number and pick corresponding HIVE service version from the same block and then try to use curl -u admin:admin -H 'X-Requested-By:admin'-X PUT 'http://localhost:8080/api/v1/clusters/cc'-d