Context
We may need to enable Core dumps to help investigate stack traces.
Method
systemd environments
Create a location for the Core files
sudo mkdir -p /opt/corefiles/- chmod 0777 /opt/corefiles
Set kernel.core_pattern to desired path for coredump files
- Dynamically through sysctl :
sysctl -w kernel.core_pattern=/opt/corefiles/core.%e.%t.%p
sysctl -w kernel.core_pipe_limit=0
sysctl -w kernel.core_uses_pid=0
sysctl -w fs.suid_dumpable=1
-
Or make the changes persistent in /etc/sysctl.conf and run
sudo sysctl -p -
Verify Core pattern
cat /proc/sys/kernel/core_pattern
Edit /etc/security/limits.conf
- add the following line entry at the bottom of the file (before # End of file)
* hard core unlimited
* soft core unlimited
exit and re-enter current shell.
- Modify /etc/systemd/system.conf
- add DefaultLimitCORE=infinity
- Modify your systemd aerospike service configuration
vi /etc/systemd/system/aerospike.service.d/override.conf- add the following:
[Service]
LimitCORE=infinity
- reload the new systemd config and restart aerospike service
sudo systemctl daemon-reexec
sudo systemctl stop aerospike
sudo systemctl start aerospike
sudo systemctl status aerospike
Notes
Test coredump
- Force asd to do a SIGSEGV
sudo kill -11 `pidof asd`
- Generate a kernel panic in non-prod environment
echo c > /proc/sysrq-trigger