WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Athens supports two mechanisms of communicating with redis: direct connection, and
376
+
connecting via redis sentinels.
377
+
378
+
#### Direct connection to redis
379
+
380
+
Using a direct connection to redis is simple, and only requires a single `redis-server`.
381
+
You can also optionally specify a password to connect to the redis server with
382
+
383
+
SingleFlightType = "redis"
384
+
385
+
[SingleFlight]
386
+
[SingleFlight.Redis]
387
+
# Endpoint is the redis endpoint for the single flight mechanism
388
+
# Env override: ATHENS_REDIS_ENDPOINT
389
+
Endpoint = "127.0.0.1:6379"
390
+
391
+
# Password is the password for the redis instance
392
+
# Env override: ATHENS_REDIS_PASSWORD
393
+
Password = ""
394
+
395
+
#### Connecting to redis via redis sentinel
396
+
397
+
**NOTE**: redis-sentinel requires a working knowledge of redis and is not recommended for
398
+
everyone.
399
+
400
+
redis sentinel is a high-availability set up for redis, it provides automated monitoring, replication,
401
+
failover and configuration of multiple redis servers in a leader-follower setup. It is more
402
+
complex than running a single redis server and requires multiple disperate instances of redis
403
+
running distributed across nodes.
404
+
405
+
For more details on redis-sentinel, check out the [documentation](https://redis.io/topics/sentinel)
406
+
407
+
As redis-sentinel is a more complex set up of redis, it requires more configuration than standard redis.
408
+
409
+
Required configuration:
410
+
411
+
-`Endpoints` is a list of redis-sentinel endpoints to connect to, typically 3, but more can be used
412
+
-`MasterName` is the named master instance, as configured in the `redis-sentinel`[configuration](https://redis.io/topics/sentinel#configuring-sentinel)
413
+
414
+
Optionally, like `redis`, you can also specify a password to connect to the `redis-sentinel` endpoints with
415
+
416
+
SingleFlightType = "redis-sentinel"
417
+
418
+
[SingleFlight]
419
+
[SingleFlight.RedisSentinel]
420
+
# Endpoints is the redis sentinel endpoints to discover a redis
421
+
# master for a SingleFlight lock.
422
+
# Env override: ATHENS_REDIS_SENTINEL_ENDPOINTS
423
+
Endpoints = ["127.0.0.1:26379"]
424
+
# MasterName is the redis sentinel master name to use to discover
425
+
# the master for a SingleFlight lock
426
+
MasterName = "redis-1"
427
+
# SentinelPassword is an optional password for authenticating with
0 commit comments