---
title: Setting up in a replicated PingDirectory server environment
description: Running the Consent Service setup script differs depending on if your environment includes replicated PingDirectory servers.
component: pingdirectory
version: 11.0
page_id: pingdirectory:consent_solution_guide:pd_cs_set_up_replicated_ds_env
canonical_url: https://docs.pingidentity.com/pingdirectory/11.0/consent_solution_guide/pd_cs_set_up_replicated_ds_env.html
revdate: September 13, 2023
section_ids:
  about-this-task: About this task
  steps: Steps
  choose-from: Choose from:
---

# Setting up in a replicated PingDirectory server environment

Running the Consent Service setup script differs depending on if your environment includes replicated PingDirectory servers.

## About this task

Setting up the Consent Service requires different steps depending on if replication is enabled in your environment or not.

|   |                                                                                                                |
| - | -------------------------------------------------------------------------------------------------------------- |
|   | If possible, you should set up the Consent Service after replication is enabled for the PingDirectory servers. |

You can find more information about server replication in the [PingDirectory Server Administration Guide](../pingdirectory_server_administration_guide/pd_ds_manage_replication.html).

## Steps

1. Choose a Consent Service setup:

   ### Choose from:

   * If you are setting up the Consent Service after replication is enabled for PingDirectory servers:

     1. Configure the PingDirectory servers to use a configuration group called `all-servers`.

        |   |                                                                                   |
        | - | --------------------------------------------------------------------------------- |
        |   | This ensures that configuration changes are applied to all servers in a topology. |

        ```shell
        $ bin/dsconfig set-global-configuration-prop \
          --set configuration-server-group:all-servers
        ```

     2. Run the Consent Service setup script.

        ```shell
        $ bin/dsconfig --no-prompt \
          --batch-file resource/consent/consent-service-cfg.dsconfig
          --applyChangeTo server-group
        ```

   * If you have set up the Consent Service on a standalone PingDirectory server before enabling replication:

     |   |                                                                                                                   |
     | - | ----------------------------------------------------------------------------------------------------------------- |
     |   | In this example, DS1 is the original PingDirectory server, and DS2 is the second server to be added as a replica. |

     1. Run the `config-diff` command without arguments on DS1 to produce a batch file that contains configuration changes that will be applied to DS2.

        ```shell
        $ bin/config-diff > config-changes.dsconfig
        ```

     2. Apply the `config-changes.dsconfig` file to DS2.

        ```shell
        $ bin/dsconfig --no-prompt \
          --batch-file config-changes.dsconfig \
          --applyChangeTo single-server
        ```

     3. Restart DS2.

     4. Enable replication between the two servers.
