新安装的ZABBIX自带的zabbix-server突然挂了,配置都是官方默认的设置(只对接了数据库),尝试执行
systemctl restart zabbix-server.service
重启无效。查看日志:
cat /var/log/zabbix/zabbix_server.log
日志内容截图:
23504:20230113:095529.177 ================================
23504:20230113:095529.177 === Backtrace: ===
23504:20230113:095529.179 14: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_backtrace+0x3f) [0x55b5ae33f8b1]
23504:20230113:095529.179 13: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](__zbx_shmem_malloc+0x108) [0x55b5ae33a9ea]
23504:20230113:095529.179 12: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x202b72) [0x55b5ae2bcb72]
23504:20230113:095529.179 11: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x2d790f) [0x55b5ae39190f]
23504:20230113:095529.179 10: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_vector_ptr_append+0x1c) [0x55b5ae391aca]
23504:20230113:095529.179 9: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x20d96a) [0x55b5ae2c796a]
23504:20230113:095529.179 8: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](DCsync_configuration+0x12bc) [0x55b5ae2ca670]
23504:20230113:095529.179 7: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](dbconfig_thread+0x14f) [0x55b5ae14039b]
23504:20230113:095529.179 6: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_thread_start+0x37) [0x55b5ae340c8e]
23504:20230113:095529.179 5: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](+0x7437e) [0x55b5ae12e37e]
23504:20230113:095529.179 4: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](MAIN_ZABBIX_ENTRY+0x83e) [0x55b5ae12f689]
23504:20230113:095529.179 3: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](zbx_daemon_start+0x3b1) [0x55b5ae33f4c7]
23504:20230113:095529.179 2: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](main+0x36b) [0x55b5ae12dbf5]
23504:20230113:095529.179 1: /lib64/libc.so.6(__libc_start_main+0xe5) [0x7faada669d85]
23504:20230113:095529.179 0: /usr/sbin/zabbix_server: configuration syncer [syncing configuration](_start+0x2e) [0x55b5ae12c78e]
23504:20230113:095529.179 [file:dbconfig.c,line:97] __zbx_shmem_malloc(): out of memory (requested 256 bytes)
23504:20230113:095529.179 [file:dbconfig.c,line:97] __zbx_shmem_malloc(): please increase CacheSize configuration parameter
23501:20230113:095529.184 One child process died (PID:23504,exitcode/signal:1). Exiting …
23502:20230113:095529.185 HA manager has been paused
23502:20230113:095529.195 HA manager has been stopped
23501:20230113:095529.196 Zabbix Server stopped. Zabbix 6.2.6 (revision 6981d8b729a).
修改:
vi /etc/zabbix/zabbix_server.conf
去掉#,修改下面2个参数
CacheSize=8M 改 2048M
ValueCacheSize=8M 改 256M
重启服务
systemctl restart zabbix-server.service
问题解决。
另外找了个野生配置缓存的,根据自己硬件需求来
还有个参考:https://blog.csdn.net/zhanghengwei1995/article/details/103816429
[root@localhost zabbix]# vim /usr/local/zabbix/etc/zabbix_server.conf
StartPollers=500
StartPollersUnreachable=50
StartTrappers=30
StartDiscoverers=6
CacheSize=1G
CacheUpdateFrequency=300
StartDBSyncers=20
HistoryCacheSize=512M
TrendCacheSize=256M
HistoryTextCacheSize=80M
ValueCacheSize=1G