title: Setting Remote hive metastore on postgresql for EMR
body: <p>I am trying to setup postgresql db as external Hive metastore for AWS EMR.
  I have tried hosting it on both EC2 and RDS.</p>
  
  <p>I have already tried steps as given <a href="https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-hive-metastore-external.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>But it doesnt go through, EMR fails in the provisioning step only with message </p>
  
  <blockquote>
    <p>On the master instance (instance-id), application provisioning failed</p>
  </blockquote>
  
  <p>I could not decipher anything from the failure log.</p>
  
  <p>I also copied postgresql jdbc jar in paths </p>
  
  <blockquote>
    <p>/usr/lib/hive/lib/  and  /usr/lib/hive/jdbc/
    in case EMR doesnt already has it, but still no help!</p>
  </blockquote>
  
  <p>Then I setup the system by manually editing <code>hive-site.xml</code> and setting properties:</p>
  
  <pre><code>javax.jdo.option.ConnectionURL
  javax.jdo.option.ConnectionDriverName
  javax.jdo.option.ConnectionUserName
  javax.jdo.option.ConnectionPassword
  datanucleus.fixedDatastore
  datanucleus.schema.autoCreateTables
  </code></pre>
  
  <p>and had to run <code>hive --service metatool -listFSRoot</code>.</p>
  
  <p>After these manual settings I was able to get EMR to use postgres db as remote metastore.</p>
  
  <p>Is there any way I can make it work using the configuration file as mentioned in official documentation?</p>
  
  <p>Edit:
  Configuration setting I am using to for remote mysql metastore:</p>
  
  <p>classification=hive-site,properties=[javax.jdo.option.ConnectionURL=jdbc:mysql://[host]:3306/[dbname]?createDatabaseIfNotExist=true,javax.jdo.option.ConnectionDriverName=org.mariadb.jdbc.Driver,javax.jdo.option.ConnectionUserName=[user],javax.jdo.option.ConnectionPassword=[pass]]</p>