问题描述
启动 Zabbix Server 产生如下错误:
17731:20200427:154606.042 Starting Zabbix Server. Zabbix 4.4.3 (revision 6cad6f888e). 17731:20200427:154606.043 ****** Enabled features ****** 17731:20200427:154606.043 SNMP monitoring: YES 17731:20200427:154606.043 IPMI monitoring: YES 17731:20200427:154606.043 Web monitoring: YES 17731:20200427:154606.043 VMware monitoring: YES 17731:20200427:154606.043 SMTP authentication: YES 17731:20200427:154606.043 ODBC: YES 17731:20200427:154606.043 SSH2 support: YES 17731:20200427:154606.043 IPv6 support: YES 17731:20200427:154606.043 TLS support: YES 17731:20200427:154606.043 ****************************** 17731:20200427:154606.043 using configuration file: /etc/zabbix/zabbix_server.conf 17731:20200427:154606.051 current database version (mandatory/optional): 04040000/04040000 17731:20200427:154606.051 required mandatory version: 04040000 17731:20200427:154606.648 __mem_malloc: skipped 0 asked 24 skip_min 18446744073709551615 skip_max 0 17731:20200427:154606.648 [file:dbconfig.c,line:94] __zbx_mem_realloc(): out of memory (requested 24 bytes) 17731:20200427:154606.648 [file:dbconfig.c,line:94] __zbx_mem_realloc(): please increase CacheSize configuration parameter 17731:20200427:154606.648 === memory statistics for configuration cache === 17731:20200427:154606.648 min chunk size: 18446744073709551615 bytes 17731:20200427:154606.648 max chunk size: 0 bytes 17731:20200427:154606.648 memory of total size 8388232 bytes fragmented into 71434 chunks 17731:20200427:154606.649 of those, 0 bytes are in 0 free chunks 17731:20200427:154606.649 of those, 7245304 bytes are in 71434 used chunks 17731:20200427:154606.649 ================================ 17731:20200427:154606.649 === Backtrace: === 17731:20200427:154606.650 9: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x564952ed73e0] 17731:20200427:154606.650 8: /usr/sbin/zabbix_server(__zbx_mem_realloc+0x169) [0x564952ed2aa8] 17731:20200427:154606.650 7: /usr/sbin/zabbix_server(+0x16bebc) [0x564952e9bebc] 17731:20200427:154606.650 6: /usr/sbin/zabbix_server(+0x177191) [0x564952ea7191] 17731:20200427:154606.650 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1367) [0x564952ea86fb] 17731:20200427:154606.650 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x71a) [0x564952d718c1] 17731:20200427:154606.650 3: /usr/sbin/zabbix_server(daemon_start+0x305) [0x564952ed6c0d] 17731:20200427:154606.650 2: /usr/sbin/zabbix_server(main+0x312) [0x564952d711a5] 17731:20200427:154606.650 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7ff15b548c05] 17731:20200427:154606.650 0: /usr/sbin/zabbix_server(+0x40239) [0x564952d70239]
问题原因
参数 CacheSize 指定配置缓存(configuration cache)大小,共享内存大小用于存储 host、item、trigger 数据。
当该 配置缓存 空间不足时,将产生该错误。
解决办法
调整 zabbix_server.conf 的 CacheSize 参数,至于调整至多少,可以在 Monitoring -> Graphs -> Zabbix server -> Zabbix Cache usage 查看该缓存使用情况。
在 Zabbix 4.4.3 中,Zabbix Cache usage 还有其他缓存相关参数,也可以在 zabbix_server.conf 中配置。
参考文献
WikiNotes/please increase CacheSize configuration parameter
Zabbix Documentation 4.4/CacheSize
please increase CacheSize configuration parameter