Este contenido no está disponible en el idioma seleccionado.
Chapter 14. Trimming the replication changelog
The Directory Server changelog manages a list of received and processed changes. It includes client changes and changes received from replication partners.
By default, Directory Server trims the changelog entries that are older than seven day. However, you can configure:
-
A maximum age of entries in the changelog in the
nsslapd-changelogmaxageparameter. -
The total number of records in the changelog in the
nsslapd-changelogmaxentriesparameter.
If you enabled at least one of these settings, Directory Server trims the changelog every five minutes by default (nsslapd-changelogtrim-interval).
Even with the trimming settings enabled, any record and records subsequently created remain in the changelog until they are successfully replicated to all servers in the topology. If you remove the supplier from the topology as described in Removing a supplier from a replication topology, then Directory Server trims all the updates of this supplier from changelogs on other servers.
14.1. Configuring replication changelog trimming using the command line Copiar enlaceEnlace copiado en el portapapeles!
Directory Server trims the changelog entries that are older than seven days by default. However, you can configure the time after which Directory Server removes entries. You can also configure Directory Server to automatically remove entries if the number of entries exceeds a configured value.
This section describes how to configure changelog trimming for the dc=example,dc=com suffix.
Red Hat recommends setting a maximum age instead of a maximum number of entries. The maximum age should match the replication purge delay set in the nsDS5ReplicaPurgeDelay parameter in the cn=replica,cn=suffixDN,cn=mapping tree,cn=config entry.
Perform this procedure on the supplier.
Prerequisites
-
You enabled replication for the
dc=example,dc=comsuffix.
Procedure
Configure change log trimming:
To set a maximum age of changelog entries, enter:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "4w"
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "4w"Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command sets the maximum age to 4 weeks. The parameter supports the following units:
-
s(S) for seconds -
m(M) for minutes -
h(H) for hours -
d(D) for days -
w(W) for weeks
-
To set a maximum number of entries, enter:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-entries "100000"
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-entries "100000"Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command sets the maximum number of entries in the changelog to 100,000.
By default, Directory Server trims the changelog every 5 minutes (300 seconds). To set a different interval, enter:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --trim-interval 600
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --trim-interval 600Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command sets the interval to 10 minutes (600 seconds).
Verification
Display the changelog settings of the suffix:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command only displays the parameters that are different to their default.
14.2. Manually reducing the size of a large changelog Copiar enlaceEnlace copiado en el portapapeles!
In certain situations, such as if replication changelog trimming was not enabled, the changelog can grow to an excessively large size. To fix this, you can reduce the changelog size manually.
This procedure describes how to trim the changelog of the dc=example,dc=com suffix. Perform this procedure on the supplier.
Prerequisites
-
You enabled replication for the
dc=example,dc=comsuffix.
Procedure
Optional: Display the size of the changelog:
Identify the back-end database of the
dc=example,dc=comsuffix:dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix list
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend suffix list dc=example,dc=com (userroot)Copy to Clipboard Copied! Toggle word wrap Toggle overflow The name in parentheses is the back-end database that stores the data of the corresponding suffix.
Display the size of the changelog file of the
userrootbackend:ls -lh /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.db
# ls -lh /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.db -rw-------. 1 dirsrv dirsrv 517M Jul 5 12:58 /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.dbCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To be able to reset the parameters after reducing the changelog size, display and note the current values of the corresponding parameters:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication get-changelog --suffix "dc=example,dc=com"
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication get-changelog --suffix "dc=example,dc=com" dn: cn=changelog,cn=userroot,cn=ldbm database,cn=plugins,cn=config cn: changelog nsslapd-changelogmaxage: 4w nsslapd-changelogtrim-interval: 300Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you do not see any specific attributes in the output, Directory Server uses their default values.
Temporarily, reduce trimming-related parameters:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "300s" --max-entries 500 --trim-interval 60
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "300s" --max-entries 500 --trim-interval 60Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantFor performance reasons, do not permanently use too short interval settings.
-
Wait until the time set in the
--trim-intervalparameter expires. Compact the changelog to regain disk space:
dsconf -D "cn=Directory Manager" ldap://server.example.com backend compact-db --only-changelog
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend compact-db --only-changelogCopy to Clipboard Copied! Toggle word wrap Toggle overflow Reset the changelog parameters to the values they had before you temporarily reduced them:
dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "4w" --trim-interval 300
# dsconf -D "cn=Directory Manager" ldap://server.example.com replication set-changelog --suffix "dc=example,dc=com" --max-age "4w" --trim-interval 300Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the size of the changelog:
ls -lh /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.db
# ls -lh /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.db -rw-------. 1 dirsrv dirsrv 12M Jul 5 12:58 /var/lib/dirsrv/slapd-instance_name/db/userroot/replication_changelog.dbCopy to Clipboard Copied! Toggle word wrap Toggle overflow