Created 11-17-2017 04:55 PM
Hi,
In my test environment Ranger install with Ambari Blueprint fails with with DB access error. I have added RANGER_ADMIN, HIVE_SERVER, HIVE_METASTORE and MYSQL_SERVER components to the blueprints. The MySQL server has been correctly installed/configured by Ambari and it seems that Hive is able to use it without any problem, but Ranger setup fails with the following error:
17 15:40:00,148 [I] Running DBA setup script. QuiteMode:True 2017-11-17 15:40:00,149 [I] Using Java:/usr/lib/jvm/java/bin/java 2017-11-17 15:40:00,149 [I] DB FLAVOR:MYSQL 2017-11-17 15:40:00,149 [I] DB Host: 2017-11-17 15:40:00,149 [I] ---------- Verifying DB root password ---------- 2017-11-17 15:40:00,150 [I] DBA root user password validated 2017-11-17 15:40:00,150 [I] ---------- Verifying Ranger Admin db user password ---------- 2017-11-17 15:40:00,150 [I] admin user password validated 2017-11-17 15:40:00,150 [I] ---------- Creating Ranger Admin db user ---------- 2017-11-17 15:40:00,150 [JISQL] /usr/lib/jvm/java/bin/java -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-5.1.39-bin.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql:///mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();" SQLException : SQL state: 28000 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) ErrorCode: 1045 2017-11-17 15:40:00,714 [E] Can't establish db connection.. Exiting.. Traceback (most recent call last):
Please note that logging in to the machine and changing password is not really an option since I want to automate the installation of Hive, Ranger and MySQL from Blueprint .
My blueprint: blueprint.txt
Attila
Created 11-17-2017 05:00 PM
Can you try running these mysql commands before triggering the blueprint
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
Thanks,
Aditya
Created 11-17-2017 05:00 PM
Can you try running these mysql commands before triggering the blueprint
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
Thanks,
Aditya
Created 11-17-2017 05:38 PM
Thanks, but before triggering the blueprint the mysql is still not installed. MYSQL_SEVER is part of the blueprint and it is installed by Ambari.
Created 11-17-2017 06:02 PM
DB pre-requisites need to be met before running the blueprint. Use the same mysql server for hive metastore as well.
You can select "Existing MySQL / MariaDB Database" for hive metastore. For blueprint check "hive_database" in hive-env properties
Created 11-23-2017 11:00 AM
@Aditya Sirna Is there a way to add the SQL commands to the blueprint, (or reference to a script file) that should be run on MySQL once MySQL has been installed. Without the blueprint, there is no MySQL installed, so the commands should also be part of the blueprint if thats possible.
Created 11-23-2017 02:49 PM
I'm not sure if we can add MySQL commands to a blueprint. The idea is to install and setup MySQL server and then trigger the blueprint as Ranger has this as a pre-requisite. If you have a MySQL server installed and set 'create_db_users' as true, then ranger will create the users for you provided you give MySQL's root credentials.
Created 11-20-2017 05:22 PM
Yes, please make sure to meet DB pre-requisites before creating cluster using blueprint.