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

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

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

  1. To initialize a consumer, run:

    # dsconf <supplier_instance_name> repl-agmt init --suffix="dc=example,dc=com" <supplier_consumer_agreement_name>
    Copy to Clipboard Toggle word wrap

    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>
    Agreement successfully initialized.
    Copy to Clipboard Toggle word wrap

15.3. Initializing a consumer online by using the web console

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

  1. Open the Replication menu, and select the suffix you plan to replicate.
  2. On the Agreements tab, click the Options menu (⋮) next to the name of the replication agreement, and select Initialize Agreement.
  3. 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

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

  1. On a supplier server, perform the following steps:

    1. Shut down the instance on the supplier:

      # dsctl <supplier_instance_name> stop
      Copy to Clipboard Toggle word wrap
    2. 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
      Copy to Clipboard Toggle word wrap
    3. Start the instance on the supplier:

      # dsctl <supplier_instance_name> start
      Copy to Clipboard Toggle word wrap
  2. On a consumer server, perform the following steps:

    1. Shut down the instance on the consumer:

      # dsctl <consumer_instance_name> stop
      Copy to Clipboard Toggle word wrap
    2. Copy the exported example.ldif file to the /var/lib/dirsrv/slapd-<consumer_instance_name>/ldif/ directory on the consumer.
    3. 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 the dsctl ldif2db command, see Importing data using the command line while the server is offline.
    4. Start the instance on the consumer:

      # dsctl <consumer_instance_name> start
      Copy to Clipboard Toggle word wrap

Verification

  • Display the agreement status:

    # dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" <supplier_consumer_agreement_name>
    Agreement successfully initialized.
    Copy to Clipboard Toggle word wrap

15.5. Setting initialization timeout

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 the cn=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 to 0:

    # dsconf <instance_name> config replace nsslapd-idletimeout=0
    Successfully replaced value(s) for 'nsslapd-idletimeout': '0'
    Copy to Clipboard Toggle word wrap
  • To disable the timeout for the cn=replication manager,cn=config entry:

    # ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    password: <password>
    dn: cn=replication manager,cn=config
    changetype: modify
    add: nsIdleTimeout
    nsIdleTimeout: 0
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat