Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

how to install ranger by rest api

Explorer
Command:
curl --user shicheng:123456 -H "X-Requested-By: ambari" -X GET  http://localhost:8080/api/v1/clusters/ChorusCluster/services/RANGER

Result:

{
  "href" : "http://localhost:8080/api/v1/clusters/ChorusCluster/services/RANGER",
  "ServiceInfo" : {
    "cluster_name" : "ChorusCluster",
    "maintenance_state" : "OFF",
    "service_name" : "RANGER",
    "state" : "UNKNOWN"
  },
  "alerts_summary" : {
    "CRITICAL" : 0,
    "MAINTENANCE" : 0,
    "OK" : 0,
    "UNKNOWN" : 0,
    "WARNING" : 0
  },
  "alerts" : [ ],
  "components" : [ ],
  "artifacts" : [ ]
}
How to install ranger admin and ranger usersync host_components to host
6 REPLIES 6

@shi cheng

You need to follow the steps mentioned in the below link to add any service to the cluster. It is a generic solution to add service.

https://cwiki.apache.org/confluence/display/AMBARI/Adding+a+New+Service+to+an+Existing+Cluster

Explorer
[root@bj-rc-dptd-ambari-sr-1-v-test-1 RANGER]# curl --user shicheng:123456 -H "X-Requested-By: ambari" -i -X POST http://localhost:8080/api/v1/clusters/ChorusCluster/RANGER/components/RANGER_ADMIN
HTTP/1.1 404 Not Found
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Set-Cookie: AMBARISESSIONID=1camyzu7n4lbd1doojg46yzk6p;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: shicheng
Content-Length: 0
Server: Jetty(8.1.19.v20160209

Explorer

i'am don't install ranger-admin and ranger-syncuser service to host

@shi cheng

As @sbhat pointed out, your url is incorrect to add component. correct one is below.

curl -u <username>:<password> -i -X POST http://<ambari-server-host>:8080/api/v1/clusters/<cluster-name>/services/<service-name>/components/<...;
Example:
curl -u <username>:<password> -i -X POST http://<ambari-server-host>:8080/api/v1/clusters/c1/services/RANGER/components/RANGER_ADMIN

You need to follow the exact steps mentioned in the above link.

Expert Contributor

Follow this link, it will help you to install and configure ranger on your cluster,

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_Ranger_Install_Guide/content/complete_th...

And i do not think other rest api will help you in installing, as the installtion require many thing , including mysql integration with Ranger.

Rising Star

@shi cheng : I see your older post where you mentioned you used the following url to install the component :

[root@bj-rc-dptd-ambari-sr-1-v-test-1 RANGER]# curl --user shicheng:123456 -H "X-Requested-By: ambari" -i -X POST http://localhost:8080/api/v1/clusters/ChorusCluster/RANGER/components/RANGER_ADMIN

I see you are missing /services in your url. The url should be :

[root@bj-rc-dptd-ambari-sr-1-v-test-1 RANGER]# curl --user shicheng:123456 -H "X-Requested-By: ambari" -i -X POST http://localhost:8080/api/v1/clusters/ChorusCluster/services/RANGER/components/RANGER_ADMIN

Hope this helps!

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.