21.5. Monitoring the Local Disk for Graceful Shutdown
slapd) crashes. Any abrupt shutdown runs the risk of corrupting the database or losing directory data.
slapdprocess. A disk monitoring thread is enabled using the
nsslapd-disk-monitoringconfiguration attribute. This creates a monitoring thread that wakes every ten (10) seconds to check for available disk space in certain areas.
slapdbegins a series of steps (by default) to reduce the amount of disk space it is consuming:
- Verbose logging is disabled.
- Access logging and error logging are disabled.
- Rotated (archived) logs are deleted.
slapdbegins a graceful shut down process (within a grace period); and if the available disk space ever drops to 4KB, then the
slapdprocess shuts down immediately. If the disk space is freed up, then the shutdown process is aborted, and all of the previously disabled log settings are re-enabled.
nsslapd-disk-monitoring-logging-criticalparameter, monitoring also includes the log directory when evaluating disk space.
- Use the
dsconf config replacecommand to add the disk monitoring configuration parameters. For example, to enable disk monitoring and set the threshold to 3 MB:
# dsconf -D 'cn=Directory Manager' ldap://server.example.com config replace nsslapd-disk-monitoring=on nsslapd-disk-monitoring-threshold=3000000
- Optional: Configure Directory Server to switch the database to read-only mode if half of the threshold you set in the
# dsconf -D 'cn=Directory Manager' ldap://server.example.com config replace nsslapd-disk-monitoring-readonly-on-threshold=onWith this setting, the databases cannot be modified until Directory Server successfully shuts down the instance. This can prevent data corruption.
ImportantWith this setting, Directory Server does not start if the free disk space is below half of the threshold configured in the
- Restart Directory Server to load the new configuration.
# dsctl instance_name restart