分析器postgresql组件检查
1、kubectl get po -nsa | grep stolon得到pg_pod
2、执行kubectl get svc -nsa itoa-postgresql-inner -ojsOnpath="{.spec.clusterIP}"得到pg_svc_ip
3、执行kubectl exec -i -nsa ${pg_pod} -- timeout 30 psql -h ${pg_svc_ip} -p 5400 postgres -U postgres -c "select 1" 检查postgresql组件是否正常运行。
4、echo ${pg_passwd} | kubectl exec -nsa -i ${pg_pod} -- timeout 30 psql -h itoa-postgresql.sa -p 5432 postgres -U postgres -c "select count(1) from pg_stat_activity" 获取当前pg连接数,若sql语句有返回值,则表示正常;若sql查询语句无返回值,则表示pg pod异常
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作