上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页
摘要: go 反序列化 import ( "encoding/json" "io/ioutil" ) // 程序配置,用标签跟文件中的json的key对应起来 type Config struct { Port int `json:"port"` ReadTimeout int `json:"readTim 阅读全文
posted @ 2022-03-25 00:10 taotaozh 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 一、MongoDB常见命令 -- tab按键可提示补全 > show databases; > use my_db > db.help > db.createCollection("my_collection") > show collections; > db.my_collection.help 阅读全文
posted @ 2022-03-20 22:53 taotaozh 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 二、Golang代码操作etcd 2.1、etcd安装 # 官网: https://github.com/etcd-io/etcd/tree/main/client/v3 https://pkg.go.dev/github.com/coreos/etcd/clientv3#pkg-index # 安 阅读全文
posted @ 2022-03-19 15:22 taotaozh 阅读(1472) 评论(0) 推荐(0) 编辑
摘要: 调度单个cron 这写代码的老师都喜欢用var 声明变量后使用 下次调度时间: nextTime = expr.Next(now) 超时时间计算:nextTime.Sub(now) 超时后执行回调函数:time.AfterFunc // 【github.com/gorhill/cronexpr】 这 阅读全文
posted @ 2022-03-19 15:09 taotaozh 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 传统方案--crontab 缺点 配置任务时,需要SSh登录脚本服务器进行操作 服务器宕机,任务将终止调度,需要人工迁移 排查问题低效,无法方便的查看任务状态与错误输出 分布式任务调度 优点 可视化Web后台,方便进行任务管理 分布式架构、集群化调度,不存在单点故障 追踪任务执行状态,采集任务输出, 阅读全文
posted @ 2022-03-19 15:07 taotaozh 阅读(3549) 评论(0) 推荐(0) 编辑
摘要: 调度单个cron 这写代码的老师都喜欢用var 声明变量后使用 下次调度时间: nextTime = expr.Next(now) 超时时间计算:nextTime.Sub(now) 超时后执行回调函数:time.AfterFunc // 【github.com/gorhill/cronexpr】 这 阅读全文
posted @ 2022-03-15 00:57 taotaozh 阅读(1154) 评论(0) 推荐(0) 编辑
摘要: 误删kube-proxy的cm如何解决呢? 如果误删了其他的cm 应该也是类似这样了 # 由于手误,本来想重启kube-proxy结果误删了cm [如果是二进制安装就不有这种结果了,通过system管理指定配置文件位置] # 解决:找到挂载在容器的cm【config.conf】, 此时不重启Pod, 阅读全文
posted @ 2022-03-12 23:56 taotaozh 阅读(237) 评论(0) 推荐(0) 编辑
摘要: CoreDns 时的默认配置 apiVersion: v1 data: Corefile: | .:53 { errors # 启用错误记录 health # 启用检查检查端点,8080:health ready kubernetes cluster.local in-addr.arpa ip6.a 阅读全文
posted @ 2022-02-24 00:26 taotaozh 阅读(633) 评论(0) 推荐(0) 编辑
摘要: 环境描述 生产环境通过gitlab-running实现自动化发布业务,现需要收集客户端的真实ip,需要将externaltrafficpolicy改为lacal模式(原来是cluster模式),前天开发反映无法发布业务(镜像拉取不成功)。想到就改动过externaltrafficpolicy所以考虑 阅读全文
posted @ 2022-02-24 00:14 taotaozh 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Centos7服务器内存使用过高排查 查看内存使用情况 [root@VM-16-17-centos ~]# free -h total used free shared buff/cache available Mem: 3.7G 3.1G 152M 772K 413M 338M Swap: 0B 阅读全文
posted @ 2022-02-19 22:54 taotaozh 阅读(4900) 评论(0) 推荐(2) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页