zabbix问题:cannot allocate shared memory of size

问题状态:

zabbix_agentd不能启动,系统CentOS 5.8 i386

原因分析:

这是因为内核对share memory的限制造成的。

用到如下命令ipcs [-m|l|a],sysctl [-a|p]

1

[root@server01 ~]# ipcs -l

<br /><br /><p></p><p>------ Shared Memory Limits --------<br />max number of segments = 4096 <strong><br />max seg size (kbytes) = 0<br />max total shared memory (kbytes) = 0</strong><br />min seg size (bytes) = 1</p><p>------ Semaphore Limits --------<br />max number of arrays = 128<br />max semaphores per array = 250<br />max semaphores system wide = 32000<br />max ops per semop call = 32<br />semaphore max value = 32767</p><p>------ Messages: Limits --------<br />max queues system wide = 16<br />max size of message (bytes) = 65536<br />default max size of queue (bytes) = 65536</p>

从上面可以看到max total shared memory和max seg size都是没有限制的。但是zabbix仍然不能allocate内存。

接下来查看目前的共享内存设置,

1

[root@server01 ~]# sysctl -a|grep shm<br />kernel.shmmni = 4096<br />kernel.shmall = 0<br />kernel.shmmax = 0

其中kernel.shmall代表总共能分配的共享内存,kernel.shmax代表单个段能allocate的内存(以字节为单位),这里都是0,所以肯定有问题。

然后查看/etc/sysctl.conf

1

kernel.shmmax = 68719476736<br />kernel.shmall = 4294967296

得到shmall为4G,shmax更大,为64G,因为是32位系统,所以设置shmall的时候不能超过32位系统能识别的最大内存,所以最多能设置为3G多,所以这个我改为

1

kernel.shmmax = 1294967296<br />kernel.shmall = 3294967296

然后执行sysctl -p生效,这时再查看如下。

1

[root@server01 ~]# sysctl -a|grep shm<br />kernel.shmmni = 4096<br />kernel.shmall = 3294967296<br />kernel.shmmax = 1294967296

的确生效了,然后启动zabbix_agentd成功,查看内存分配情况如下。

1

[root@server01 ~]# ipcs -m<br /><br /><p></p><p>------ Shared Memory Segments --------<br />key        shmid      owner      perms      bytes      nattch     status      <br />0x7401840e 2916352    root      600        4          0                       <br />0x6c0180cf 3047425    zabbix    600        527272     6  </p>

其实不光zabbix,很多程序出现此错误也能使用该方法解决,就是因为内核对资源的限制问题。

时间: 2024-12-21 19:11:07

zabbix问题:cannot allocate shared memory of size的相关文章

zabbix登陆问题:cannot allocate shared memory for collector

问题说明:在一台zabbix被监控服务器上(64位centos6.8系统,64G内容)启动zabbix_agent,发现进程无法启动,10050端口没有起来! 启动zabbix_agent进程没有报错,但10050端口没有正常启动起来.[[email protected] ~]# /usr/local/zabbix/sbin/zabbix_agentd[[email protected] ~]# ps -ef|grep zabbix_agentroot 27506 27360 0 11:07 p

ORA-04031:unable to allocate 4120 bytes of shared memory ‘obj stat mem’故障解决

客户报表库,HP-ux B11.31 IA64 FOR Oracle 10.2.0.5.0 RAC系统短信过滤alert日志告警 ORA-00604: error occurred at recursive SQL level 1 ORA-04031:unable to allocate 4120 bytes of shared memory ("shared pool","select f.file#, f.block#, f....","Typeche

nginx: [emerg] the size 10485760 of shared memory zone "cache_one" conflicts with already declared size 0

注意配置段中的区域包含关系.proxycachepatch 要在proxy_cache前已经定义. what seems to be the problem? [emerg]: the size 52428800 of shared memory zone "media" conflicts with already declared size 0 in /etc/nginx/conf.d/cache.conf:5 configuration file /etc/nginx/nginx

ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory

记录一次生产库遇到的4031错误,后来通过调整sga大小将问题解决了 报错信息: ORA-04031: 无法分配 32 字节的共享内存 ("shared pool","select user#,password,datats...","SQLA","tmp")Incident details in: /u01/app/oracle/diag/rdbms/twprod/xxxxx/incident/incdir_237848/x

GPU编程--Shared Memory(4)

GPU的内存按照所属对象大致分为三类:线程独有的.block共享的.全局共享的.细分的话,包含global, local, shared, constant, and texture memoey, 我们重点关注以下两类内存 Global memory Global memory resides in device memory and device memory is accessed via 32-, 64-, or 128-bytes memory transactions Shared

Android系统匿名共享内存Ashmem(Anonymous Shared Memory)驱动程序源代码分析

文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6664554 在上一文章Android系统匿名共享内存Ashmem(Anonymous Shared Memory)简要介绍和学习计划中, 我们简要介绍了Android系统的匿名共享内存机制,其中,简要提到了它具有辅助内存管理系统来有效地管理内存的特点,但是没有进一步去了解它是如何实 现的.在本文中,我们将通过分析Android系统的匿名共享内存

ORA-27101: shared memory realm does not exist

Oracle Error Tips by Burleson Consulting Oracle docs note this about ORA-27101: Cause: Unable to locate shared memory realm Action: Verify that the realm is accessible The solution in Windows may be to start the Windows services. MOSC offers valuable

ORA-27100 shared memory realm already exists错误解决方法

环境:win 2003   + oracle 10g win 2003服务器物理内存4G oracle10g SGA             1504M 事故背景: 调整SGA大小,因为OS的内存只有4G,建议SGA的大小不要超过60%,我调整为2G SQL> alter systemset sga_max_size=2000m scope=spfile; 重启数据库报错ORA-27100 shared memory realm already exists 分析原因:对于32位机器ORACLE

Android系统匿名共享内存(Anonymous Shared Memory)C++调用接口分析

一.Ashmem驱动程序 ~/Android/kernel/goldfish ----include ----linux ----ashmem.h ----mm ----ashmem.c 驱动程序详解请看<Android系统源代码情景分析>,作者罗升阳. 二.运行时库cutils的匿名共享内存访问接口 ~/Android/system/core ----libcutils ----ashmem-dev.c 详解请看<Android系统源代码情景分析>,作者罗升阳. 三.Memory