Hive Metastore leader election properties

Properties that control Hive Metastore (HMS) dynamic leader election, including the election mode, the audit table, and lock retry behavior.

Set the following properties in the Hive Metastore Server Advanced Configuration Snippet (Safety Valve) for hive-site.xml to configure dynamic leader election.

Table 1. HMS dynamic leader election properties
PropertyDescriptionDefault
metastore.housekeeping.leader.auditTable Specifies a Hive table that tracks leadership changes. The table is in text format with JSON serialization and is created automatically if it does not exist. Cloudera recommends setting this property in a production environment so that you can view the leader change history by running a query against the table. Empty string
metastore.housekeeping.leader.election Specifies how HMS elects the leader. With the default value, HMS chooses the leader based on metastore.housekeeping.leader.hostname. Set the value to lock for HMS to use a Hive lock to elect the leader dynamically. local
metastore.lock.numretries Specifies the number of times HMS tries to acquire all the locks if the attempt fails. 100
metastore.lock.sleep.between.retries Specifies the maximum sleep time between lock retries if the attempt fails. 60s