08 2021 档案
摘要:推荐文章: https://www.cnblogs.com/ycc-blog-2020/p/13855840.html 本用法:on dupdate key update 语句基本功能是:当表中没有原来记录时,就插入,有的话就更新。 1,on duplicate key update 语句根据主键i
阅读全文
摘要:git 仓库:https://github.com/hpcloud/tail.git package main import ( "fmt" "github.com/hpcloud/tail" "strings" ) type InfoData struct { InIntf string OutI
阅读全文
摘要:源码路径:https://github.com/kubernetes/client-go/blob/master/examples/leader-election/main.go /* Copyright 2018 The Kubernetes Authors. Licensed under the
阅读全文
摘要:原文链接:https://gobyexample.com/http-servers package main import ( "fmt" "net/http" ) func hello(w http.ResponseWriter, req *http.Request) { fmt.Fprintf(
阅读全文
摘要:top运行时按E切换,每次切换转换率为1000,切换的单位为 k,m,g,t,p
阅读全文
摘要:参考链接:https://github.com/kubernetes/sample-controller/blob/master/docs/controller-client-go.md
阅读全文
摘要:一:Informer 作用 Kubernetes设计了Informer这个机制,用来作为控制器跟apiserver交互的桥梁,它主要有两方面的作用: 1)依赖Etcd的List&Watch机制,在本地维护了一份所关心的API对象的缓存。Etcd的Watch机制能够使客户端及时获知这些对象的状态变化,
阅读全文
摘要:参考链接:https://www.cnblogs.com/-wenli/p/12304379.html Go语言中type的用法: 定义结构体类型 类型别名 定义接口类型 定义函数类型 1.定义结构体类型 结构体可用于用户自定义数据类型和进行面向对象编程。 type Person struct {
阅读全文
摘要:参考链接:https://studygolang.com/articles/13389 switch sExpr { case expr1: some instructions case expr2: some other instructions case expr3: some other in
阅读全文
摘要:参考链接:https://blog.csdn.net/u013218587/article/details/105539242/ { "debug": true, "max-concurrent-uploads": 50, "max-concurrent-downloads": 50 } 默认Doc
阅读全文
摘要:参考链接:http://dockone.io/article/10681 查看内存使用情况: $ gops memstats 3739 alloc: 1.15MB (1205272 bytes) total-alloc: 1.15MB (1205272 bytes) sys: 69.45MB (72
阅读全文
摘要:原文链接:http://blog.sina.com.cn/s/blog_53d7350f0100od58.html Limit match 这个匹配操作必须由-m limit明确指定才能使用。有了他的帮助,就能对指定的规则的日志数量加以限制,以免你被信息的洪流淹没哦。比如,你能事先设定一个限定值,当
阅读全文
摘要:现象: ipset 不支持 0.0.0.0/0 全段IP 解决: 可以使用 0.0.0.0/1 和 128.0.0.0/1 来包含全部IPv4 IP地址 补丁:http://git.netfilter.org/ipset/commit/?id=9b0be3d2545bfd0b482883bada1f
阅读全文
摘要:参考链接:https://blog.csdn.net/qq_30683329/article/details/88779390 例如说: taskset -cp 1-3 1927 这句命令就是表示将进程号为1927的进程绑定在核1,2,3上。 如何确认绑定成功 top -p 28019(进程ID)
阅读全文
摘要:参考链接:https://blog.csdn.net/anqixiang/article/details/114435934 curl https://127.0.0.1:6443/api/v1/nodes \ --cacert /etc/kubernetes/pki/ca.crt \ --cert
阅读全文