Meleuo

Zabbix突然宕机 无法启动 报错”zbx_mem_malloc(): out of memory”解决方法
今天一位朋友的zabbix server突然宕机,无法启动,帮他查看日志后发现是提示的是分配给缓存的内存不够,报...
扫描右侧二维码阅读全文
01
2019/07

Zabbix突然宕机 无法启动 报错”zbx_mem_malloc(): out of memory”解决方法

报错关键字

7334:20190701:095155.922 [file:dbconfig.c,line:94] __zbx_mem_malloc(): out of memory (requested 256 bytes)
7334:20190701:095155.922 [file:dbconfig.c,line:94] __zbx_mem_malloc(): please increase CacheSize configuration parameter

详细错误日志

 [root@localhost zabbix]# tail -200 zabbix_server.log
  7312:20190701:095111.416 11: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x55c08b0b1a16]
  7312:20190701:095111.416 10: /usr/sbin/zabbix_server(__zbx_mem_malloc+0x18c) [0x55c08b0ad06b]
  7312:20190701:095111.416 9: /usr/sbin/zabbix_server(+0x15dff1) [0x55c08b076ff1]
  7312:20190701:095111.416 8: /usr/sbin/zabbix_server(+0x1a3fd9) [0x55c08b0bcfd9]
  7312:20190701:095111.416 7: /usr/sbin/zabbix_server(zbx_vector_ptr_append+0x1c) [0x55c08b0bd16e]
  7312:20190701:095111.416 6: /usr/sbin/zabbix_server(+0x166106) [0x55c08b07f106]
  7312:20190701:095111.416 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1006) [0x55c08b0832fb]
  7312:20190701:095111.416 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x746) [0x55c08af5898a]
  7312:20190701:095111.416 3: /usr/sbin/zabbix_server(daemon_start+0x2f6) [0x55c08b0b125a]
  7312:20190701:095111.416 2: /usr/sbin/zabbix_server(main+0x312) [0x55c08af58242]
  7312:20190701:095111.416 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7faa1e1253d5]
  7312:20190701:095111.416 0: /usr/sbin/zabbix_server(+0x3e309) [0x55c08af57309]
  7317:20190701:095121.516 Starting Zabbix Server. Zabbix 4.2.1 (revision 92832).
  7317:20190701:095121.516 ****** Enabled features ******
  7317:20190701:095121.516 SNMP monitoring:           YES
  7317:20190701:095121.517 IPMI monitoring:           YES
  7317:20190701:095121.517 Web monitoring:            YES
  7317:20190701:095121.517 VMware monitoring:         YES
  7317:20190701:095121.517 SMTP authentication:       YES
  7317:20190701:095121.517 Jabber notifications:       NO
  7317:20190701:095121.517 Ez Texting notifications:  YES
  7317:20190701:095121.517 ODBC:                      YES
  7317:20190701:095121.517 SSH2 support:              YES
  7317:20190701:095121.517 IPv6 support:              YES
  7317:20190701:095121.517 TLS support:               YES
  7317:20190701:095121.517 ******************************
  7317:20190701:095121.517 using configuration file: /etc/zabbix/zabbix_server.conf
  7317:20190701:095121.525 current database version (mandatory/optional): 04020000/04020000
  7317:20190701:095121.526 required mandatory version: 04020000
  7317:20190701:095122.411 __mem_malloc: skipped 0 asked 256 skip_min 18446744073709551615 skip_max 0
  7317:20190701:095122.412 [file:dbconfig.c,line:94] __zbx_mem_malloc(): out of memory (requested 256 bytes)
  7317:20190701:095122.412 [file:dbconfig.c,line:94] __zbx_mem_malloc(): please increase CacheSize configuration parameter
  7317:20190701:095122.412 === memory statistics for configuration cache ===
  7317:20190701:095122.412 free chunks of size     24 bytes:       37
  7317:20190701:095122.412 free chunks of size     32 bytes:        1
  7317:20190701:095122.412 free chunks of size     40 bytes:        3
  7317:20190701:095122.412 free chunks of size     48 bytes:        1
  7317:20190701:095122.412 free chunks of size     56 bytes:        3
  7317:20190701:095122.412 free chunks of size     72 bytes:        2
  7317:20190701:095122.412 free chunks of size    184 bytes:        1
  7317:20190701:095122.412 min chunk size:         24 bytes
  7317:20190701:095122.412 max chunk size:        184 bytes
  7317:20190701:095122.412 memory of total size 8388232 bytes fragmented into 69743 chunks
  7317:20190701:095122.412 of those,       1584 bytes are in       48 free chunks
  7317:20190701:095122.412 of those,    7270776 bytes are in    69695 used chunks
  7317:20190701:095122.412 ================================
  7317:20190701:095122.412 === Backtrace: ===
  7317:20190701:095122.413 11: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x563856f35a16]
  7317:20190701:095122.413 10: /usr/sbin/zabbix_server(__zbx_mem_malloc+0x18c) [0x563856f3106b]
  7317:20190701:095122.413 9: /usr/sbin/zabbix_server(+0x15dff1) [0x563856efaff1]
  7317:20190701:095122.413 8: /usr/sbin/zabbix_server(+0x1a3fd9) [0x563856f40fd9]
  7317:20190701:095122.413 7: /usr/sbin/zabbix_server(zbx_vector_ptr_append+0x1c) [0x563856f4116e]
  7317:20190701:095122.413 6: /usr/sbin/zabbix_server(+0x166106) [0x563856f03106]
  7317:20190701:095122.413 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1006) [0x563856f072fb]
  7317:20190701:095122.413 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x746) [0x563856ddc98a]
  7317:20190701:095122.413 3: /usr/sbin/zabbix_server(daemon_start+0x2f6) [0x563856f3525a]
  7317:20190701:095122.413 2: /usr/sbin/zabbix_server(main+0x312) [0x563856ddc242]
  7317:20190701:095122.413 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fdc341603d5]
  7317:20190701:095122.413 0: /usr/sbin/zabbix_server(+0x3e309) [0x563856ddb309]
  7324:20190701:095132.516 Starting Zabbix Server. Zabbix 4.2.1 (revision 92832).
  7324:20190701:095132.516 ****** Enabled features ******
  7324:20190701:095132.517 SNMP monitoring:           YES
  7324:20190701:095132.517 IPMI monitoring:           YES
  7324:20190701:095132.517 Web monitoring:            YES
  7324:20190701:095132.517 VMware monitoring:         YES
  7324:20190701:095132.517 SMTP authentication:       YES
  7324:20190701:095132.517 Jabber notifications:       NO
  7324:20190701:095132.517 Ez Texting notifications:  YES
  7324:20190701:095132.517 ODBC:                      YES
  7324:20190701:095132.517 SSH2 support:              YES
  7324:20190701:095132.517 IPv6 support:              YES
  7324:20190701:095132.517 TLS support:               YES
  7324:20190701:095132.517 ******************************
  7324:20190701:095132.517 using configuration file: /etc/zabbix/zabbix_server.conf
  7324:20190701:095132.526 current database version (mandatory/optional): 04020000/04020000
  7324:20190701:095132.526 required mandatory version: 04020000
  7324:20190701:095133.416 __mem_malloc: skipped 0 asked 256 skip_min 18446744073709551615 skip_max 0
  7324:20190701:095133.416 [file:dbconfig.c,line:94] __zbx_mem_malloc(): out of memory (requested 256 bytes)
  7324:20190701:095133.416 [file:dbconfig.c,line:94] __zbx_mem_malloc(): please increase CacheSize configuration parameter
  7324:20190701:095133.416 === memory statistics for configuration cache ===
  7324:20190701:095133.416 free chunks of size     24 bytes:       37
  7324:20190701:095133.416 free chunks of size     32 bytes:        1
  7324:20190701:095133.416 free chunks of size     40 bytes:        3
  7324:20190701:095133.416 free chunks of size     48 bytes:        1
  7324:20190701:095133.416 free chunks of size     56 bytes:        3
  7324:20190701:095133.416 free chunks of size     72 bytes:        2
  7324:20190701:095133.416 free chunks of size    184 bytes:        1
  7324:20190701:095133.416 min chunk size:         24 bytes
  7324:20190701:095133.416 max chunk size:        184 bytes
  7324:20190701:095133.416 memory of total size 8388232 bytes fragmented into 69743 chunks
  7324:20190701:095133.416 of those,       1584 bytes are in       48 free chunks
  7324:20190701:095133.416 of those,    7270776 bytes are in    69695 used chunks
  7324:20190701:095133.416 ================================
  7324:20190701:095133.417 === Backtrace: ===
  7324:20190701:095133.417 11: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x5630a184ea16]
  7324:20190701:095133.417 10: /usr/sbin/zabbix_server(__zbx_mem_malloc+0x18c) [0x5630a184a06b]
  7324:20190701:095133.417 9: /usr/sbin/zabbix_server(+0x15dff1) [0x5630a1813ff1]
  7324:20190701:095133.417 8: /usr/sbin/zabbix_server(+0x1a3fd9) [0x5630a1859fd9]
  7324:20190701:095133.417 7: /usr/sbin/zabbix_server(zbx_vector_ptr_append+0x1c) [0x5630a185a16e]
  7324:20190701:095133.417 6: /usr/sbin/zabbix_server(+0x166106) [0x5630a181c106]
  7324:20190701:095133.417 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1006) [0x5630a18202fb]
  7324:20190701:095133.417 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x746) [0x5630a16f598a]
  7324:20190701:095133.417 3: /usr/sbin/zabbix_server(daemon_start+0x2f6) [0x5630a184e25a]
  7324:20190701:095133.417 2: /usr/sbin/zabbix_server(main+0x312) [0x5630a16f5242]
  7324:20190701:095133.417 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fc8404503d5]
  7324:20190701:095133.417 0: /usr/sbin/zabbix_server(+0x3e309) [0x5630a16f4309]
  7329:20190701:095143.516 Starting Zabbix Server. Zabbix 4.2.1 (revision 92832).
  7329:20190701:095143.516 ****** Enabled features ******
  7329:20190701:095143.516 SNMP monitoring:           YES
  7329:20190701:095143.516 IPMI monitoring:           YES
  7329:20190701:095143.516 Web monitoring:            YES
  7329:20190701:095143.516 VMware monitoring:         YES
  7329:20190701:095143.516 SMTP authentication:       YES
  7329:20190701:095143.516 Jabber notifications:       NO
  7329:20190701:095143.516 Ez Texting notifications:  YES
  7329:20190701:095143.516 ODBC:                      YES
  7329:20190701:095143.516 SSH2 support:              YES
  7329:20190701:095143.516 IPv6 support:              YES
  7329:20190701:095143.517 TLS support:               YES
  7329:20190701:095143.517 ******************************
  7329:20190701:095143.517 using configuration file: /etc/zabbix/zabbix_server.conf
  7329:20190701:095143.526 current database version (mandatory/optional): 04020000/04020000
  7329:20190701:095143.526 required mandatory version: 04020000
  7329:20190701:095144.668 __mem_malloc: skipped 0 asked 256 skip_min 18446744073709551615 skip_max 0
  7329:20190701:095144.668 [file:dbconfig.c,line:94] __zbx_mem_malloc(): out of memory (requested 256 bytes)
  7329:20190701:095144.668 [file:dbconfig.c,line:94] __zbx_mem_malloc(): please increase CacheSize configuration parameter
  7329:20190701:095144.668 === memory statistics for configuration cache ===
  7329:20190701:095144.668 free chunks of size     24 bytes:       37
  7329:20190701:095144.668 free chunks of size     32 bytes:        1
  7329:20190701:095144.669 free chunks of size     40 bytes:        3
  7329:20190701:095144.669 free chunks of size     48 bytes:        1
  7329:20190701:095144.669 free chunks of size     56 bytes:        3
  7329:20190701:095144.669 free chunks of size     72 bytes:        2
  7329:20190701:095144.669 free chunks of size    184 bytes:        1
  7329:20190701:095144.669 min chunk size:         24 bytes
  7329:20190701:095144.669 max chunk size:        184 bytes
  7329:20190701:095144.669 memory of total size 8388232 bytes fragmented into 69743 chunks
  7329:20190701:095144.669 of those,       1584 bytes are in       48 free chunks
  7329:20190701:095144.669 of those,    7270776 bytes are in    69695 used chunks
  7329:20190701:095144.669 ================================
  7329:20190701:095144.669 === Backtrace: ===
  7329:20190701:095144.670 11: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x55611a2a0a16]
  7329:20190701:095144.670 10: /usr/sbin/zabbix_server(__zbx_mem_malloc+0x18c) [0x55611a29c06b]
  7329:20190701:095144.670 9: /usr/sbin/zabbix_server(+0x15dff1) [0x55611a265ff1]
  7329:20190701:095144.670 8: /usr/sbin/zabbix_server(+0x1a3fd9) [0x55611a2abfd9]
  7329:20190701:095144.670 7: /usr/sbin/zabbix_server(zbx_vector_ptr_append+0x1c) [0x55611a2ac16e]
  7329:20190701:095144.670 6: /usr/sbin/zabbix_server(+0x166106) [0x55611a26e106]
  7329:20190701:095144.670 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1006) [0x55611a2722fb]
  7329:20190701:095144.670 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x746) [0x55611a14798a]
  7329:20190701:095144.670 3: /usr/sbin/zabbix_server(daemon_start+0x2f6) [0x55611a2a025a]
  7329:20190701:095144.670 2: /usr/sbin/zabbix_server(main+0x312) [0x55611a147242]
  7329:20190701:095144.671 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f8d6a9fe3d5]
  7329:20190701:095144.671 0: /usr/sbin/zabbix_server(+0x3e309) [0x55611a146309]
  7334:20190701:095154.766 Starting Zabbix Server. Zabbix 4.2.1 (revision 92832).
  7334:20190701:095154.766 ****** Enabled features ******
  7334:20190701:095154.766 SNMP monitoring:           YES
  7334:20190701:095154.767 IPMI monitoring:           YES
  7334:20190701:095154.767 Web monitoring:            YES
  7334:20190701:095154.767 VMware monitoring:         YES
  7334:20190701:095154.767 SMTP authentication:       YES
  7334:20190701:095154.767 Jabber notifications:       NO
  7334:20190701:095154.767 Ez Texting notifications:  YES
  7334:20190701:095154.767 ODBC:                      YES
  7334:20190701:095154.767 SSH2 support:              YES
  7334:20190701:095154.767 IPv6 support:              YES
  7334:20190701:095154.767 TLS support:               YES
  7334:20190701:095154.767 ******************************
  7334:20190701:095154.767 using configuration file: /etc/zabbix/zabbix_server.conf
  7334:20190701:095154.776 current database version (mandatory/optional): 04020000/04020000
  7334:20190701:095154.776 required mandatory version: 04020000
  7334:20190701:095155.922 __mem_malloc: skipped 0 asked 256 skip_min 18446744073709551615 skip_max 0
  7334:20190701:095155.922 [file:dbconfig.c,line:94] __zbx_mem_malloc(): out of memory (requested 256 bytes)
  7334:20190701:095155.922 [file:dbconfig.c,line:94] __zbx_mem_malloc(): please increase CacheSize configuration parameter
  7334:20190701:095155.922 === memory statistics for configuration cache ===
  7334:20190701:095155.922 free chunks of size     24 bytes:       37
  7334:20190701:095155.922 free chunks of size     32 bytes:        1
  7334:20190701:095155.922 free chunks of size     40 bytes:        3
  7334:20190701:095155.922 free chunks of size     48 bytes:        1
  7334:20190701:095155.922 free chunks of size     56 bytes:        3
  7334:20190701:095155.922 free chunks of size     72 bytes:        2
  7334:20190701:095155.922 free chunks of size    184 bytes:        1
  7334:20190701:095155.922 min chunk size:         24 bytes
  7334:20190701:095155.922 max chunk size:        184 bytes
  7334:20190701:095155.923 memory of total size 8388232 bytes fragmented into 69743 chunks
  7334:20190701:095155.923 of those,       1584 bytes are in       48 free chunks
  7334:20190701:095155.923 of those,    7270776 bytes are in    69695 used chunks
  7334:20190701:095155.923 ================================
  7334:20190701:095155.923 === Backtrace: ===
  7334:20190701:095155.924 11: /usr/sbin/zabbix_server(zbx_backtrace+0x42) [0x564ce8a5fa16]
  7334:20190701:095155.924 10: /usr/sbin/zabbix_server(__zbx_mem_malloc+0x18c) [0x564ce8a5b06b]
  7334:20190701:095155.924 9: /usr/sbin/zabbix_server(+0x15dff1) [0x564ce8a24ff1]
  7334:20190701:095155.924 8: /usr/sbin/zabbix_server(+0x1a3fd9) [0x564ce8a6afd9]
  7334:20190701:095155.924 7: /usr/sbin/zabbix_server(zbx_vector_ptr_append+0x1c) [0x564ce8a6b16e]
  7334:20190701:095155.924 6: /usr/sbin/zabbix_server(+0x166106) [0x564ce8a2d106]
  7334:20190701:095155.924 5: /usr/sbin/zabbix_server(DCsync_configuration+0x1006) [0x564ce8a312fb]
  7334:20190701:095155.924 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x746) [0x564ce890698a]
  7334:20190701:095155.924 3: /usr/sbin/zabbix_server(daemon_start+0x2f6) [0x564ce8a5f25a]
  7334:20190701:095155.924 2: /usr/sbin/zabbix_server(main+0x312) [0x564ce8906242]
  7334:20190701:095155.924 1: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f1b1a1533d5]
  7334:20190701:095155.924 0: /usr/sbin/zabbix_server(+0x3e309) [0x564ce8905309]

解决方法,修改zabbix_server.conf配置文件定义的CacheSize,配置文件中的CacheSize默认是被注释掉的。去掉注释按服务器配置分配给CacheSize即可,这里我配置的是512M
### Option: CacheSize
#   Size of configuration cache, in bytes.
#   Shared memory size for storing host, item and trigger data.
#
# Mandatory: no
# Range: 128K-8G
# Default:
CacheSize=512M
Last modification:July 1st, 2019 at 10:25 am
如果觉得我的文章对你有用,请随意赞赏

One comment

  1. test

    test

Leave a Comment