SundayLe

历久尝新

Linux 批量改名

批量修改SSL证书前后缀,并拷贝至新建目录 修改前 to 修改后1_api.sundayle.com_bundle.crt to api.sundayle.com.pem2_api.sundayle.com.key to api.sundayle.com.key 1234567891011121314find ./*/Nginx/*./api.sundayle.com/Nginx/1_api......

Python 时间格式 time, strftime和strptime

最常用的time.time()返回的是一个浮点数,单位为秒。但strftime处理的类型是time.struct_time,实际上是一个tuple。strptime和localtime都会返回这个类型。 123456789101112131415>>> import time>>> t=time.time()>>> t1574129715......

使用Elastic Filebeat 收集 Kubernetes日志

(4/5) Collect logs with Elastic Filebeat for monitoring Kubernetes

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677cat << "EOF" > filebeat-configmap.yml---api......

BIND DNS 使用RPZ 做局部代理

想要达到的效果:内部dns处理部分dns,其他由外部dns处理。 如www.sundayle.com api.sundayle.com static.sundayle.com 均在dnspod上解析了。现在只想处理static.sundayle.com这个域名IP为内网IP,其他依旧由dnspod处理。 方案1. 单机的话直接在/etc/hosts绑定就可以了。 方案2. 多机的话就不......

Bind DNS服务器配置

环境信息Master DNS: 192.168.1.91Slave DNS: 192.168.1.43Slave DNS: 192.168.1.44LVS MASTER: 192.168.1.46LVS BACKUP: 192.168.1.921yum install -y bind bind-chroot bind-utils 1234567891011121314151617181920......

Elastic Stack 安装 ElasticSearch和Kibana 存储和可视化监控数据

(2/5) Install ElasticSearch and Kibana to store and visualize monitoring data

elasticsearch master123456789101112131415161718192021222324252627cat << "EOF" > elasticsearch-master-configmap.yaml---apiVersion: v1kind: ConfigMapmetadata: namespace: monitoring name: e......

Elastic Stack 监控 Kubernetes

(1/5) Getting started with Elastic Stack for monitoring on Kubernetes

介绍123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354cat <<EOF >mongo.yml---apiVersion: v1kind: Servicemetadata: namespace: default name: ......

查看swap占用程序情况

1for i in $(ls /proc | grep "^[0-9]" | awk '$0>100'); do awk '/Swap:/{a=a+$2}END{print '"$i"',a/1024"M"}' /proc/$i/smaps 2>/dev/null;done| sort -k2nr | head...

Kubernetes Local Volume 使用

有时,由于服务器数量有限,您可能不愿意使用GlusterFS和CephFS来设置动态存储配置。 在这种情况下,除了必须首先创建自己的PV外,几乎可以采用与动态卷配置相同的方式来使用本地卷。与主机路径卷不同,使用本地卷的Pod将自动计划在定义了本地卷的节点上运行。 让我们测试一下。 创建 Local Volume和Storage Class 的PVLocal VolumeStorage Cla......

kubectl 一些命令

12kubectl get po --all-namespaces --field-selector 'status.phase==Failed'kubectl delete po --field-selector 'status.phase==Failed'...