Kubernetes Service,Redis Sentinel,没有返回Redis Master IP&端口一致,所有pod都在docker容器中。 我使用了https://github.com/kubernetes/kubernetes/tree/master/examples/redis& https://github.com/helm/helm - redis群集
当我连接到Kubernetes服务(10.3.251.152,26379 / TCP)时,它应该确定Redis Sentinel主服务器(ip:'10 .0.0.68',端口:'6379'),然后与它建立连接。但有时,Kubernetes服务返回(ip:'10 .0.0.68',端口:'6379')和其他一些时间,它返回Kubernetes服务(10.3.251.152,26379 / TCP)作为哨兵主IP。我们可以在program Log中看到与sentinel master
连接在两者(kubernetes sentinel示例,helm.sh的redis集群)中都会出现这种不一致的情况。
您可以在此处查看服务和广告连播详情。
useRedisSentinel true
redisSentinelHost 10.3.251.152 redisSentinelPort 26379
Queueing psubscribe for next server connection.
sentinelClient { domain: null,
_events:
{ 'sentinel disconnected': [Function],
'failover start': [Function],
'switch master': [Function] },
_maxListeners: undefined,
options:
{ master_debug: true,
port: '26379',
host: '10.3.251.152',
and so on ..
}
}
有关主/从/哨兵详情的更多详情
masters [ { name: 'mymaster',
ip: '10.0.0.68',
port: '6379',
runid: '33798857c71ebf2c85c7095291d453cb143cea7e',
flags: 'master',
'pending-commands': '0',
'last-ok-ping-reply': '0',
'last-ping-reply': '518',
'info-refresh': '518',
'num-slaves': '60000',
'num-other-sentinels': '9021',
quorum: 'master' } ]
mymaster slaves [ { name: '10.0.0.70:6379',
ip: '10.0.0.70',
port: '6379',
runid: 'ce2330d9071e091e8d808017d761cbdae1d286b9',
flags: 'slave',
'pending-commands': '0',
'last-ok-ping-reply': '0',
'last-ping-reply': '518',
'info-refresh': '518',
'master-link-down-time': '60000',
'master-link-status': '9021',
'master-host': 'slave',
'master-port': '33297880',
'slave-priority': '0' },
{ name: '10.0.0.69:6379',
ip: '10.0.0.69',
port: '6379',
runid: 'a1e063c71a4ef93a8c5769aa29cb1d8dbf669579',
flags: 'slave',
'pending-commands': '0',
'last-ok-ping-reply': '0',
'last-ping-reply': '518',
'info-refresh': '518',
'master-link-down-time': '60000',
'master-link-status': '9021',
'master-host': 'slave',
'master-port': '33297888',
'slave-priority': '0' } ]
mymaster sentinels [ { name: '10.0.0.71:26379',
ip: '10.0.0.71',
port: '26379',
runid: '6f787783753fa446c6ecb118d07339d51f1fda14',
flags: 'sentinel',
'pending-commands': '0',
'last-ok-ping-reply': '0',
'last-ping-reply': '518',
'last-hello-message': '518',
'can-failover-its-master': '60000' },
{ name: '10.0.0.68:26379',
ip: '10.0.0.68',
port: '26379',
runid: '7542fbbb0c36c4d171c10b492f67a416d794fc96',
flags: 'sentinel',
'pending-commands': '0',
'last-ok-ping-reply': '0',
'last-ping-reply': '518',
'last-hello-message': '518',
'can-failover-its-master': '60000' } ]
mymaster getMasterAddress { ip: '10.0.0.68', port: '6379' }
如何进行故障排除?