Problem Status:
ZABBIX_AGENTD cannot start, system CentOS 5.8 i386
Cause Analysis:
This is due to the kernel's limitations on share memory.
Use the following command IPCS [-M|L|A],SYSCTL [-a|p]
1 |
[root@server01 ~]# ipcs-l < Span class= "Crayon-o" ><br/><br/><p></p> <p>------Shared Memory Limits--------<br/>max number of segments = 4096 <strong><br/>max seg s Ize (Kbytes) = 0<br/>max Total shared memory (Kbytes) = 0</strong><br/>min seg size (bytes) = 1</p& gt;<p>------Semaphore Limits--------<br/>max number of arrays = 128<br/>max semaphores per array = 2 50<BR/>max semaphores system wide = 32000<br/>max ops per semop call = 32<br/>semaphore max value = 3 2767</p><p>------messages:limits--------<br/>max queues system wide = 16<br/>max size of mess Age (bytes) = 65536<br/>default max size of queue (bytes) = 65536</p> |
You can see from above that Max Total shared memory and Max SEG size are unlimited. But Zabbix still can't allocate memory.
Next, look at the current shared memory settings,
1 |
[root@server01 ~]# sysctl-a|grep shm<br/>kernel.shmmni = 4096<br/> Kernel.shmall = 0<br/>kernel.shmmax = 0 |
Where Kernel.shmall represents the total amount of shared memory that can be allocated, Kernel.shmax represents the memory (in bytes) that a single segment can allocate, which is 0, so there must be a problem.
Then view/etc/sysctl.conf
1 |
Kernel. Shmmax = 68719476736<br />kernel. Shmall = 4294967296 |
Get Shmall for 4g,shmax larger, 64G, because is 32-bit system, so set shmall time can not more than 32-bit system to recognize the maximum memory, so can be set to more than 3G, so this I instead
1 |
Kernel. Shmmax = 1294967296<br />kernel. Shmall = 3294967296 |
Then perform sysctl-p to take effect, and then look at the following.
1 |
[root@server01 ~]# sysctl-a|grep shm<br/>kernel.shmmni = 4096<br/> Kernel.shmall = 3294967296<br/>kernel.shmmax = 1294967296 |
It does take effect, then start zabbix_agentd successfully, and check the memory allocations as follows.
1 |
[Root@Server01 ~]# ipcs-m<br/><br/><p></p><p>----- -Shared Memory segments--------<br/>key shmid owner perms bytes nattch status &NBSP;<BR/>0x7401840e 2916352 root 600 4 0 <br/>0X6C0180CF 3047425 zabbix 600 527272 6 </p> |
In fact, not only Zabbix, many programs this error can also be used to solve the problem, because the kernel of the resource constraints.
Zabbix question: Cannot allocate shared memory of size