Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Highlighted

Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer
 
12 REPLIES 12
Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Rising Star

@Ritika Sinha

Yes, you can use the same MySQL Server to store all the DBs (like Hive, Oozie, ambari etc...) and in fact it is easy to maintain if you have them on one single server (in terms of backup and recovery). Make sure you have the ranger DB specified or the admin id which can create these DBs as part of your blueprint and it should work fine.

Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer

@grajagopalThanks for the reply. I tried using the same MYSQL server, but for hive we can only set the database username as "hive" (by default) and database password via blueprint properties. And Ranger requires the access to MYSQL server as "root" user with password. Is there a way where I can set the password for the mysql server user "root" in the blueprint properties.

Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Rising Star

@Ritika Sinha

Yes. You can add the below attribute within "ranger-admin-site" : in configuration section

"ranger.jpa.jdbc.password" : "rangeradminrootpassword",

You can Just FYI... 'hive' is just a default user name, you can always create your own users on mysql and provide all access to 'hive' db and mention the creds via ambari.

Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer

@grajagopal I guess this will not set the password for root user for MYSQL server. I need to do that to connect to the mysql server from another instance in my cluster. Where ranger and mysql server resides in two different machines.

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer

Look for below section or add this section in your blueprint file :

{ "admin-properties": { "properties": { "db_root_password": "mysqlrootpassword", "db_password": "rangeradmin", "policymgr_external_url": "http://%HOSTGROUP::host_group_3%:6080", "db_root_user": "mysqlroot", "DB_FLAVOR": "MYSQL", "db_user": "rangeradmin", "db_name": "ranger", "db_host": "172.22.0.1" } } }
Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer
@PradeeP AgrawaL

I tried with the following properties in my blueprint, but I get connection db connection issue. Actually the password required here is needed to connect to the mysql server as the user root. As ranger requires creating a new user ranger-admin, that can only be achieved if I access mysql server via root credentials. This property does not sets the password for root user, instead it requires the root password. While setting MYSQL for HIVE we only set passwords for hive user, not root.

      "admin-properties" : {
        "properties_attributes" : { },
        "properties" : {
          "DB_FLAVOR" : "MYSQL",
          "audit_db_name" : "ranger_audit",
          "db_name" : "ranger",
          "audit_db_user" : "rangerlogger",
          "SQL_CONNECTOR_JAR" : "/usr/share/java/mysql-connector-java.jar",
          "db_user" : "rangeradmin",
          "db_password" : "ranger",
          "policymgr_external_url" : "http://ip-10-0-1-118:6080",
          "db_host" : "ip-10-0-1-119:3306",
          "db_root_user" : "root"
          "db_root_password" : "testpassword"
        }
      }
    } 
Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Rising Star

@Ritika Sinha

The db_root_password should work. Could you please paste the error you are receiving.,

Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer

@Ritika Sinha : Is it true that your current root password is blank ? Please note that Hive comes with two install mode : one is 'new install' and another is 'existing install' mode. In case of 'new install' mode, hive install MySQL also and can set the provided root credentials; while in case of existing install hive expect that root credentials shall be provided so that hive meta store can be installed in given MySQL host by using provided root credentials.

Highlighted

Re: Hello , I am trying to get Ranger up in HDP 2.5 cluster via blueprints. Is there a way I can use the same MYSQL (one of the database servers required for hive) server which comes up for HIVE.

Explorer

@PradeeP AgrawaL

Yes current root password is blank. As I am going with the option for HIVE to create a new install of MYSQL, while passing the configuration for HIVE in my blueprint I am only able to add these following properties. Not sure of how can I include password for root user in these configuration.

{
      "hive-site" : {
        "properties" : {
          "hive_database_type" : "MYSQL",
          "javax.jdo.option.ConnectionURL" : "jdbc:mysql://<hostname>/hive?createDatabaseIfNotExist=true", 
          "ambari.hive.db.schema.name" : "hive",
          "javax.jdo.option.ConnectionDriverName" : "com.mysql.jdbc.Driver",
          "javax.jdo.option.ConnectionUserName": "hive",    
          "javax.jdo.option.ConnectionPassword" : "hive"
        }
      }
    },

Don't have an account?
Coming from Hortonworks? Activate your account here