04 2023 档案

dlv分析GO高CPU应用
摘要:delve是golang推荐的go语言调试工具。 构造100% CPU应用 package main import ( "time" ) func add() { i := 0 for { i++ } } func main() { go add() time.Sleep(time.Hour) } 阅读全文

posted @ 2023-04-19 16:53 王景迁 阅读(216) 评论(0) 推荐(0)

docker网络模式
摘要:Docker有4种网络模式(--network=) bridge默认模式,分配network namespace和IP,连接到docker0网桥上。 host使用主机IP,不分配network namespace和IP,和宿主机共用network namespace。 container和已存在的某 阅读全文

posted @ 2023-04-16 18:16 王景迁 阅读(38) 评论(0) 推荐(0)

flannel容器IP
摘要:docker没有分配IP cni0网桥相当于docker0网桥,veth对有一个会加在上面。 查看cni0网桥的端口 对应3个Pod 根据网络接口序号来查找veth另一端,veth对的两端mac地址不同 docker0上没有端口 阅读全文

posted @ 2023-04-16 17:50 王景迁 阅读(34) 评论(0) 推荐(0)

DaemonSet控制Pod拉起节点
摘要:k8s release-1.15 实验现象 创建ds apiVersion: apps/v1 kind: DaemonSet metadata: name: nginx spec: selector: matchLabels: app: nginx template: metadata: label 阅读全文

posted @ 2023-04-15 21:21 王景迁 阅读(37) 评论(0) 推荐(0)

stress模拟压力
摘要:安装 yum install -y epel-release yum install -y stress 耗尽1个CPU stress --cpu 1 --timeout 60 top 耗尽内存 stress --vm 1 --vm-bytes 2G --vm-keep free -h 耗尽磁盘IO 阅读全文

posted @ 2023-04-15 13:53 王景迁 阅读(48) 评论(0) 推荐(0)

搭建Etcd集群
摘要:docker pull quay.io/coreos/etcd:v3.3.1 docker run -d --name etcd1 quay.io/coreos/etcd:v3.3.1 etcd -name etcd1 -advertise-client-urls http://172.17.0.2 阅读全文

posted @ 2023-04-13 22:29 王景迁 阅读(50) 评论(0) 推荐(0)

构造MySQL错误server has gone away
摘要:interactive_timeout和wait_timeout默认值是28800秒即8小时。 手动修改interactive_timeout时间为3秒 set global interactive_timeout=3; 重新进入MySQL查看值 interactive_timeout和wait_t 阅读全文

posted @ 2023-04-09 08:07 王景迁 阅读(37) 评论(0) 推荐(0)

Nginx容器安装vim命令
摘要:docker pull nginx:1.22.1 docker run -itd nginx:1.22.1 进入nginx容器 apt-get update apt-get install -y vim 阅读全文

posted @ 2023-04-05 15:24 王景迁 阅读(247) 评论(0) 推荐(0)

导航