内容纲要
概要描述
本文描述一个故障场景,tdc断电重启后redis启动报错,状态为 Init:CrashLoopBackOff 查看相应的pod日志报错Could not connect to Redis at redis-redis-ha:26379: Temporary failure in name resolution
Initializing config..
cp: cannot create regular file ‘/data/conf/redis.conf’: Permission denied
的解决方案
详细描述
问题描述
redis-redis-ha-server 启动失败,状态为Init:CrashLoopBackOff
查看相应的日志
kubectl -n kube-system logs redis-redis-ha-server-0 config-init
日志报错内容如下:
Could not connect to Redis at redis-redis-ha:26379: Temporary failure in name resolution
Initializing config..
cp: cannot create regular file '/data/conf/redis.conf': Permission denied
排查思路
查看sts的yaml文件中的权限配置是否正确
kubectl get sts -n kube-system redis-redis-ha-server -oyaml
调度节点的/opt/kubernetes/data/redis-ha 路径下的文件权限
调整这个路径下的权限为777
然后delete redis pod