上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页
摘要: MySQL生产故障记录 一个环境的MySQL发生故障,故障现象就一直无法启动,日志也没明显错误 Thread pointer: 0x7f3994000b60 Attempting backtrace. You can use the following information to find out 阅读全文
posted @ 2022-04-30 21:55 taotaozh 阅读(638) 评论(0) 推荐(0)
摘要: GO 文件读取常用的方法 方式1: 一行一行的方式读取 其中常用的方法就有:ReadString,ReadLine,ReadBytes ReadLine 返回单个行,不包括行尾字节,就是说,返回的内容不包括\n或者\r\n,返回的类型为[]byte ReadString('\n') 以分隔字符方式读 阅读全文
posted @ 2022-04-10 00:11 taotaozh 阅读(959) 评论(0) 推荐(1)
摘要: GO 发起HTTPS请求调用接口 GO 发起HTTPS请求调用接口 一、GET请求调用HTTPS接口 tls.LoadX509KeyPair()方法读取证书路径,转换为证书对象; x509.NewCertPool()方法创建证书池; pool.AppendCertsFromPEM(caCrt)方法将 阅读全文
posted @ 2022-04-07 00:02 taotaozh 阅读(3201) 评论(0) 推荐(0)
摘要: GO 发起HTTP请求调用接口 一、Go发起GET请求 1.1、不带参数的GET请求 func HttpGet(url string) error { // 请求xx网站首页 resp, err := http.Get(url) if err != nil { return err } // 延迟关 阅读全文
posted @ 2022-04-05 23:41 taotaozh 阅读(2445) 评论(0) 推荐(0)
摘要: 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 阅读(77) 评论(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 阅读(295) 评论(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 阅读(1841) 评论(0) 推荐(0)
摘要: 调度单个cron 下次调度时间: nextTime = expr.Next(now) 超时时间计算:nextTime.Sub(now) 超时后执行回调函数:time.AfterFunc // 【github.com/gorhill/cronexpr】 这个包功能对应Linux的定时任务;但是这个包支 阅读全文
posted @ 2022-03-19 15:09 taotaozh 阅读(588) 评论(0) 推荐(0)
摘要: 传统方案--crontab 缺点 配置任务时,需要SSh登录脚本服务器进行操作 服务器宕机,任务将终止调度,需要人工迁移 排查问题低效,无法方便的查看任务状态与错误输出 分布式任务调度 优点 可视化Web后台,方便进行任务管理 分布式架构、集群化调度,不存在单点故障 追踪任务执行状态,采集任务输出, 阅读全文
posted @ 2022-03-19 15:07 taotaozh 阅读(3764) 评论(0) 推荐(0)
摘要: 调度单个cron 这写代码的老师都喜欢用var 声明变量后使用 下次调度时间: nextTime = expr.Next(now) 超时时间计算:nextTime.Sub(now) 超时后执行回调函数:time.AfterFunc // 【github.com/gorhill/cronexpr】 这 阅读全文
posted @ 2022-03-15 00:57 taotaozh 阅读(1276) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页