Este conteúdo não está disponível no idioma selecionado.
Chapter 15. Initializing a consumer in a replication topology
After creating the replication agreement, you must initialize the consumer, otherwise Directory Server does not start the replication. During initialization operation, the supplier copies the existing data to the consumer.
15.1. When to initialize a consumer Copiar o linkLink copiado para a área de transferência!
Consumer initialization involves copying data from a supplier server to a consumer server. Once the subtree has been physically placed on the consumer, the supplier server can begin replaying update operations to the consumer server.
Under normal operations, you must not reinitialize the consumer. However, in case of large discrepancy between the supplier’s and consumer’s data, perform the consumer reinitialization.
For example, if you restored data on the supplier server from a backup, then you must also reinitialize all consumers supplied by that server. Another example is when the supplier could not contact the consumer for a long time (a week or more), and the supplier determines that the consumer is too far out of date to be updated and must be reinitialized.
Use online or offline method to initialize a consumer depending on your topology:
- In case of a small number of consumers, perform online consumer initialization by using the web console. Online consumer initialization is the method to use when the consumer is initialized as part of the replication agreement configuration on the supplier server.
- In case of large number of replicas or large databases, perform manual consumer initialization from a single LDIF file by using the command line.
15.2. Initializing a consumer when the instance is online using the command line Copiar o linkLink copiado para a área de transferência!
You can initialize a consumer by using the command line, when supplier and consumer instances are online.
Prerequisites
-
You enabled replication for the
dc=example,dc=com
suffix on a supplier and consumer servers. - You created a replication agreement between supplier and consumer servers.
Procedure
To initialize a consumer, run:
dsconf <supplier_instance_name> repl-agmt init --suffix="dc=example,dc=com" <supplier_consumer_agreement_name>
# dsconf <supplier_instance_name> repl-agmt init --suffix="dc=example,dc=com" <supplier_consumer_agreement_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Depending on the amount of data to replicate, the initialization can be time-consuming.
Verification
Display the agreement status:
dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" <supplier_consumer_agreement_name>
# dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" <supplier_consumer_agreement_name> Agreement successfully initialized.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
15.3. Initializing a consumer online by using the web console Copiar o linkLink copiado para a área de transferência!
You can initialize a consumer by using the web console only if supplier and consumer instances are online.
Prerequisites
-
You enabled replication for the
dc=example,dc=com
suffix on a supplier and consumer servers. - You created a replication agreement between supplier and consumer servers.
- You are logged in to the Directory Server instance in the web console.
Procedure
- Open the Replication menu, and select the suffix you plan to replicate.
- On the Agreements tab, click the Options menu (⋮) next to the name of the replication agreement, and select .
Confirm the initialization by checking Yes, I am sure checkbox in the pop-up window.
Depending on the amount of data to replicate, the initialization can be time-consuming.
Verification
- If the initialization completed successfully, you see the Initialized state in the Last Init Status column.
15.4. Initializing a consumer when the instance is offline Copiar o linkLink copiado para a área de transferência!
If you have a large database or many consumers, consider using the offline initialization by using the command line. This procedure involves exporting data from a supplier server and importing this data to a consumer server.
Prerequisites
-
You enabled replication for the
dc=example,dc=com
suffix on a supplier and consumer servers. - You created a replication agreement between supplier and consumer servers.
Procedure
On a supplier server, perform the following steps:
Shut down the instance on the supplier:
dsctl <supplier_instance_name> stop
# dsctl <supplier_instance_name> stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the
userRoot
database that contains the suffix to replicate into the/var/lib/dirsrv/slapd-<supplier_instance_name>/ldif/example.ldif
file with replication information:dsctl <supplier_instance_name> db2ldif --replication userRoot /var/lib/dirsrv/slapd-<supplier_instance_name>/ldif/example.ldif
# dsctl <supplier_instance_name> db2ldif --replication userRoot /var/lib/dirsrv/slapd-<supplier_instance_name>/ldif/example.ldif
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the instance on the supplier:
dsctl <supplier_instance_name> start
# dsctl <supplier_instance_name> start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
On a consumer server, perform the following steps:
Shut down the instance on the consumer:
dsctl <consumer_instance_name> stop
# dsctl <consumer_instance_name> stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy the exported
example.ldif
file to the/var/lib/dirsrv/slapd-<consumer_instance_name>/ldif/
directory on the consumer. -
Import the
userRoot
database from the/var/lib/dirsrv/slapd-<consumer_instance_name>/ldif/example.ldif
file. For more information how to import data by using thedsctl ldif2db
command, see Importing data using the command line while the server is offline. Start the instance on the consumer:
dsctl <consumer_instance_name> start
# dsctl <consumer_instance_name> start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the agreement status:
dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" <supplier_consumer_agreement_name>
# dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" <supplier_consumer_agreement_name> Agreement successfully initialized.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
15.5. Setting initialization timeout Copiar o linkLink copiado para a área de transferência!
If initialization of large databases fails due to timeouts, set one of the following parameters to a longer or unlimited period:
-
The
nsslapd-idletimeout
configuration parameter in thecn=config
entry that sets the timeout for all replication agreements on the server. -
The
nsIdleTimeout
parameter in the replication manager’s DN that sets the timeout for all agreements that use this replication manager entry.
Prerequisites
- You have root permissions.
Procedure
To disable the timeout globally, set
nsslapd-idletimeout
to0
:dsconf <instance_name> config replace nsslapd-idletimeout=0
# dsconf <instance_name> config replace nsslapd-idletimeout=0 Successfully replaced value(s) for 'nsslapd-idletimeout': '0'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To disable the timeout for the
cn=replication manager,cn=config
entry:Copy to Clipboard Copied! Toggle word wrap Toggle overflow