K
K
Katya Smirnova2021-04-19 08:08:26
linux
Katya Smirnova, 2021-04-19 08:08:26

How to tell the program about the new redis shard?

Good day, there is a high-load program that uses redis as a way to deliver messages.
We do not use any high-level utilities like sentinel. All by hand. For each shard, its own object is created in the program, in each node of the program, records about the currently connected shards are stored in the map.
The program receives a list of available shards at startup, from environment variables.

The question is: if one of the shards has disappeared, how to notify the program about the availability of a new shard, without restarting it? In general, reloading the config via SIGHUP comes to mind, but I thought that there might be a better way.

use the redigo

UPD library
Since the program is deployed on Kubernetes, maybe there are some goodies with a notification about the availability of a new cluster? Or in configmap it is possible to use reactivity somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2021-04-19
@sireax

Why not use consul.io? This tool is designed for just that.
In principle, any distributed storage will do, from zookeper to etcd.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question