我们在out kubernetes集群中使用一个redis缓存,它实际上是随机停止工作的。这是一个基于这个图像的独立版本: bitnami/redis:6.0.15
作为自定义参数,我们使用:
大师真
REDIS_AOF_ENABLED号
每次红宝石停止工作时,我都会看到以下日志:
Jul 5 13:30:27 redis-0 redis 1:M 05 Jul 2022 11:30:27.060 * 10000 changes in 60 seconds. Saving...
Jul 5 13:30:27 redis-0 redis 1:M 05 Jul 2022 11:30:27.090 * Background saving started by pid 364
Jul 5 13:31:34 redis-0 redis 364:C 05 Jul 2022 11:31:34.307 * DB saved on disk
Jul 5 13:31:34 redis-0 redis 364:C 05 Jul 2022 11:31:34.341 * RDB: 431 MB of memory used by copy-on-write
Jul 5 13:31:34 redis-0 redis 1:M 05 Jul 2022 11:31:34.488 * Background saving terminated with success
Jul 5 13:32:35 redis-0 redis 1:M 05 Jul 2022 11:32:35.022 * 10000 changes in 60 seconds. Saving...
Jul 5 13:32:35 redis-0 redis 1:M 05 Jul 2022 11:32:35.052 * Background saving started by pid 365
-----
Jul 5 13:32:40 redis-0 redis 1:S 05 Jul 2022 11:32:40.436 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
Jul 5 13:32:40 redis-0 redis 1:S 05 Jul 2022 11:32:40.436 * REPLICAOF 178.20.40.200:8886 enabled (user request from 'id=71457 addr=10.0.16.46:14072 fd=12 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=47 qbuf-free=32721 argv-mem=24 obl=0 oll=0 omem=0 tot-mem=61488 events=r cmd=slaveof user=default')
Jul 5 13:32:41 redis-0 redis 1:S 05 Jul 2022 11:32:41.316 * Connecting to MASTER 178.20.40.200:8886
Jul 5 13:32:41 redis-0 redis 1:S 05 Jul 2022 11:32:41.316 * MASTER <-> REPLICA sync started
Jul 5 13:32:41 redis-0 redis 1:S 05 Jul 2022 11:32:41.362 * Non blocking connect for SYNC fired the event.
Jul 5 13:32:41 redis-0 redis Error 1:S 05 Jul 2022 11:32:41.409 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
Jul 5 13:32:42 redis-0 redis 1:S 05 Jul 2022 11:32:42.316 * Connecting to MASTER 178.20.40.200:8886
Jul 5 13:32:42 redis-0 redis 1:S 05 Jul 2022 11:32:42.317 * MASTER <-> REPLICA sync started
Jul 5 13:32:42 redis-0 redis 1:S 05 Jul 2022 11:32:42.366 * Non blocking connect for SYNC fired the event.
Jul 5 13:32:42 redis-0 redis Error 1:S 05 Jul 2022 11:32:42.415 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
Jul 5 13:32:43 redis-0 redis 1:S 05 Jul 2022 11:32:43.317 * Connecting to MASTER 178.20.40.200:8886
Jul 5 13:32:43 redis-0 redis 1:S 05 Jul 2022 11:32:43.317 * MASTER <-> REPLICA sync started
Jul 5 13:32:43 redis-0 redis 1:S 05 Jul 2022 11:32:43.366 * Non blocking connect for SYNC fired the event.
Jul 5 13:32:43 redis-0 redis Error 1:S 05 Jul 2022 11:32:43.416 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
Jul 5 13:32:44 redis-0 redis 1:S 05 Jul 2022 11:32:44.320 * Connecting to MASTER 178.20.40.200:8886
Jul 5 13:32:44 redis-0 redis 1:S 05 Jul 2022 11:32:44.320 * MASTER <-> REPLICA sync started
Jul 5 13:32:44 redis-0 redis 1:S 05 Jul 2022 11:32:44.370 * Non blocking connect for SYNC fired the event.然后,我看到队列增加,但我需要关闭吊舱重新启动redis,否则它将不再工作。
next: GET 6126674261995698486, 
inst: 1, 
qu: 0,  // queue => waiting operations
qs: 17, 
aw: False, 
rs: ReadAsync, 
ws: Idle, 
in: 0, // bytes waiting from input stream
in-pipe: 0, 
out-pipe: 0, 
serverEndpoint: redis.default.svc.cluster.local:6379, 
mc: 1/1/0, 
mgr: 10 of 10 available, // tread pool
clientName: production-9bbd94544-nlmv7, 
IOCP: (Busy=0,Free=1000,Min=5,Max=1000),  // no busy threads
WORKER: (Busy=14,Free=32753,Min=256,Max=32767), 
v: 2.2.4.27433```
```Timeout performing GET (3000ms), 下一步: 2865582319381864083,
inst: 0,
曲: 0,
qs: 333,
胡仙:假的,
rs: ReadAsync,
闲着,
在: 0,
烟斗里: 0,
出水管: 0,
serverEndpoint: redis.default.svc.cluster.local:6379,
mc: 1/1/0,
经理:十分之十,
clientName:生产-58c7874fd8-tdcpz,
(Busy=0,Free=1000,Min=1,Max=1000)
工人:(Busy=3,Free=32764,Min=256,Max=32767)
五: 2.2.4.27433
```javascript下一步:获得6126674261995698486,
inst: 47
曲: 0,
qs: 21368,
胡仙:假的,
rs: ReadAsync,
闲着,
在: 0,
烟斗里: 0,
出水管: 0,
serverEndpoint: redis.default.svc.cluster.local:6379,
mc: 1/1/0,
经理:十分之十,
clientName:生产-9bbd94544-nlmv7,7,
(Busy=0,Free=1000,Min=5,Max=1000)
工人:(Busy=162,Free=32605,Min=256,Max=32767)
v: 2.2.4.27433`
有什么主意吗?
谢谢。
发布于 2022-07-09 17:10:13
您能检查一下redis服务是否正在运行吗?kubectl get service/redis。该服务似乎无法接收流量,如果没有接收到它的吊舱,这是可能的。
https://stackoverflow.com/questions/72894084
复制相似问题