成长值: 336 签到天数: 4737 天
[LV.Master]伴坛终老
发表于 2021/7/15 19:26
|
显示全部楼层
| 阅读模式
| Google Chrome 91.0.4472.124
| Windows 10
cdnbest管理系统节点每隔一段时间就重启kangle进程是什么情况,log日志看到如下,原来是自动更新升级
cat /var/log/cdnbest.log | grep reboot 复制代码
通过日志可以看到每隔5个小时整跳出一次
Wed Jul 7 07:44:47|register server [reboot]
Thu Jul 8 12:45:11|register server [reboot]
Fri Jul 9 17:45:41|register server [reboot]
Sat Jul 10 22:46:12|register server [reboot]
Mon Jul 12 03:46:42|register server [reboot]
Tue Jul 13 08:47:12|register server [reboot]
Wed Jul 14 13:47:41|register server [reboot]
Thu Jul 15 18:48:11|register server [reboot]
看了下完整日志,原来是cdnbest节点会自动更新升级kangle程序,和主控无关
Thu Jul 15 18:46:41|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=dump_flow&extend=4
Thu Jul 15 18:46:41| try[0]use unix socket success
Thu Jul 15 18:46:41|WLWLWL job op=[20] seq=[0] sync=[0] body []
Thu Jul 15 18:47:11| handling package,msg= &{20}
Thu Jul 15 18:47:11|slave trying to log
Thu Jul 15 18:47:11|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=dump_flow&extend=4
Thu Jul 15 18:47:11| try[0]use unix socket success
Thu Jul 15 18:47:11|WLSLWLWL job op=[20] seq=[0] sync=[0] body []
Thu Jul 15 18:47:41| handling package,msg= &{20}
Thu Jul 15 18:47:41|slave trying to log
Thu Jul 15 18:47:41|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=dump_flow&extend=4
Thu Jul 15 18:47:41| try[0]use unix socket success
Thu Jul 15 18:47:41| start time sleep auto update
Thu Jul 15 18:47:42|autoupdate now...
Thu Jul 15 18:47:42|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=info&
Thu Jul 15 18:47:42| try[0]use unix socket success
Thu Jul 15 18:47:42| autoupdate end,os exit...
Thu Jul 15 18:47:42|WLWLWL job op=[20] seq=[0] sync=[0] body []
Thu Jul 15 18:48:11| handling package,msg= &{20}
Thu Jul 15 18:48:11|slave trying to log
Thu Jul 15 18:48:11|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=dump_flow&extend=4
Thu Jul 15 18:48:11| try[0]use unix socket success
Thu Jul 15 18:48:11|exit_code=[99]cbslave version=[4.6.4] go version [go1.13.10]
Thu Jul 15 18:48:11|time is [202107151848],os is [linux]
Thu Jul 15 18:48:11|update vhs.db start...
Thu Jul 15 18:48:11|the lock num is 18
Thu Jul 15 18:48:11|the update num is 18
Thu Jul 15 18:48:11| the seq is[18],the update_seq is [18]
Thu Jul 15 18:48:11|uid file not isset
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT -m set --match-set blacklist src -j DROP] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT -m set --match-set whitelist src -j ACCEPT] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/usr/sbin/ipset create blacklist hash:ip timeout 3600] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/usr/sbin/ipset create whitelist hash:ip timeout 3600] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -N kangle] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT ! -s 127.0.0.1 -j kangle] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT -j kangle] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT ! -s 127.0.0.1 -j kangle] error[exit status 1]
Thu Jul 15 18:48:11|run init cmd[/sbin/iptables -D INPUT -j kangle] error[exit status 1]
Thu Jul 15 18:48:11|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=reload_vh&
Thu Jul 15 18:48:11| try[0]use unix socket success
Thu Jul 15 18:48:11|kangle reload vh=[],success
Thu Jul 15 18:48:11|register server [hello]
Thu Jul 15 18:48:11|register server [init]
Thu Jul 15 18:48:11|register server [edit_kangle]
Thu Jul 15 18:48:11|register server [reboot]
Thu Jul 15 18:48:11|register server [get_info]
Thu Jul 15 18:48:11|register server [get_connection]
Thu Jul 15 18:48:11|register server [cache_prefetch]
Thu Jul 15 18:48:11|register server [cache_info]
Thu Jul 15 18:48:11|register server [dump_load]
Thu Jul 15 18:48:11|register server [del_node]
Thu Jul 15 18:48:11|register server [autoupdate]
Thu Jul 15 18:48:11|register server [reset]
Thu Jul 15 18:48:11|register server [querykangle]
Thu Jul 15 18:48:11|register server [queryrouter]
Thu Jul 15 18:48:11|register server [queryserver]
Thu Jul 15 18:48:11|register server [check_ssl]
Thu Jul 15 18:48:11|register server [queryall]
Thu Jul 15 18:48:11|register server [clearcache]
Thu Jul 15 18:48:11|register server [querydomain]
Thu Jul 15 18:48:11|register server [vhostcleancache]
Thu Jul 15 18:48:11|register server [clearallcache]
Thu Jul 15 18:48:11|register server [add_monitor_advanced]
Thu Jul 15 18:48:11|register server [get_vhost_info]
Thu Jul 15 18:48:11|register server [get_vhost_config_info]
Thu Jul 15 18:48:11|register server [flushengine]
Thu Jul 15 18:48:11|register server [clear_url_cache]
Thu Jul 15 18:48:11|register server [add_preload_url_task]
Thu Jul 15 18:48:11|register server [get_preload_url_task]
Thu Jul 15 18:48:11|register server [del_preload_url_task]
Thu Jul 15 18:48:11|register server [cancel_preload_url_task]
Thu Jul 15 18:48:11|register server [query_all_module]
Thu Jul 15 18:48:11|register server [update_node_name]
Thu Jul 15 18:48:11|connect kangle url http://127.0.0.1:3311/core.whm?whm_call=info&
Thu Jul 15 18:48:11| try[0]use unix socket success
Thu Jul 15 18:48:11|kangle version=[3.5.21.16]
Thu Jul 15 18:48:11|engine start..
Thu Jul 15 18:48:12| load config....
Thu Jul 15 18:48:12|load router count [0]
Thu Jul 15 18:48:12|build vhost info to json file
Thu Jul 15 18:48:12| uid=[10086],sid=[23710],sync_seq=[1358]...
Thu Jul 15 18:48:12|wayland goroutine start..
Thu Jul 15 18:48:12|WL start time sleep auto update
Thu Jul 15 18:48:12|try connect to master......................
Thu Jul 15 18:48:12| get licnese info...
Thu Jul 15 18:48:12| get license info laddr=[] index=[0] 复制代码
看了下只有节点空闲的情况下,无访问情况时,cdnbest才会执行这个操作,虽然对用户访问没影响,使用的是无感知平滑重启,访客访问不会受到中断。
但是会丢失内存缓存数据,比如说节点缓存了100G内存数据,重启后就丢失了需要重新进行内存缓存导致命中率变低。
看了下没被升级的节点跳出错误如下
Sat Jul 24 05:48:11|WLWLSL autoupdate download failed,err[exit status 1] autoupdate autoupdate2.conf is not found 复制代码
那么就好解决了,用这条命令关闭节点自动更新
mv /vhs/kangle/bin/autoupdate /vhs/kangle/bin/autoupdate.bak 复制代码
成功关闭自动升级后效果,此时kangle进程不会被重启
Sun Jul 25 10:51:11|autoupdate now...
Sun Jul 25 10:51:11| autoupdate download failed,err[fork/exec /vhs/kangle/bin/autoupdate: no such file or directory] autoupdate autoupdate2.conf is not found 复制代码