Skip to main content
sshimpi
Silver ⭐️⭐️⭐️
Dec 23, 2016 1:08 PM UTC

How to remove Ranger Admin component from a host using Ambari API

  • Oct 5, 2026 9:32 AM UTC
  • 0 replies
  • 774 views
  • Translate All

Scenario: Lets say you have 2 ranger admin instances configured in your cluster. Now if you want to enable Ranger HA, you need to delete one of the ranger admin instance[since Ranger HA admin wizard will create 2nd instance of ranger for you]

In such case you need to remove one instance of Ranger admin which is already installed.

The following steps will guide you how to remove Ranger Admin instance using Ambari API

  1. Backup Ambari Server database [https://ambari.apache.org/current/installing-hadoop-using-ambari/content/ambari-chap11-1.html]
  2. Stop the Ranger service using Ambari. In case the Ranger Admin fails to stop, try stopping the Ranger Service as follows using Ambari API:

    curl -u admin:admin -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' \
    http://xxx.hostname:8080/api/v1/clusters/TEST/services/RANGER

    curl -u admin:admin -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop Service"}, "Body": {"ServiceComponentInfo": {"state": "INSTALLED"}}}' \
    http://xxx.hostname:8080/api/v1/clusters/TEST/hosts/xxx.hostname/host_components/RANGER_ADMIN

  3. Remove Ranger Admin using API:

    curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://xxx.hostname:8080/api/v1/clusters/TEST/hosts/xxx.hostname/host_components/RANGER_ADMIN