Linux随记(十八)

一、k8s的node节点磁盘 /data已使用率超过 85% , 出现disk pressure ,驱逐pod现象

evicted , the node had condition:[DiskPressure]

shell 复制代码
#修改/var/lib/kubelet/config.yaml
]# cat /var/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
  anonymous:
    enabled: false
  webhook:
    cacheTTL: 0s
    enabled: true
  x509:
    clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
  mode: Webhook
  webhook:
    cacheAuthorizedTTL: 0s
    cacheUnauthorizedTTL: 0s
cgroupDriver: systemd
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
logging:
  flushFrequency: 0
  options:
    json:
      infoBufferSize: "0"
  verbosity: 0
memorySwap: {}
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
rotateCertificates: true
runtimeRequestTimeout: 0s
shutdownGracePeriod: 0s
shutdownGracePeriodCriticalPods: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s

#202506 添加:
evictionHard:
  imagefs.available: 1%
  memory.available: 100Mi
  nodefs.available: 1%
  nodefs.inodesFree: 1%



#重启该node节点的 kubelet
systemctl restart kubelet
systemctl status kubelet
shell 复制代码
#参考文章:
https://blog.csdn.net/qq_59634082/article/details/136868417   《k8s资源不足时驱赶pod阈值调整》
https://stackoverflow.com/questions/54155534/kubernetes-eviction-manager-evicting-control-plane-pods-to-reclaim-ephemeral-sto/60068671#60068671  
https://devpress.csdn.net/k8s/62ffc7fac67703293080625f.html  《Kubernetes 驱逐管理器驱逐控制平面 pod 以回收临时存储》

END

二、删除ES索引和其数据。

shell 复制代码
k8s上部署3个ES节点 , 版本elasticsearch:7.6.0 。 删除索引名称带202407的索引。

 kubectl exec -it  es-new-0 -n test bash
#查看索引名称
curl -s "http://192.168.1.100:9200/_cat/indices?h=index"  | grep -i "202407"
#删除索引 【三个ES节点的IP 都要执行】
curl -X DELETE "http://192.168.1.100:9200/api_xxx_202407*"
curl -X DELETE "http://192.168.1.101:9200/api_xxx_202407*"
curl -X DELETE "http://192.168.1.102:9200/api_xxx_202407*"


###查看占用容量 , 单位MB
curl "http://192.168.1.100:9200/_cat/allocation?v&bytes=gb"
curl "http://192.168.1.100:9200/_cat/indices/api_xxx_202407*?v&h=index,store.size,pri.store.size,status&bytes=mb&s=store.size:desc"
shell 复制代码
参考文章:
https://blog.csdn.net/weixin_44711737/article/details/125833601  《ES索引清理脚本-总结》 (清理脚本:ES有密码,索引按(周、日)时间命名的清理脚本)

END

相关推荐
belldeep1 小时前
WSL 安装 Debian 12 后,Linux 如何安装 curl , quickjs ?
linux·运维·debian·curl·quickjs
l1t1 小时前
Debian上安装PostgreSQL的故障和排除
运维·postgresql·debian
%#RulER#%3 小时前
哈工大计算机系统2024大作业——Hello的程序人生
linux·笔记·程序人生
y1x2y33 小时前
【HITCSAPP 哈工大计算机系统期末大作业】 程序人生-Hello’s P2P
linux·程序人生·ubuntu
God_archer3 小时前
程序人生-hello’s P2P
linux·c语言·汇编·程序人生
西域曼波王3 小时前
哈尔滨工业大学计算机系统大作业程序人生-Hello’s P2P
linux·c语言·编辑器·vim
无效的名字4 小时前
如何安装并使用RustDesk
linux·运维·服务器
唐可盐6 小时前
解决docker运行zentao 报错:ln: failed to create symbolic link ‘/opt/zbox/tmp/mysq
运维·docker·容器
Amo Xiang6 小时前
Python 解释器安装全攻略(适用于 Linux / Windows / macOS)
linux·windows·python·环境安装
明金同学6 小时前
电脑wifi显示已禁用怎么点都无法启用
运维·服务器·网络