zabbix登陆问题:cannot allocate shared memory for collector
问题说明:
在一台zabbix被监控服务器上(64位centos6.8系统,64G内容)启动zabbix_agent,发现进程无法启动,10050端口没有起来!
启动zabbix_agent进程没有报错,但10050端口没有正常启动起来。
[root@ctl ~]# /usr/local/zabbix/sbin/zabbix_agentd
[root@ctl ~]# ps -ef|grep zabbix_agent
root 27506 27360 0 11:07 pts/5 00:00:00 grep --color zabbix
[root@ctl etc]# lsof -i:10050
查看/usr/local/zabbix/logs/zabbix_agentd.log日志,发现报错如下:
................
27667:20161027:111554.851 cannot allocate shared memory of size 657056: [28] No space left on device
27667:20161027:111554.851 cannot allocate shared memory for collector
..............
原因分析:
这是因为内核对share memory的限制造成的。
处理过程记录:
[root@ctl logs]# ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
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 = 100
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 32768
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536
从上面命令结果可以看到:
max total shared memory设置的是2M,max seg size设置的是8M,这显然不够allocate(分配)zabbix_agent启动所使用的内存。
查看目前的共享内存设置,
[root@ctl logs]# sysctl -a|grep shm
kernel.shmmni = 4096
kernel.shm_rmid_forced = 0
vm.hugetlb_shm_group = 0
其中kernel.shmall代表总共能分配的共享内存,这里是2G,kernel.shmax代表单个段能allocate的内存(以字节为单位),这里是2M,所以肯定有问题!
然后查看/etc/sysctl.conf
[root@ctl logs]# cat /etc/sysctl.conf
........
kernel.shmall = 2097152
kernel.shmmax = 1987162112
显然在sysctl.conf文件里设置的kernel.shamll和kernel.shmmax参数的值小了。
--------------------------------------------------------------
本机是64位的centos 6.8系统,64G内存,查看其它同系统的被监控服务器发现:
[root@bastion-IDC ~]# cat /etc/sysctl.conf
........
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
[root@ctl logs]# ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
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 = 100
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 32768
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536
即64位的centos6系统(64G)的上面两个参数的默认值是64G和4G,设置的都是系统能识别的最大内存。
---------------------------------------------------------------
现在只需要在本机调大这两个参数值即可解决问题!
[root@ctl logs]# cat /etc/sysctl.conf
........
kernel.msgmnb = 65536
kernel.msgmax = 65536
执行sysctl -p生效
[root@ctl logs]# sysctl -p
再次查看发现已经修改成功了!
[root@ctl logs]# sysctl -a|grep shm
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.shm_rmid_forced = 0
vm.hugetlb_shm_group = 0
[root@ctl logs]# ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 67108864
max total shared memory (kbytes) = 17179869184
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 = 100
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 32768
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536
最后重新启动zabbix,发现10050端口顺利启动了:
[root@ctl ~]# /usr/local/zabbix/sbin/zabbix_agentd
[root@ctl logs]# ps -ef|grep zabbix
zabbix 27776 1 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd
zabbix 27777 27776 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 27778 27776 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix 27779 27776 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 27780 27776 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix 27781 27776 0 11:22 ? 00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 28188 27360 0 11:48 pts/5 00:00:00 grep --color zabbix
[root@ctl logs]# lsof -i:10050
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
zabbix_ag 27776 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
zabbix_ag 27777 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
zabbix_ag 27778 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
zabbix_ag 27779 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
zabbix_ag 27780 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
zabbix_ag 27781 zabbix 4u IPv4 112357384 0t0 TCP *:zabbix-agent (LISTEN)
[root@ctl logs]#
总结:
其实不止是zabbix程序启动会碰到这个问题,很多程序出现此错误也能使用该方法解决,就是因为内核对资源的限制问题。
zabbix登陆问题:cannot allocate shared memory for collector的更多相关文章
- 解决zabbix的cannot allocate shared memory of size错误
问题状态:zabbix_server 不能启动,系统CentOS 6.7 原因分析:这是因为内核对share memory的限制造成的. 用到如下命令ipcs [-m|l|a],sysctl [-a| ...
- ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory
记录一次生产库遇到的4031错误,后来通过调整sga大小将问题解决了 报错信息: ORA-04031: 无法分配 32 字节的共享内存 ("shared pool","s ...
- ORA-27101:shared memory realm does not exist的问题
ORA-27101:shared memory realm does not exist的问题 登陆SQLPlus时出现: ORA-01034:ORACLE not avaiable ORA-2710 ...
- IPC:shared memory
#include <stdio.h> #include <sys/shm.h> #include <sys/stat.h> int main () { int se ...
- Android系统匿名共享内存Ashmem(Anonymous Shared Memory)驱动程序源代码分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6664554 在上一文章Android系统匿名共 ...
- GPU编程--Shared Memory(4)
GPU的内存按照所属对象大致分为三类:线程独有的.block共享的.全局共享的.细分的话,包含global, local, shared, constant, and texture memoey, ...
- Oracle调整内存超出限制出现ORA-27100: shared memory realm already exists问题解决办法
今天测试服务器遇到问题 ORA-04030:out of process memory when trying to allocate string bytes 一看就猜到是内存不足了,把Oracle ...
- ORA-27125: unable to create shared memory segment的解决方法(转)
ORA-27125: unable to create shared memory segment的解决方法(转) # Kernel sysctl configuration file for Red ...
- Oracle:shared memory realm does not exist
1. 先描述一个连接Oracle 10g的错误:“shared memory realm does not exist” 如图所示Sqlplus连接时出现这个错误: 2. Oracle 服务器主要组件 ...
随机推荐
- vundle按照YouComplete
https://github.com/VundleVim/Vundle.vim http://www.jianshu.com/p/d908ce81017a?nomobile=yes http://ww ...
- ECMAScript 6学习笔记(一):展开运算符
同步发布于:https://mingjiezhang.github.io/(转载请说明此出处). JavaScript是ECMAScript的实现和扩展,ES6标准的制定也为JavaScript加入了 ...
- Android网络编程只局域网传输文件
Android网络编程之局域网传输文件: 首先创建一个socket管理类,该类是传输文件的核心类,主要用来发送文件和接收文件 具体代码如下: package com.jiao.filesend; im ...
- iOS之多控制器管理--项目中的常见文件
项目中的常见文件 内容大纲: 1.LaunchScreen 2.info.plist文件 3.pch文件 1.LaunchScreen xcode5和xcode6区别 1.xcode6没有Framew ...
- ruby语言是什么东西
1.简介 Ruby是日本的Yukihiro Matsumoto写的,简单易学的面向对象的脚本语言,像perl一样,有丰富的文字处理.系统管理等丰富 功能,但是ruby要简单,容易理解和扩充.跟p ...
- SPC.NET,为5年的开发做个结尾
从08年到如今从事asp.net开发已五年,起初只是一个简单的喜好,想做个东西出来.于是SPC.NET的前生诞生了,直至今日. 不得不说,一个人开发一个软件是很辛苦的事情,以下是SPC.NET的一些特 ...
- Group By Count不能显示0的问题
问题: 如对表: /*==================================================== id |score |grade ------------------- ...
- jetbrains DataGrip 导出Excel
之前一直不知道如何通过DataGrip 导出Excel,导致每次都是用Navcat来做导出,今天研究了下,原来用TSV格式就能复制到Excel表格,具体步骤如下: ------------------ ...
- 被废弃的 Thread.stop, Thread.suspend, Thread.resume 和Runtime.runFinalizersOnExit
最近学习多线程的知识,看到API里说这些方法被废弃了,就查了一下原因 Thread.stop 这个方法会解除被加锁的对象的锁,因而可能造成这些对象处于不一致的状态,而且这个方法造成的ThreadDea ...
- 三星嵌入式开发平台 三星Cortex-A9 4412 POP与SCP对比
iTOP-4412核心板是迅为电子推出的一款高端四核核心板,其中分为POP封装与SCP封装,配备三星Exynos 4412四核处理器,主频为1.4GHz,内置16GB存储空间.该板设计小巧.配备三星自 ...