examples
examples copied to clipboard
Error to setup sentinnel and replicate data between nodes
Hello,
Pods are setup on my GCP cluster but sentinel returns an error and replication between nodes is not ok.
If I try to determine which server the Redis sentinel believes is the master, I get the following : $ kubectl exec redis-2 -c redis -- redis-cli -p 26379 sentinel get-master-addr-by-name redis Could not connect to Redis at 127.0.0.1:26379: Connection refused
If I check sentinel logs $ kubectl logs statefulsets/redis sentinel Waiting for server ping: bad address 'redis-0.redis'
And if I set foo 10 on redis-0 I don't get key on redis-2
Why I get bad address ? What can I do ? Thank you
Ok almost done, just remove .redis of the hostname, using just redis-0 it works fine on redis-0 pod but redis-0 is not seen since redis-1 and redis-2
Error from redis on redis-1 and redis-2 5:S 23 Oct 05:26:02.099 * Connecting to MASTER redis-0:6379 5:S 23 Oct 05:26:02.110 # Unable to connect to MASTER: Resource temporarily unavailable
Or from sentinel on redis-1 and redis-2 ping: bad address 'redis-0' Waiting for server
How to make them communicate ?
One of the error may be you forgot to set "spec.clusterIP: None" in the service file.
One of the error may be you forgot to set "spec.clusterIP: None" in the service file.
Did you mean redis-sentinel service file from examples?
apiVersion: v1
kind: Service
metadata:
labels:
name: sentinel
role: service
name: redis-sentinel
spec:
ports:
- port: 26379
targetPort: 26379
selector:
redis-sentinel: "true"
I use sentinel in nginx lua to connect to master for set data. If it will have not the ip, it becomes impossible