一、说明

系统版本:Rocky Linux release 8.6 (Green Obsidian)

zabbix版本:zabbix 6.2.0

mysql版本:mysql  Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)

二、故障说明

1.在zabbix主界面,“zabbix服务器端运行中”的值显示为“否”(忘记截图了,下图只是说明位置)

zabbix6.2一直重启问题解决_zabbix

2.去后台重启zabbix服务,报错

zabbix6.2一直重启问题解决_zabbix_02

3、查看zabbix报错

9652:20220726:030159.787 using configuration file: /etc/zabbix/zabbix_server.conf
9652:20220726:030159.801 current database version (mandatory/optional): 06020000/06020000
9652:20220726:030159.801 required mandatory version: 06020000
9653:20220726:030159.810 starting HA manager
9653:20220726:030159.814 HA manager started in active mode
9652:20220726:030159.815 server #0 started [main process]
9654:20220726:030159.816 server #1 started [service manager #1]
9655:20220726:030159.816 server #2 started [configuration syncer #1]
9655:20220726:030200.288 __mem_malloc: skipped 7 asked 366104 skip_min 360 skip_max 10032
9655:20220726:030200.288 [file:dbconfig.c,line:97] __zbx_shmem_realloc(): out of memory (requested 366104 bytes)
9655:20220726:030200.288 [file:dbconfig.c,line:97] __zbx_shmem_realloc(): please increase CacheSize configuration parameter
9655:20220726:030200.288 === memory statistics for configuration cache ===
9655:20220726:030200.288 free chunks of size 24 bytes: 16
9655:20220726:030200.288 free chunks of size 40 bytes: 1
9655:20220726:030200.288 free chunks of size >= 256 bytes: 7
9655:20220726:030200.288 min chunk size: 24 bytes
9655:20220726:030200.288 max chunk size: 10032 bytes
9655:20220726:030200.288 memory of total size 29049328 bytes fragmented into 281546 chunks
9655:20220726:030200.288 of those, 21824 bytes are in 24 free chunks
9655:20220726:030200.288 of those, 29027504 bytes are in 281522 used chunks
9655:20220726:030200.288 of those, 4504720 bytes are used by allocation overhead
9655:20220726:030200.288 ================================
9655:20220726:030200.288 === Backtrace: ===
9655:20220726:030200.289 16: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_backtrace+0x3f) [0x557eb9e4ea27]
9655:20220726:030200.289 15: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](__zbx_shmem_realloc+0x160) [0x557eb9e49d57]
9655:20220726:030200.289 14: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x1e85b3) [0x557eb9dcc5b3]
9655:20220726:030200.289 13: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_hashset_reserve+0xc1) [0x557eb9e51ba2]
9655:20220726:030200.289 12: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_hashset_insert_ext+0xec) [0x557eb9e51e17]
9655:20220726:030200.289 11: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_hashset_insert+0x2d) [0x557eb9e51d29]
9655:20220726:030200.289 10: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](DCfind_id+0x86) [0x557eb9dcce75]
9655:20220726:030200.289 9: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x1f32ae) [0x557eb9dd72ae]
9655:20220726:030200.289 8: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](DCsync_configuration+0x1293) [0x557eb9dda02b]
9655:20220726:030200.289 7: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](dbconfig_thread+0x14f) [0x557eb9c63a80]
9655:20220726:030200.289 6: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_thread_start+0x37) [0x557eb9e5b4f8]
9655:20220726:030200.289 5: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x6db82) [0x557eb9c51b82]
9655:20220726:030200.289 4: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](MAIN_ZABBIX_ENTRY+0x83e) [0x557eb9c52d9e]
9655:20220726:030200.289 3: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_daemon_start+0x3b1) [0x557eb9e4e63d]
9655:20220726:030200.289 2: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](main+0x36b) [0x557eb9c5129e]
9655:20220726:030200.289 1: /lib64/libc.so.6(__libc_start_main+0xf3) [0x7f774182bcf3]
9655:20220726:030200.289 0: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](_start+0x2e) [0x557eb9c4fe0e]
9652:20220726:030200.292 One child process died (PID:9655,exitcode/signal:1). Exiting ...
9653:20220726:030200.293 HA manager has been paused
9653:20220726:030200.300 HA manager has been stopped
9652:20220726:030200.302 Zabbix Server stopped. Zabbix 6.2.0 (revision db780895726).
9662:20220726:030210.524 Starting Zabbix Server. Zabbix 6.2.0 (revision db780895726).
9662:20220726:030210.524 ****** Enabled features ******
9662:20220726:030210.524 SNMP monitoring: YES
9662:20220726:030210.524 IPMI monitoring: YES
9662:20220726:030210.524 Web monitoring: YES
9662:20220726:030210.524 VMware monitoring: YES
9662:20220726:030210.524 SMTP authentication: YES
9662:20220726:030210.524 ODBC: YES
9662:20220726:030210.524 SSH support: YES
9662:20220726:030210.524 IPv6 support: YES
9662:20220726:030210.524 TLS support: YES
9662:20220726:030210.524 ******************************

三、问题解决

1.根据报错中的如下条目,确认为CacheSize参数配置有问题导致

9655:20220726:030200.288 [file:dbconfig.c,line:97] __zbx_shmem_realloc(): please increase CacheSize configuration parameter

2.将zabbix服务端配置文件的如下参数做了调整:

[root@localhost ~]# cat /etc/zabbix/zabbix_server.conf|grep -E "^CacheSize"
CacheSize=1024M
[root@localhost ~]# cat /etc/zabbix/zabbix_server.conf|grep -E "^StartHTTPPollers"
StartHTTPPollers=64
[root@localhost ~]# cat /etc/zabbix/zabbix_server.conf|grep -E "^StartPingers"
StartPingers=128
[root@localhost ~]#systemctl restart zabbix-server.service #修改完成后,重启zabbix服务

3.将mysql的最大连接数调整为1000

[root@localhost ~]#echo "max_cnotallow=1000" >> /etc/my.cnf
[root@localhost ~]#systemctl restart mysqld.service
[root@localhost ~]#systemctl restart zabbix-server.service

四、思考

可能是因为我添加了47台交换价,默认的参数太小,所以导致报错