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.

Exception while getting Kms Key List in Ranger KMS

Hi, I am using HDP 2.5 sandbox, installed Ranger KMS by using following link

http://coheigea.blogspot.in/2016/08/installing-apache-ranger-key-management.html

https://cwiki.apache.org/confluence/display/RANGER/Apache+Ranger+0.5.0+Installation

While i am trying to create a service in Ranger KMS getting "Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin, connection refused" in cat /var/log/ranger/admin/xa_portal.log file

2017-02-17 09:46:20,870 [http-bio-6080-exec-6] INFO  org.apache.ranger.security.listener.SpringEventListener (SpringEventListener.java:71) - Login Successful:keyadmin | Ip Address:10.77.217.76 | sessionId=AEF3F945241899271625CBFE1FCDDCC3 | Epoch=1487324780870
2017-02-17 09:46:20,871 [http-bio-6080-exec-6] INFO  org.apache.ranger.biz.SessionMgr (SessionMgr.java:429) - keyadmin is a valid user
2017-02-17 09:46:21,190 [http-bio-6080-exec-6] INFO  org.apache.ranger.biz.SessionMgr (SessionMgr.java:232) - UserSession Updated to set new Permissions to User: keyadmin
2017-02-17 09:46:21,191 [http-bio-6080-exec-6] INFO  org.apache.ranger.biz.SessionMgr (SessionMgr.java:184) - Login Success: loginId=keyadmin, sessionId=371, sessionId=AEF3F945241899271625CBFE1FCDDCC3, requestId=10.77.217.76, epoch=1487324781191
2017-02-17 09:46:35,464 [timed-executor-pool-0] ERROR apache.ranger.services.kms.client.KMSClient (KMSClient.java:285) - Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
        at com.sun.jersey.api.client.Client.handle(Client.java:616)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:72)
        at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:454)
        at org.apache.ranger.services.kms.client.KMSClient.getKeyList(KMSClient.java:177)
        at org.apache.ranger.services.kms.client.KMSClient.getKmsKey(KMSClient.java:382)
        at org.apache.ranger.services.kms.client.KMSClient.testConnection(KMSClient.java:317)
        at org.apache.ranger.services.kms.client.KMSResourceMgr.validateConfig(KMSResourceMgr.java:41)
        at org.apache.ranger.services.kms.RangerServiceKMS.validateConfig(RangerServiceKMS.java:55)
        at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:560)
        at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:547)
        at org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:508)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:218)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
        ... 16 more
2017-02-17 09:46:35,465 [timed-executor-pool-0] ERROR apache.ranger.services.kms.client.KMSResourceMgr (KMSResourceMgr.java:43) - <== KMSResourceMgr.validateConfig Error: org.apache.ranger.plugin.client.HadoopException: Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin
2017-02-17 09:46:35,465 [timed-executor-pool-0] ERROR org.apache.ranger.services.kms.RangerServiceKMS (RangerServiceKMS.java:57) - <== RangerServiceKMS.validateConfig Error:org.apache.ranger.plugin.client.HadoopException: Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin
2017-02-17 09:46:35,465 [timed-executor-pool-0] ERROR org.apache.ranger.biz.ServiceMgr$TimedCallable (ServiceMgr.java:510) - TimedCallable.call: Error:org.apache.ranger.plugin.client.HadoopException: Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin
2017-02-17 09:46:35,466 [http-bio-6080-exec-5] ERROR org.apache.ranger.biz.ServiceMgr (ServiceMgr.java:188) - ==> ServiceMgr.validateConfig Error:org.apache.ranger.plugin.client.HadoopException: org.apache.ranger.plugin.client.HadoopException: Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin
2017-02-17 09:46:54,424 [http-bio-6080-exec-1] INFO  org.apache.ranger.biz.ServiceDBStore (ServiceDBStore.java:2503) - Creating default KMS policy item for hdfs
2017-02-17 09:46:54,430 [http-bio-6080-exec-1] INFO  org.apache.ranger.biz.ServiceDBStore (ServiceDBStore.java:2518) - Creating default KMS policy item for hive
[root@sandbox ambari]#


Connection Failed.
Unable to retrieve any files using given parameters, You can still save the repository and start creating policies, but you would not be able to use autocomplete for resource names. Check ranger_admin.log for more info.

org.apache.ranger.plugin.client.HadoopException: Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin. 
Exception while getting Kms Key List. URL : http://localhost:9292/kms/v1/keys/names?user.name=keyadmin. 
java.net.ConnectException: Connection refused (Connection refused). 
Connection refused (Connection refused).

Can anyone please help me to fix the issue.

install-properties.txtservice.png

1 REPLY 1

Contributor

@Prasanta Sahoo

Please try providing the KMS server IP for KMS url and validate if the connection is successful by doing a "Test Connection".

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