eip-work / kuboard-press

Kuboard 是基于 Kubernetes 的微服务管理界面。同时提供 Kubernetes 免费中文教程,入门教程,最新版本的 Kubernetes v1.23.4 安装手册,(k8s install) 在线答疑,持续更新。
https://kuboard.cn/
21.78k stars 1.49k forks source link

kuboard-etcd 磁盘占用达到2G导致etcd无法访问 #386

Closed Fluxay-666 closed 1 year ago

Fluxay-666 commented 1 year ago

du -h -d 0 /usr/share/kuboard/etcd/ 2.5G /usr/share/kuboard/etcd/ 我想手动压缩etcd数据发现etcd没有办法正常访问 image

Fluxay-666 commented 1 year ago

已解决,kuboard-etcd默认端口是2381,端口用错了 ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" --write-out=table endpoint status

etcdctl --endpoints="http://127.0.0.1:2381" snapshot save /data/backup.db

ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" compact $(ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*')

ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" defrag

ETCDCTL_API=3 etcdctl --endpoints=http://127.0.0.1:2381 alarm disarm

xianhuadezhuren commented 2 months ago

已解决,kuboard-etcd默认端口是2381,端口用错了 ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" --write-out=table endpoint status

etcdctl --endpoints="http://127.0.0.1:2381" snapshot save /data/backup.db

ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" compact $(ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" endpoint status --write-out="json" | egrep -o '"revision":[0-9]*' | egrep -o '[0-9].*')

ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" defrag

ETCDCTL_API=3 etcdctl --endpoints=http://127.0.0.1:2381 alarm disarm

直接登录不了,大佬怎么解决的啊

xianhuadezhuren commented 2 months ago

[root@k8s-master ~]# ETCDCTL_API=3 etcdctl --endpoints="http://127.0.0.1:2381" --write-out=table endpoint status {"level":"warn","ts":"2024-05-10T17:13:47.952+0800","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"passthrough:///http://127.0.0.1:2381","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: connection closed"} Failed to get the status of endpoint http://127.0.0.1:2381 (context deadline exceeded) +----------+----+---------+---------+-----------+------------+-----------+------------+--------------------+--------+ | ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS | +----------+----+---------+---------+-----------+------------+-----------+------------+--------------------+--------+ +----------+----+---------+---------+-----------+------------+-----------+------------+--------------------+--------+

Fluxay-666 commented 1 month ago

@xianhuadezhuren 看看yaml文件里的端口对吗

image
Fluxay-666 commented 1 month ago

du -h -d 0 /usr/share/kuboard/etcd/ 2.5G /usr/share/kuboard/etcd/ 我想手动压缩etcd数据发现etcd没有办法正常访问 图像

使用命令压缩历史之前需注意etcdserver监听地址 image

nangongchengfeng commented 1 month ago

{"level":"info","ts":"2024-06-19T07:08:05.047Z","caller":"embed/etcd.go:245","msg":"now serving peer/client/metrics","local-member-id":"18793330f04e826a","initial-advertise-peer-urls":["http://192.168.102.30:2382"],"listen-peer-urls":["http://192.168.102.30:2382"],"advertise-client-urls":["http://192.168.102.30:2381"],"listen-client-urls":["http://192.168.102.30:2381"],"listen-metrics-urls":[]}

image

我使用 2381 和 2382 都不行。主要是现在etcd起不来,怎么才能连接内部清理数据?

image

Fluxay-666 commented 1 month ago

{“level”:“info”,“ts”:“2024-06-19T07:08:05.047Z”,“caller”:“embed/etcd.go:245”,“msg”:“现在服务peer/client/metrics”,“local-member-id”:“18793330f04e826a”,“initial-advertise-peer-urls”:[“http://192.168.102.30:2382”],“listen-peer-urls”:[“http://192.168.102.30:2382”],“advertise-client-urls”:[“http://192.168.102.30:2381”],“listen-client-urls”:[“http://192.168.102.30:2381”],“listen-metrics-urls”:[]}

图像

我使用 2381 和 2382 都不行。主要是现在etcd起不来,怎么才能连接内部清理数据?

图像

我看你监听的事192的IP,用这个试试。 是在k8s集群吗

nangongchengfeng commented 1 month ago

哎,不行,感觉还是etcd有问题导致。没起来,所以连不上。

ETCDCTL_API=3 ./etcdctl --endpoints="http://192.168.102.30:2381" --write-out=table endpoint status image 成功访问一次,后续访问失败,这是运气吗(狗头保命) image

Fluxay-666 commented 1 month ago

哎,不行,感觉还是etcd有问题导致。没起来,所以连不上。

ETCDCTL_API=3 ./etcdctl --endpoints="http://192.168.102.30:2381" --write-out=table endpoint status image 成功访问一次,后续访问失败,这是运气吗(狗头保命) image

是在k8s集群里吗?他会有健康检测,我把健康检测注释之后就可以了

nangongchengfeng commented 1 month ago

哎,不行,感觉还是etcd有问题导致。没起来,所以连不上。 ETCDCTL_API=3 ./etcdctl --endpoints="http://192.168.102.30:2381" --write-out=table endpoint status image 成功访问一次,后续访问失败,这是运气吗(狗头保命) imageETCDCTL_API=3 ./etcdctl --endpoints=“http://192.168.102.30:2381” --write-out=table endpoint status 成功访问一次,后续访问失败,这是运气吗(狗头保命)

是在k8s集群里吗?他会有健康检测,我把健康检测注释之后就可以了

我注销了健康检测,现在pod不会重启。然后执行就可以了,大佬牛逼 image

xianhuadezhuren commented 1 month ago

@xianhuadezhuren 看看yaml文件里的端口对吗 image

嗯嗯 可以了 感谢大佬