Redis-based CacheStore of HiveMetaStore

Scenario

The MetaStore service of Hive can cache the metadata of some tables in Redis.

Prerequisites

The Redis service has been installed in a cluster.

Precautions

If Redis is switched back to the native non-cache mode and then switched back after a period of time, the added, deleted, or modified metadata cannot be synchronized to the Redis when the database is used. Therefore, before switching back, you must clear the cache table in the Redis and synchronize the metadata again in either of the following two clearing modes:

  • Log in to the Redis client and run the flushall command on all Redis nodes.

  • Log in to the Redis client and run the following commands to change the two Redis identifiers. {hiveServiceName} is the value of HIVE_DEFAULT_GROUP in the Metastore configuration file ENV_VARS. The default value is hive.

    set {hiveServiceName}-hive-isRedisAvailable false

    del {hiveServiceName}-hive-isCanPrewarm