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.

Ranger Web UI unavailable

ok so i got ranger admin and user sync running however i have two amber alerts about the ranger WEB UI giving a 404 and i cant access it.
i ranger the service check on the ranger service and this is the error message i get.

stderr:   /var/lib/ambari-agent/data/errors-4899.txt
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/service_check.py", line 49, in <module>
    RangerServiceCheck().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/service_check.py", line 34, in service_check
    self.check_ranger_admin_service(params.ranger_external_url, params.upgrade_marker_file)
  File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/service_check.py", line 43, in check_ranger_admin_service
    logoutput=True)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 273, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of 'curl -s -o /dev/null -w'%{http_code}' --negotiate -u: -k http://<server name removed>:6080/login.jsp | grep 200' returned 1.

so it seems for some reason it can not connect to the Ranger web UI any thoughts on why that is?

7 REPLIES 7

Mentor

@steve coyle

Could you check the value of External URL in Ranger

Ambari Ui--->Ranger---->Config---->Advanced

It should be FQDN of the host where ranger is installed.


coyle.png

@Geoffrey Shelton Okot

yup it is there http://<servers fqdn>:6080

i have ldap checked should that be set to none to auth?

Mentor

@steve coyle

If it's LDAP checked that's not a problem, that just means you will use your LDAP login to access Ranger.

Question have you already done the LDAP setup ? The External URL looks okay but does it map to you /etc/hosts entry?
have you checked whether that port 6080 is available ?

@Geoffrey Shelton Okot

yeah it looks all good. i turned off iptables just to make sure it wasnt a firewall issue. the ranger admin is on the same server as ambari-server as well and ambari is working fine. the URL matches with my hosts files as well.

@Geoffrey Shelton Okot

so i dug into the ranger-admin logs and i see this error being repeated.

2017-08-03 14:07:29,908 [<server name removed>l-startStop-1] FATAL org.apache.ranger.plugin.store.EmbeddedServiceDefsUtil (EmbeddedServiceDefsUtil.java:181) - EmbeddedSe$
javax.persistence.PersistenceException:
 Exception [EclipseLink-4002] (Eclipse Persistence Services - 
2.5.2.v20131113-a7346c6): org.eclipse.persistence.exceptions.Datab$
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ranger.x_service_def' doesn't exist
Error Code: 1146

it seems a table is missing some where thats throwing an error code? would it just be easier to remove the ranger service and reinstall it?

ranger admin is running on my ambari-server machine as well. dont know if that might cause issues.

Mentor

@steve coyle

Stop the Ranger component and the remove the service.

Create a new ranger database .

##################################################
# Create the Ranger database.
# Assumption the mysql root password is welcome20
# Ranger user 0ranger
# Ranger password=ranger
##################################################
mysql -u root -pwelcome20
CREATE USER 'ranger'@'localhost' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'range_host_name';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'range_host_name' IDENTIFIED BY 'ranger' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost' IDENTIFIED BY 'ranger' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
###################################
mysql -u ranger -pranger
CREATE DATABASE ranger;
################################

Install the Ranger component through Ambari and try to configure ranger to using the credential earlier created

Start the ranger service that should work

Mentor

@steve coyle

Sorry for getting back late. Can you login to Ambari/Ranger UI using you LDAP credentials?

With Ranger you can still authenticate and authorize without LDAP.

Once you have enable the different plugins ie hive,hbase,nifi etc everything can e done from Ranger UI.

Please let me know

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