Deploy a PingDataSync Failover Server ¶
You'll use Docker Compose to deploy a PingDirectory and PingDataSync stack. PingDataSync will synchronize data from a source tree on a PingDirectory instance to a destination tree on the same PingDirectory instance. The entries from
ou=destination,o=sync will be synchronized every second. Then you will scale up the PingDataSync service to enable failover, so that if an active PingDataSync server goes down, a second server will automatically become active and pick up where the first left off.
Note: Configuring failover requires a PingDataSync version of at least 18.104.22.168.
What You'll Do ¶
- Deploy the PingDirectory and PingDataSync stack.
- Scale up the PingDataSync service
- Test the deployment.
- Bring down or stop the stack.
- You've already been through Get Started to set up your DevOps environment and run a test deployment of the products.
Deploy the PingDirectory and PingDataSync Stack ¶
Go to your local
docker-compose up -d
Check that PingDirectory and PingDataSync are healthy and running:
You can also display the startup logs:
docker-compose logs -f
To see the logs for a particular product container at any point, enter:
docker-compose logs <product-container-name>
Scale PingDataSync instances
docker-compose up -d --scale pingdatasync=2
Test Deployment ¶
The stack will sync entries from
ou=destination,o=sync every second. One of the two sync servers will be considered active, while the other remains on standby.
In one terminal window, tail the logs from the PingDataSync servers:
docker-compose logs -f pingdatasync
In a second window, make a change to the
docker container exec -it 12-sync-failover-pair_pingdirectory_1 /opt/out/instance/bin/ldapmodify dn: uid=user.0,ou=people,ou=source,o=sync changetype: modify replace: description description: Change to source user.0 <Ctrl-D>
You'll see messages in the PingDataSync log showing
ADD/MODIFYof the user synced to the
ou=destination,o=synctree. To verify this, enter:
docker container exec -it 12-sync-failover-pair-sync_pingdirectory_1 /opt/out/instance/bin/ldapsearch -b uid=user.0,ou=people,ou=destination,o=sync -s base '(&)' description
Entries similar to this will be returned:
# dn: uid=user.0,ou=People,ou=destination,o=sync # description: Change to source user.0
In the log messages displayed in step 3, you'll see that one of the two PingDataSync servers handled the change. You can stop the container that handled the change to see future operations handled by the remaining PingDataSync server:
docker stop 12-sync-failover-pair_pingdatasync_1
You can now repeat steps 2 and 3 to verify that the remaining PingDataSync server is now active. It may take a moment to become active and handle the change after the first server is stopped.
Clean Up ¶
When you no longer want to run this stack, you can either stop the running stack, or bring the stack down.
To stop the running stack without removing any of the containers or associated Docker networks, enter:
To remove all of the containers and associated Docker networks, enter:
To remove attached Docker Volumes
docker volume prune