问题状态:
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. (十一)SpringBoot之文件上传以及

    一.案例 1.1 配置application.properties #主配置文件,配置了这个会优先读取里面的属性覆盖主配置文件的属性 spring.profiles.active=dev server ...

  2. 存储过程、插入数据后直接过去主键id

    DECLARE @sql nvarchar() DECLARE @cou int SET @sql='INSERT INTO people values('''+'xiaohong'+''');sel ...

  3. vue 集成 NEditor 富文本

    下载NEditor 放在  vue 项目下面 public  文件中. 安装    vue-neditor-wrap  执行命令 npm  install  vue-neditor-wrap 代码使用 ...

  4. office2016激活码 最新各个版本 激活

    office2016专业版激活密钥 Microsoft Office 2016 Pro Plus Retail 零售版序列号密钥: BHXN7-MQB36-MTHQ4-8MHKV-CYT97 Micr ...

  5. Abp 添加权限项<一>

    1.下载代码,数据库迁移,npm install 2.添加权限项: public static class PermissionNames { public const string Pages_Te ...

  6. Docker启动Elasticsearch报错vm.max_map_count

    报错信息如下 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 临 ...

  7. list通过lambda 表达式去重,筛选

    List<User> distinctList = new ArrayList();User user1 = new User();user1.setId("111") ...

  8. 2019年Java后端工程师常见面试题和感想

    来新公司有5个月了,从第二个月开始就参与公司后端工程师的面试工作了,包括校招在内,面试超过100个(包括40个校招的终面)应聘者了,应聘者中有超过10年的技术经理,有6年以上的高级开发,有3到5年的中 ...

  9. vmware 虚拟机扩展 liunx系统硬盘空间

    参考一下以下博客 https://www.cnblogs.com/yongdaimi/p/9050155.html https://blog.csdn.net/daemon_2017/article/ ...

  10. socket技术详解

    https://blog.csdn.net/weixin_39634961/article/details/80236161 socket编程是网络常用的编程,我们通过在网络中创建socket关键字来 ...