k8s节点rsyslogd内存占用高

服务器是k8s一个节点,经常警告内存占用高,实际top查看并没有看到占用高的进程。

使用命令查看:

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head

发现rsyslogd竟然占用了37.9…这不是坑么。

通过 systemctl status rsyslog 并没有发现别人家说的配置错误等问题

重启下rsyslogd服务解决,再观察下吧

systemctl restart rsyslog

IOS微信带zoom属性的网页,设置过字体后会变大

早期网页是按照1:1做的没问题。
新网页按照750设计图宽度制作,再按照zoom适配不同屏幕等比缩放。发现一旦使用的了微信的设置字体会导致zoom失效。div能缩放但文字不能缩放。网上的方法是
text-size-adjust:100% !important;
使用ios设备测试发现设置成100%依旧无法正常显示文字,改成auto可以解决。如:

body {
-webkit-text-size-adjust: auto !important;
text-size-adjust:auto !important;
-moz-text-size-adjust:auto !important;
}

spark 读取oss 提示找不到OSSClient类

spark,使用oss-emr 2.0.0的版本。idea本地调试正常,打包的时候打成一个大jar包,运行提示找不到OSSClient类。

开始怀疑是版本冲突,版本调整为最新版,或者改为最低版本都还是提示错误。

网上有两个题问也问了类似问题但没答案。最终改了打包方式解决了,原因还不知道为啥。把依赖包不打再一起的方式不提示错误了。

阿里云Kubernetes 托管版 起步的经验

服务器原来是部署在swram集群的,后来阿里云不再支持,开始往k8s上迁移。

1,降低成本:
参考了网上的帖子,那贴后来被删了,还好有备份。服务器少的话,可以删掉NAT。只要自己的服务器有公网ip或eip就行了。如果使用NAT每年成本得3-4000元。我们只有2台服务器,就把NAT去掉了。负载均衡也会给分配个公网的,不过这个服务标记了禁止删除,就还是别删了。

2,日志服务。ingress如果一开始没勾选的话,自己配还有点麻烦,并且网页版本的管理命令行不好用。跟客服沟通改用服务器自己的了。改用ingress代替之前的nginx入口服务器。ingress是托管服务的系统组件,日志格式最好就别改了。问题是之前会有个总nginx记录post信息用于调试。现在只能改在应用里记录post信息。

3,ingress里可以配置目录转发。不过阿里云网页编辑的验证不够严谨。如果配置错误会影响全局的ingress路由配置。新增配置会不生效。我是发现不生效后查ingress的日志,在报错,才发现有的配置错了。

hql组合条件查sum的方法

@Query("select sum(r.amount) from RechargeOrder r where 1=1  " +
            "AND (case when (:status is null) then true when(:status=r.status) then true else false end)=true " +
            "AND (case when (:walletType is null) then true when(:walletType=r.walletType) then true else false end)=true " +
            "AND (case when (:payType is null) then true when(:payType=r.payType) then true else false end)=true " +
            "AND (case when (:userId is null) then true when(:payType=r.userId) then true else false end)=true " +
            "AND (case when (:rechargeType is null) then true when(:rechargeType=r.rechargeType) then true else false end)=true " +
            "AND (case when (:successTimeBegin is null) then true when(:successTimeBegin<=r.successTime) then true else false end)=true " + "AND (case when (:successTimeEnd is null) then true when(:successTimeEnd>=r.successTime) then true else false end)=true " +

            "")
    Integer sumAmount(
            @Param("status")  Integer status
            ,@Param("walletType")  Integer walletType
            ,@Param("payType")  Integer payType
            ,@Param("userId")  Integer userId
            ,@Param("rechargeType")  Integer rechargeType
            ,@Param("successTimeBegin")  Date successTimeBegin
            ,@Param("successTimeEnd")  Date successTimeEnd
    );

win中cmd调用npm脚本的办法

打docker包,需要打node环境的镜像
先用bat命令行编译vue的代码
直接用npm install 无法按正常顺序执行,每个npm命令没有阻塞会并发运行
之后改用start /wait 可以顺序执行完但每次会弹出个新窗口,并且子窗口完成后需要手动关闭,并且在主装口选择是否继续
最后改用call 很好用,能正常在一个窗口中顺序执行