Gin - 参数默认值问题

遇到问题:gin 使用 Bind 时无法填充,改成下面代码可以获取到 go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 type User struct { Name string `form:"name,default=user1" json:"name,default=user2"` Age int `form:"age,default=10" json:"age,default=20"` } r := gin.Default() // way1 curl 127.0.0.1:8900/bind?name=aa // way2 curl -X POST 127.0.0.1:8900/bind -d "name=aa&age=30" // way3 curl -X POST 127.0.0.1:8900/bind -H "Content-Type: application/json" -d "{\"name\": \"aa\"}" r....

 ·  · 

Ceph OSD内存优化与建议

本文记录了在使用 ceph 集群时遭遇到的内存问题,以及引用和参考一些资料用于对在 ceph 集群使用时的内存预估。 OSD的内存需求 如何评估 Ceph OSD 所需的硬件也是对于集群选型,集群优化的一个必要条件,这里主要找到两个可靠的参考资料用于评估 OSD 内存配置大小 IBM Storage Ceph IBM Storage Ceph 提供了一个运行 Ceph 用于预估系统配置的一个最小推荐列表 [1],个人感觉可以参考这些信息用于自己集群的优化。主要用于容器化的 Ceph 集群 Process Criteria Minimum Recommended ceph-osd-container Processor 1x AMD64 or Intel 64 CPU CORE per OSD container RAM Minimum of 5 GB of RAM per OSD container OS Disk 1x OS disk per host OSD Storage 1x storage drive per OSD container. Cannot be shared with OS Disk....

 ·  · 

记录一次失败的radosgw问题排查记录

记录一次因着急没有检查原因而直接下线 ceph 对象存储的的失败记录 操作流程 ceph 节点内存持续超过90%,因为本身有三个 OSD,检查内存使用情况发现 radosgw bash 1 2 3 4 5 6 7 8 9 10 11 $ ps aux --sort=-%mem | head -10 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ceph 1702 0.4 32.9 10128296 4550760 ? Ssl May03 919:18 /usr/bin/radosgw -f --cluster ceph --name client.rgw.node01 --setuser ceph --setgroup ceph ceph 1721 0.6 12.8 3318456 2088704 ? Ssl May03 1216:59 /usr/bin/ceph-osd -f --cluster ceph --id 6 --setuser ceph --setgroup ceph ceph 1983 0....

 ·  · 

GKE强制升级后JAVA Pod无法识别limit限制

今日 GKE EOL,kubelet 自动升级至1.28后,Java程序在启动后无法识别资源清单中的限制,被大量OOMKill Deployment清单中已经配置了资源限制,例如下面的参数 yaml 1 2 3 4 5 resources: limits: memory: "1Gi" requests: memory: "600Mi" JAVA_OPS参数配置是使用百分比 bash 1 -XX:+UseContainerSupport -XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 但是启动后无法识别参数,使用 gcloud 登录到主机内查看 jvm 运行状态(因为容器使用 distroless) bash 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 project-20220325-asia-east-2-pool-221ab289-hgnf ~ # nsenter -t 274655 --mount --uts --ipc --net --pid /opt/java/openjdk/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+PrintContainerInfo -version OSContainer::init: Initializing Container Support Detected cgroups v2 unified hierarchy Path to /cpu....

 ·  · 

Uranus installation

What is an Uranus? Uranus is a Linux firewalld central controller. In Greek mythology, Uranus king of gods. The firewall gateway is the Uranus for iptables. Prerequisites Hardware requirements We recommend these hardware requirements for production systems or for development systems that are designed to demonstrate production use cases: Item Description Minimum requirements Recommended Per instance You can install on one node but many features require at least one node. 1 instance > 1 instances RAM per instance Defining your RAM size must be part of the capacity planning for your Uranus usage....

 ·  ·