上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 43 下一页

2024年4月8日

go结构体重写String方法从而自定义打印内容

摘要: package main import "fmt" type student struct { name string age int } func (s student) String() string { return fmt.Sprintf("{name is %s, age is %d}", 阅读全文

posted @ 2024-04-08 22:22 王景迁 阅读(61) 评论(0) 推荐(0) 编辑

2024年4月6日

kube-ovn分配vni

摘要: ovn-org/ovn branch-23.06 kube-ovn里面ovn-central的ovn-northd会给logical switch和logical router分配vni,集群内全局唯一,即每个lr和ls都有自己的vni。 northd/northd.covn_datapath_al 阅读全文

posted @ 2024-04-06 11:26 王景迁 阅读(13) 评论(0) 推荐(0) 编辑

2024年4月4日

k8s informer resync机制

摘要: informerFactory创建informer informer一般由informerFactory创建(支持直接创建informer,一般不这么做),informerFactory支持创建多种资源类型的informer,同一个informerFactory中同一种资源类型只创建一个inform 阅读全文

posted @ 2024-04-04 16:31 王景迁 阅读(44) 评论(0) 推荐(0) 编辑

Linux 平均负载

摘要: $ uptime07:44:43 up 1:20, 1 user, load average: 0.47, 0.56, 0.56 07:44:43表示当前时间。up 1:20表示系统运行时间。1 users表示正在登录用户数。0.47, 0.56, 0.56表示过去 1 分钟、5 分钟、15 分钟的 阅读全文

posted @ 2024-04-04 15:46 王景迁 阅读(6) 评论(0) 推荐(0) 编辑

通过ssh隧道实现full nat

摘要: ssh隧道类似于vxlan隧道,ssh隧道是基于ssh协议来实现的。 node1操作 777端口是节点ssh的新增端口如果22端口正常,那么不需要新增777端口。 vim /etc/ssh/sshd_config # SELinux开放给ssh使用的端口增加777 semanage port -a 阅读全文

posted @ 2024-04-04 15:21 王景迁 阅读(12) 评论(0) 推荐(0) 编辑

k8s PV和PVC以及StorageClass

摘要: 本地盘和云磁盘区别 本地盘不支持跨物理机迁移,云磁盘支持跨物理机迁移。 本地目录生命周期 emptyDir、downwardAPI、configMap、secret:kubelet创建本地目录,该目录会随着Pod的消亡而删除。hostPath:本地目录一直存在。 PVC、PV和StorageClas 阅读全文

posted @ 2024-04-04 15:14 王景迁 阅读(124) 评论(0) 推荐(0) 编辑

MySQL问题 left join查询错误

摘要: 使用left join时,左表字段值必须有,右表字段值可以没有。where加右表字段,匹配非空值时,右表字段不能是NULL,必须有具体值。 阅读全文

posted @ 2024-04-04 14:18 王景迁 阅读(12) 评论(0) 推荐(0) 编辑

MySQL问题 远程连接数被占满

摘要: 设置MySQL单用户远程最大连接数是3 set GLOBAL max_user_connections=3; 查看连接数限制 show variables like '%connections'; 其中,max_connections控制远程连接数和本地连接数总和上限。 尝试继续创建远程连接失败 情 阅读全文

posted @ 2024-04-04 14:14 王景迁 阅读(79) 评论(0) 推荐(0) 编辑

MySQL问题 GROUP_CONCAT截断

摘要: 问题现象 CREATE DATABASE test CHARACTER SET utf8; USE test; CREATE TABLE user ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name varchar(500), sex tinyint 阅读全文

posted @ 2024-04-04 14:06 王景迁 阅读(28) 评论(0) 推荐(0) 编辑

MySQL问题 SQL优先级导致执行错误

摘要: 问题现象 select * from x where a = 1 or b = 2 and c = 3执行结果不符合预期。 问题分析 and优先级高于or,相当于select * from x where a = 1 or (b = 2 and c = 3)。 解决问题 改成select * fro 阅读全文

posted @ 2024-04-04 14:01 王景迁 阅读(2) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 43 下一页

导航