问题状态:
zabbix_server 不能启动,系统CentOS 6.7

原因分析:
这是因为内核对share memory的限制造成的。

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

[root@server01 ~]# ipcs -l

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

  

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

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

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

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

然后查看 /etc/sysctl.conf

kernel.shmmax = 68719476736
kernel.shmall = 4294967296

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

kernel.shmmax = 1294967296
kernel.shmall = 3294967296

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

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

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

[root@server01 ~]# ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x7401840e 2916352 root 600 4 0
0x6c0180cf 3047425 zabbix 600 527272 6

  

解决zabbix的cannot allocate shared memory of size错误的更多相关文章

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

    问题说明:在一台zabbix被监控服务器上(64位centos6.8系统,64G内容)启动zabbix_agent,发现进程无法启动,10050端口没有起来! 启动zabbix_agent进程没有报错 ...

  2. ORA-27125: unable to create shared memory segment的解决方法(转)

    ORA-27125: unable to create shared memory segment的解决方法(转) # Kernel sysctl configuration file for Red ...

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

    记录一次生产库遇到的4031错误,后来通过调整sga大小将问题解决了 报错信息: ORA-04031: 无法分配 32 字节的共享内存 ("shared pool","s ...

  4. PHP运行错最有效解决办法Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744

    原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312) Fatal error: Out of memory (allocated ...

  5. 简单解决“ORA-27100: shared memory realm already exists”的问题

    背景 看到这篇文章,算是当初记录过程的一篇了,不像别的,只是有个结果算火.只是感觉到现在可能是碰不见这个问题了,现在哪有32位的oracle啊.可见技术随着岁月的变化,真不知10年后再看今天的问题,可 ...

  6. 关于Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file: 11043的解决办

    Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file: /tmp/hsperfdat ...

  7. Insufficient space for shared memory file 解决办法

    Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:   /tmp/hsperfd ...

  8. Oracle调整内存超出限制出现ORA-27100: shared memory realm already exists问题解决办法

    今天测试服务器遇到问题 ORA-04030:out of process memory when trying to allocate string bytes 一看就猜到是内存不足了,把Oracle ...

  9. shared memory realm does not exist

    有天启动ORACLE,碰到如下问题 提示ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist 解决 ...

随机推荐

  1. 阿里云ecs不同网段内网互通

    建立ClassicLink连接 官方文档:https://help.aliyun.com/document_detail/65413.html?spm=a2c4g.11186623.2.12.16c9 ...

  2. Codeforces 1245 E. Hyakugoku and Ladders

    传送门 显然这个图是个 $DAG$ ,那么就可以考虑跑 $dp$ 了 先考虑没有梯子的情况,首先把每个位置标号,越后面的位置编号越小,终点位置编号为 $1$ 那么从终点往起点 $dp$ ,枚举当前位置 ...

  3. Oracle数据库导出txt格式工具sqlload2使用

    开发需求:需要在数据库中查询数据,最终得到cxv表格形式数据. 使用plsql导出70M数据量非常慢,本次使用sqlload2工具,导出文本txt文本格式. 1)导出txt文本文件$ ./sqluld ...

  4. 使用github经验

    使用github经验 良好的使用习惯,就像是每天来看朋友圈一样,不一定每天都有东西要提交,但是一定要一直有一个 repository 在维护,持续的提交代码.同时也要注意自己的 repository的 ...

  5. hdu 2544 Dijstra模板题

    最短路 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  6. R语言做逻辑回归

    前面写过一个多分类的逻辑回归,现在要做一个简单的二分类,用glm函数 导入csv格式如下: mydata<-read.csv("D://li.csv",header=T) c ...

  7. Echarts配置项详解

    1.图表标题 title: { x: 'left', // 水平安放位置,默认为左对齐,可选为: // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位 ...

  8. 利用PL/SQL从Oracle数据库导出和导入数据

    转自:https://www.jb51.net/article/109768.htm 本文实例为大家分享了使用PL/SQL从Oracle数据库导出和导入数据的方法,供大家参考,具体内容如下 1.导出数 ...

  9. iOS-OC中常见的一些宏

    /* 1. 颜色 */ #define PCBRGBColorA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b ...

  10. Dubbo:1

    Dubbo能解决什么问题 怎么去维护url:通过注册中心去维护url(zookeeper.redis.memcache…). F5硬件负载均衡器的单点压力比较大:软负载均衡. 怎么去整理出服务之间的依 ...