antonvash / redis-cluster Goto Github PK
View Code? Open in Web Editor NEWredis-cluster
redis-cluster
Ноды сохраняют свое состояние в статусе мастер в момент падения и после этого поднимаются в этом состоянии:
Шаги по воспроизведению:
После очередного дискавери со стороны Sentinel кластера, статус выправляется, но в этот момент пока ситуация существует (~20сек) происходит рассинхронизация Redis кластера, так как все 3 ноды считают себя мастером.
Как в таких случаях будет осуществляться отказоустойчивость?
git clone XXX
make init
Дожидаемся старта, проверяем в http://localhost:9000/haproxy_stats появление master.
Останавливаем master
docker stop redis-cluster_redis1_1
Ожидаемое поведение - срабатывает failover, статус master переходит на живую ноду кластера.
Добрый вечер!
~/redis-cluster-master$ docker-compose -v
docker-compose version 1.26.2, build eefe0d31
~/redis-cluster-master$ docker -v
Docker version 19.03.13, build 4484c46d9d
~/redis-cluster-master$ make -v
GNU Make 4.2.1
~/redis-cluster-master$ make init
docker-compose -f docker-compose.yml up -d
WARNING: Some services (sentinel) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Creating network "redis-cluster-master_default" with the default driver
Pulling redis1 (bitnami/redis:latest)...
latest: Pulling from bitnami/redis
522a7372a4ae: Pull complete
faccd8da6b35: Pull complete
c8ecd05c1389: Pull complete
5454355e9e99: Pull complete
7feafbc76371: Pull complete
1882d0155fb8: Pull complete
42d3808979fb: Pull complete
22ff6ee558a9: Pull complete
c5c2e6a8c286: Pull complete
336f54118055: Pull complete
6c1a8ee75e27: Pull complete
15fc6d39160c: Pull complete
Digest: sha256:7f315785695d5e808c44db242dd258d3539c0fa3c185e9671414b2c0d0b391a2
Status: Downloaded newer image for bitnami/redis:latest
Pulling sentinel (bitnami/redis-sentinel:latest)...
latest: Pulling from bitnami/redis-sentinel
522a7372a4ae: Already exists
d0e4cf0295ab: Pull complete
45e0fcee51d5: Pull complete
3ea4dfc96b2e: Pull complete
7b0d419c75f2: Pull complete
28a4d4deb457: Pull complete
d001f4eafb5c: Pull complete
d07a1f980cd2: Pull complete
25b56848f24f: Pull complete
Digest: sha256:f2acdea7d18d57e05ca543a58bea292952b3158aa90e08c858f86d4fac8472ec
Status: Downloaded newer image for bitnami/redis-sentinel:latest
Pulling lb (haproxy:2.2-alpine)...
2.2-alpine: Pulling from library/haproxy
df20fa9351a1: Pull complete
569c8f92348a: Pull complete
e11e66ab2897: Pull complete
Digest: sha256:f6715e4b146145cf67b89ee8ba9a4fc19547bc12453b9ef1ee4e60518728c95c
Status: Downloaded newer image for haproxy:2.2-alpine
Pulling benchmark (redis:4-alpine)...
4-alpine: Pulling from library/redis
cbdbe7a5bc2a: Pull complete
dc0373118a0d: Pull complete
cfd369fe6256: Pull complete
152ffd6a3b24: Pull complete
7c01860f13a3: Pull complete
aa6ecacd3bee: Pull complete
Digest: sha256:aaf7c123077a5e45ab2328b5ef7e201b5720616efac498d55e65a7afbb96ae20
Status: Downloaded newer image for redis:4-alpine
Creating redis-cluster-master_redis1_1 ... done
Creating redis-cluster-master_redis2_1 ... done
Creating redis-cluster-master_redis3_1 ... done
Creating redis-cluster-master_sentinel_1 ... done
Creating redis-cluster-master_lb_1 ... done
Creating redis-cluster-master_benchmark_1 ... done
~/redis-cluster-master$ curl -v localhost:9000
* Trying 127.0.0.1:9000...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9000 (#0)
> GET / HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 503 Service Unavailable
< content-length: 107
< cache-control: no-cache
< content-type: text/html
<
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
* Connection #0 to host localhost left intact
В тексте readme всё корректно?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.