Heartbeat does not respond after startup, and heartbeat starts a response.
After applying heartbeat to the production environment, start service heartbeat start and no response will be made after discovery. Check the tail-f/var/log/ha-log as follows:
Heartbeat [30680]: 2015/01/27 _ 18:04:29 info: Version 2 support: false
Heartbeat [30680]: 2015/01/27 _ 18:04:29 WARN: Logging daemon is disabled -- enabling logging daemon is recommended
Heartbeat [30680]: _ 18:04:29 info :**************************
Heartbeat [30680]: 2015/01/27 _ 18:04:29 info: Configuration validated. Starting heartbeat 2.1.3
Heartbeat [30681]: 2015/01/27 _ 18:04:29 info: heartbeat: version 2.1.3
Heartbeat [30681]: 2015/01/27 _ 18:04:29 WARN: No Previous generation-starting at 1422353070
Heartbeat [30681]: 2015/01/27 _ 18:04:29 info: Heartbeat generation: 1422353070
Heartbeat [30681]: 2015/01/27 _ 18:04:29 info: No uuid found for current node-generating a new uuid.
Heartbeat [30681]: _ 18:04:29 info: Creating FIFO/var/lib/heartbeat/fifo.
The resources managed by heartbeat are not started.
At the beginning, there was no clue. Even checking the debug log had no effect. What else would be reported?
Finally, I thought of service hearbeat status and finally got a prompt:
Cannot shmget for process status: Invalid argument
Following this line, Baidu found that kernel. shmmax was caused by kernel parameters. Because this machine is an old machine with version 5.5, and the new 6.5 server does not have this problem.
My machine's shmmax data settings are too large, leading to shared memory creation failure.
The shmmax Kernel Parameter defines the maximum value of a single shared memory segment. Generally, we recommend that you use half of the physical memory, in bytes.
Take 2G as an example: 2048/2*1024*1024 = 1073741824
Add kernel. shmmax = 1073741824 in/etc/sysctl. conf, which will take effect after system restart.
After the change, the service heartbeat start is not started, and the service hearbeat status error is reported again.
Cannot shmget for process status: No space left on device
This is because the shmall shared memory is too large.
The shmall Kernel Parameter defines the number of pages in the shared memory. It is generally recommended to set this parameter to the physical memory size, unit: Page, 1 page = 4 k
Take 2G as an example: 2048*1024*1024/4000 = 536870
Add kernel. shmall = 536870 to/etc/sysctl. conf, which will take effect after system restart.
After all the preceding changes are completed, the service heartbeat start is started again, and the VIP is successfully taken over.
OK, I hope to help you.