Support Questions

Find answers, ask questions, and share your expertise

Ranger Admin does not start

avatar
New Contributor

New install on CENTOS 7.
Trying to start all services, but ranger admin fails every time with variants of:

SQLException : SQL state: HY000 java.sql.SQLException: null, message from server: "Host 'XXXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" ErrorCode: 1129

Which I clear with flush-hosts

Ranger Password change utility is being executed by some other process

Which I clear with: delete from x_db_version_h WHERE version = 'DEFAULT_ADMIN_UPDATE';

But I never get passed:

2018-07-19 17:08:02,416  [E] Can't establish connection!! Exiting..
2018-07-19 17:08:02,417  [I] Please run DB setup first or contact Administrator..

Command failed after 1 tries

Any ideas how to get Ranger Admin started?

7 REPLIES 7

avatar
Super Guru

Are you trying to have ambari/ranger create the database and user? I manually create my ranger user and ranger databases before setting up the ranger config and testing the connection.

Go into ranger config and validate all of your settings are correct. Then Test Connection. Report back any errors here if you can.

avatar
New Contributor

Yes, I let Ambari/ranger create all - new to this stack and install, so would not have an idea if my settings are incorrect. I did try a manual install, but get the same errors. Possibly a new issue introduced with hdp 3-.0.0?
Can you point me at steps you take to config and validate all your settings are correct... and then how to test the connection?

Thanks!

avatar
Super Guru

@Bryan A I tried a few times to reply, but i guess mods deleted the replies as they are gone this morning. Ranger Admin in HDP 3.0 should work out of the box. Just make sure you follow all of the directions for creating the database, correct database user permissions, and ambari-server mysql connector. With the settings for mysql in the ranger config, clicking test connectrion button will report any errors in a modal. Just click the link created next to the button to view the output during connect testing.

avatar
Master Mentor

@Bryan A

I can help out on this. I just completed an HDP 3.0 cluster installation.

Centos 7 comes with MariaDB, the setup steps are exactly the same, only different MariaDB is open source in fact its a spinoff of MySQL.

Assumption:

  • Database = MySQL
  • MariaDB root user password=welcome1
  • MariaDB host =MySQL_host
  • Ranger user password= ranger

First, ensure you MariaDB/MySQL is up and running.

# yum install -y mysql-connector-java

Setup Ambari

The below step can be re-run many times so no worries

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

Check status and enable autostart perform these steps as the root user

# systemctl status mysql 
# systemctl enable mysql.service
# systemctl start mysql.service

Run the status check after the above sequence to validate that MariaDB is up and running

Harden MySQL

It's good practice to secure you MariaDB installation

 sudo mysql_secure_installation

Ref: Secure MariaDB

mysql -u root -pwelcome1
CREATE USER 'ranger'@'localhost' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost';
CREATE USER 'ranger'@'%' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%';
CREATE USER 'ranger'@'<MySQL/MariaDB_host>' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'<MySQL/MariaDB_host>';
FLUSH PRIVILEGES;
quit; 

Connect as user ranger

mysql -u ranger -pranger 
CREATE DATABASE ranger; 
use ranger; 
show databases; 
quit;

Now in the Ambari UI when configuring the ranger components see attached screenshot replace my hostname with the FQDN of your MySQL host.

And test the connection which MUST succeed to be able to install correctly Ranger. I have used a simple password

Please revert


ranger30.jpg

avatar
Super Guru

I was able to get it up without any issues.

1. install mariadb-server & mysql connector as follows

yum install mysql-connector-java -y
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

2. Execute sql:

CREATE DATABASE ranger;
CREATE USER 'ranger'@'%' IDENTIFIED BY 'ranger';
CREATE USER 'ranger'@'RANGERHOST' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'RANGERHOST' WITH GRANT OPTION;
FLUSH PRIVILEGES;

CREATE DATABASE rangerkms;
CREATE USER 'rangerkms'@'%' IDENTIFIED BY 'rangerkms';
CREATE USER 'rangerkms'@'RANGERHOST' IDENTIFIED BY 'rangerkms'; |
GRANT ALL PRIVILEGES ON *.* TO 'rangerkms'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'rangerkms'@'RANGERHOST' WITH GRANT OPTION;
FLUSH PRIVILEGES;

3. Enter settings in ranger config and then click TEST

avatar
Master Mentor

@Bryan A

Any updates? If it resolved your problem please accept the answer and close the thread !!

avatar
Master Mentor

@Bryan A

Can you help close this thread