摘要: 数据迁移流程上线双写 -> 历史数据同步到新表 -> 切读到新表 -> 旧表停写 1.上线新表,起始自增id与线上最大id比较,预留id增长空间,比最大id大一些 2.上线/下线双写双写先写新表上线过程中: 旧表新增数据->产生的是历史数据 新表新增数据->旧表同步,会造成旧表起始自增id增大,此后 阅读全文
posted @ 2020-11-19 18:28 imgax 阅读(207) 评论(0) 推荐(0)
摘要: import xlrdexcel = xlrd.open_workbook(filename="/xxx/Downloads/xx.xlsx") table = excel.sheets()[0]row_count = table.nrowsfor row_n in range(0, row_cou 阅读全文
posted @ 2020-09-24 09:55 imgax 阅读(161) 评论(0) 推荐(0)
摘要: split -C 200m xxx.log xxx.log_ 阅读全文
posted @ 2020-09-23 11:41 imgax 阅读(94) 评论(0) 推荐(0)
摘要: 压缩 tar -czvf xxx.tar.gz file1 file2 解压 tar -xzvf xxx.tar.gz 阅读全文
posted @ 2020-08-14 09:21 imgax 阅读(115) 评论(0) 推荐(0)
摘要: 查询所有序列 select * from pg_class where relkind='S' 阅读全文
posted @ 2020-05-28 13:43 imgax 阅读(148) 评论(0) 推荐(0)
摘要: 缓存穿透是指缓存和数据库中都没有的数据,而用户不断发起请求,如发起为id为“-1”的数据或id为特别大不存在的数据。这时的用户很可能是攻击者,攻击会导致数据库压力过大。 缓存击穿是指缓存中没有但数据库中有的数据(一般是缓存时间到期),这时由于并发用户特别多,同时读缓存没读到数据,又同时去数据库去取数 阅读全文
posted @ 2020-05-18 11:17 imgax 阅读(151) 评论(0) 推荐(0)
摘要: rocketmq支持多个集群关键问题在于连接到不同的rocketmq实例 DefaultMQProducer producer实例化会调用以下方法: org.apache.rocketmq.client.producer.DefaultMQProducer.start org.apache.rock 阅读全文
posted @ 2020-05-15 11:32 imgax 阅读(557) 评论(0) 推荐(0)
摘要: 项目中要用到rocketmq,想要封装一个方便使用的client,网上搜索到官方的一个项目: https://github.com/apache/rocketmq-spring 简单写了demo测试了下,感觉用起来接近rabbitmq,决定在实际项目里测试下。 disconf配置如下: rocket 阅读全文
posted @ 2020-05-15 11:29 imgax 阅读(225) 评论(0) 推荐(0)
摘要: openssl生成rsa私钥公钥生成私钥:OpenSSL> genrsa -out test_private.pem 1024生成公钥:OpenSSL> rsa -in test_private.pem -pubout -out test_public.pem pkcs1转pkcs8java中不能直 阅读全文
posted @ 2020-05-14 18:42 imgax 阅读(249) 评论(0) 推荐(0)
摘要: 1. corePoolSize 线程池的基本大小,队列满了线程数才会超过这个数量 2.maximumPoolS 线程池允许的最大线程数,线程池当前线程不会超过最大线程数 3.poolSize,线程池当前线程数 问题优化 线上一个多线程接口超时较多,观察线程数未超过corePoolSize,适当提高超 阅读全文
posted @ 2020-05-14 18:16 imgax 阅读(553) 评论(0) 推荐(0)