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

相关推荐
淮北49412 分钟前
ubuntu22 默认输入法调整频率
运维·服务器·git·ubuntu·elasticsearch
土星云SaturnCloud13 分钟前
大坝结构安全智能诊断:土星云边缘计算全周期管控实践
服务器·人工智能·安全·ai·边缘计算
Percep_gan14 分钟前
切割服务器日志
运维·服务器
农村小镇哥35 分钟前
C#读取CSV文件的方法
服务器·数据库·c#
骇客野人39 分钟前
阿里云运维手册(通用生产版|云上运维标准化文档)
运维·阿里云·云计算
雾时之林1 小时前
Linux---计算机网络常见面试题
linux·运维·计算机网络
维核科技1 小时前
多卡集群频繁裂卡、通信报错?NVLink故障排查与运维优化方案
运维·服务器维修·gpu维修·算力卡维修·gpu故障·算力卡故障·服务器故障
10mAh1 小时前
【Linux】error while loading shared libraries 怎么解决?——ldd、RPATH 与动态链接排错
java·linux·前端
playboy1341 小时前
监控硬盘循环覆盖,监控数据恢复哪些情况还能找回录像
服务器·门控循环单元·智能硬件
Promise微笑1 小时前
红外热像仪选型:3~5μm中波与8~14μm长波探测机理解析
运维