Created 07-19-2018 05:46 PM
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?
Created 07-19-2018 06:08 PM
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.
Created 07-19-2018 06:15 PM
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!
Created 07-20-2018 11:23 AM
@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.
Created 07-20-2018 01:13 PM
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:
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
Created 07-20-2018 06:19 PM
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
Created 07-21-2018 10:59 AM
Any updates? If it resolved your problem please accept the answer and close the thread !!
Created 07-25-2018 11:21 AM
Can you help close this thread