0
votes

is there a way to assign to hive metastoreclient a list of ConnectionURL in order ask hive metastore to connect to an other database in case of the first one fails ?

the only property that i found in hive-site.xml is ( and it's only accept one URL) :

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://myhost/metastore</value>
  <description>the URL of the MySQL database</description>
</property>
1
I don't think this is supported - facha
so how to implement a failover with the metastore db ? do i need to add a load balancer ? - Mehdi TAZI
Do you have HA on the metastore service, to begin with? - Samson Scharfrichter

1 Answers

0
votes

Straight from MySQL documentation:

# Connection URL for a server failover setup: 
jdbc:mysql//primaryhost,secondaryhost1,secondaryhost2/test

# Connection URL for load balancing: 
jdbc:mysql:loadbalance://localhost:3306,localhost:3310/sakila

# Connection URL for server replication: 
jdbc:mysql:replication://master,slave1,slave2,slave3/test

So it's a MySQL setup issue, not a Metastore config issue.

https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html