Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

What are the blueprint properties for specifying the Oozie/Hive database user and password when using an external db?

avatar
Rising Star
 
1 ACCEPTED SOLUTION

avatar

Blueprint:

{
  "Blueprints" : {
    "stack_name" : "HDP",
    "stack_version" : "2.3"
  },
  "configurations" : [
    {
      "hive-site" : {
        "properties" : {
          "javax.jdo.option.ConnectionDriverName" : "com.mysql.jdbc.Driver",
          "javax.jdo.option.ConnectionURL" : "jdbc:mysql://%HOSTGROUP::hg_master_node_3%/hive?createDatabaseIfNotExist=true",
          "javax.jdo.option.ConnectionUserName": "hive"
        }
      }
    },
    {
      "oozie-site" : {
        "properties" : {
          "oozie.service.JPAService.jdbc.driver" : "com.mysql.jdbc.Driver",
          "oozie.service.JPAService.jdbc.url" : "jdbc:mysql://%HOSTGROUP::hg_master_node_3%/oozie",
          "oozie.service.JPAService.jdbc.username" : "oozie",
          "oozie.db.schema.name" : "oozie",
        }
      }
    },
    {
      "oozie-env" : {
        "properties" : {
          "oozie_hostname" : "%HOSTGROUP::hg_master_node_3%",
          "oozie_database" : "Existing MySQL Database"
        }
      }
    },
    {
      "hive-env" : {
        "properties" : {
          "hive_database" : "Existing MySQL Database",
          "hive_database_name" : "hive",
          "hive_database_type" : "mysql",
          "hive_hostname" : "%HOSTGROUP::hg_master_node_3%"
        }
      }
    }
  ],
  "host_groups" : [
    ...
  ]
}

Hostgroup-Mapping/Cluster:

{
  "blueprint" : "bigdata_blueprint",
  "default_password" : "my-super-secret-password",
  "configurations" : [
    {
      "hive-site" : {
        "properties" : {
          "javax.jdo.option.ConnectionPassword" : "my-super-secret-password_2"
        }
      }
    },
    {
      "oozie-site" : {
        "properties" : {
          "oozie.service.JPAService.jdbc.password" : "my-super-secret-password_3"        }
      }
    }
  ],
  "host_groups" :[
    ...
  ]
}




View solution in original post

2 REPLIES 2

avatar

Blueprint:

{
  "Blueprints" : {
    "stack_name" : "HDP",
    "stack_version" : "2.3"
  },
  "configurations" : [
    {
      "hive-site" : {
        "properties" : {
          "javax.jdo.option.ConnectionDriverName" : "com.mysql.jdbc.Driver",
          "javax.jdo.option.ConnectionURL" : "jdbc:mysql://%HOSTGROUP::hg_master_node_3%/hive?createDatabaseIfNotExist=true",
          "javax.jdo.option.ConnectionUserName": "hive"
        }
      }
    },
    {
      "oozie-site" : {
        "properties" : {
          "oozie.service.JPAService.jdbc.driver" : "com.mysql.jdbc.Driver",
          "oozie.service.JPAService.jdbc.url" : "jdbc:mysql://%HOSTGROUP::hg_master_node_3%/oozie",
          "oozie.service.JPAService.jdbc.username" : "oozie",
          "oozie.db.schema.name" : "oozie",
        }
      }
    },
    {
      "oozie-env" : {
        "properties" : {
          "oozie_hostname" : "%HOSTGROUP::hg_master_node_3%",
          "oozie_database" : "Existing MySQL Database"
        }
      }
    },
    {
      "hive-env" : {
        "properties" : {
          "hive_database" : "Existing MySQL Database",
          "hive_database_name" : "hive",
          "hive_database_type" : "mysql",
          "hive_hostname" : "%HOSTGROUP::hg_master_node_3%"
        }
      }
    }
  ],
  "host_groups" : [
    ...
  ]
}

Hostgroup-Mapping/Cluster:

{
  "blueprint" : "bigdata_blueprint",
  "default_password" : "my-super-secret-password",
  "configurations" : [
    {
      "hive-site" : {
        "properties" : {
          "javax.jdo.option.ConnectionPassword" : "my-super-secret-password_2"
        }
      }
    },
    {
      "oozie-site" : {
        "properties" : {
          "oozie.service.JPAService.jdbc.password" : "my-super-secret-password_3"        }
      }
    }
  ],
  "host_groups" :[
    ...
  ]
}




avatar

@kkane important update on the above answer.

At the moment hostgroup variables are not replaced by the actual hostnames, e.g. %HOSTGROUP::hg_master_node_3% is not replaced by c6603.ambari.apache.org. @Olivier Renault pointed this out to me today (Thanks!!). A RMP ticket has already been opened for this missing feature and the implementation is currently planned for one of the next major Ambari versions.

One way to work around this missing piece is to replace the hostgroup variable with the actual hostname.