摘要: 1. 背景 同事接手了一个第三方项目,需要把数据库也迁移到本地。 2. 实战 # 备份 mysqldump -h127.0.0.1 -uroot -p'123' --flush-logs --single-transaction --all-databases > test.sql mysqldum 阅读全文
posted @ 2022-04-11 21:46 钱塘江畔 阅读(98) 评论(0) 推荐(0)
摘要: 1. 背景 线上待办功能一直不通,发现正式环境的待办系统域名无法访问,需要配置hosts。因为应用部署在云上,需使用k8s给pod添加域名IP映射。 2. 实战过程 使用yaml方式创建的pod,使用hostAliases添加域名IP映射,yaml内容如下: apiVersion: apps/v1 阅读全文
posted @ 2022-04-10 15:14 钱塘江畔 阅读(1463) 评论(0) 推荐(0)
摘要: 1. 背景 客户反应连接不到我方sftp服务器,排查下 2. 查看sftp连接日志 tail -f /var/log/sftp.log #日志中未抓到对方IP #尝试tcpdump抓包 tcpdump -n -nn 'ip[16] == 115 and ip[17] == 227 and ip[18 阅读全文
posted @ 2022-04-08 18:33 钱塘江畔 阅读(586) 评论(0) 推荐(0)
摘要: k8s进入pod kubectl exec -ti <your-pod-name> -n <your-namespace> -- /bin/sh 命令 # 1. 查看pod, 获取指定pod kubectl top pod # 2. 执行shell命令 kubectl exec pod_name - 阅读全文
posted @ 2022-03-31 14:44 钱塘江畔 阅读(573) 评论(0) 推荐(0)
摘要: #### 随机字符串 ``` SELECT SYS_GUID() FROM DUAL; ``` #### instr函数 [Oracle中的instr()函数 详解及应用](https://blog.csdn.net/Dream_ling/article/details/84956798) #### 阅读全文
posted @ 2022-03-07 14:12 钱塘江畔 阅读(67) 评论(0) 推荐(0)
摘要: 1. 背景 已有sftp服务,已有一用户用来put文件,现需要创建一个用户只能get不能put 2. 步骤 # 创建用户 useradd -g sftp -s /sbin/nologin zjt # 设置密码 passwd zjt # 修改用户登入目录 usermod -d /data01/sftp 阅读全文
posted @ 2022-02-28 15:10 钱塘江畔 阅读(159) 评论(0) 推荐(0)
摘要: Spring之jdbcTemplate:查询的三种方式(单个值、单个对象、对象集合) 阅读全文
posted @ 2022-02-27 21:00 钱塘江畔 阅读(41) 评论(0) 推荐(0)
摘要: // 当前时间及时间差 // java11 DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss").withZone(ZoneId.systemDefault()); Instant t1 = Insta 阅读全文
posted @ 2022-02-27 19:47 钱塘江畔 阅读(33) 评论(0) 推荐(0)
摘要: show variables like 'char%'; 发现character_set_server=latin 修改为utf8 vim /etc/my.cnf # 添加以下 character-set-server=utf8 # 重启mysql服务 systemctl stop mysqld.s 阅读全文
posted @ 2022-02-27 19:16 钱塘江畔 阅读(87) 评论(0) 推荐(0)
摘要: 1. 背景 在FlinkSQL任务提交时./bin/flink run -c com.stream.PhotoResult ./flinksqldemo-1.0-SNAPSHOT-jar-with-dependencies.jar,报错如下: Caused by: java.lang.ClassCa 阅读全文
posted @ 2022-02-27 18:00 钱塘江畔 阅读(622) 评论(0) 推荐(0)