Automated workflows help shift the deployment process from a pets service model to a cattle service model. The primary tools that are required to manage the replication topology are dsreplication and remove-defunct-server.

Another key to every topology-management workflow is the file topology.json, which represents the intended state of the topology at any time, and can be built by querying some service for the intended state of the topology. This file is made available to the servers at runtime.

The following code shows an example topology.json file:

{
  "serverInstances" : [
    {
      "instanceName" : "ds-0",
      "hostname" : "ds-0.ds-topology.production.svc.cluster.local",
      "location" : "Austin",
      "ldapPort" : 389,
      "ldapsPort" : 636,
      "replicationPort" : 989,
      "startTLSEnabled" : true,
      "preferredSecurity" : "SSL",
      "product" : "DIRECTORY"
    },
    {
      "instanceName" : "ds-1",
      "hostname" : "ds-1.ds-topology.production.svc.cluster.local",
      "location" : "Austin",
      "ldapPort" : 389,
      "ldapsPort" : 636,
      "replicationPort" : 989,
      "startTLSEnabled" : true,
      "preferredSecurity" : "SSL",
      "product" : "DIRECTORY"
    },
    {
      "instanceName" : "ds-2",
      "hostname" : "ds-2.ds-topology.production.svc.cluster.local",
      "location" : "Austin",
      "ldapPort" : 389,
      "ldapsPort" : 636,
      "replicationPort" : 989,
      "startTLSEnabled" : true,
      "preferredSecurity" : "SSL",
      "product" : "DIRECTORY"
    },
    {
      "instanceName" : "ds-3",
      "hostname" : "ds-3.ds-topology.production.svc.cluster.local",
      "location" : "Austin",
      "ldapPort" : 389,
      "ldapsPort" : 636,
      "replicationPort" : 989,
      "startTLSEnabled" : true,
      "preferredSecurity" : "SSL",
      "product" : "DIRECTORY"
    },
    ...
  ]
}

The remaining sections in this chapter describe the deployment automation that is necessary to satisfy the following workflows:

  • Setting up the initial topology
  • Initializing data on all servers
  • Replacing crashed instances and scaling up
  • Scaling down
  • Rolling updates

Consistent network identifiers are required for each server instance. Additionally, we strongly recommend persistent storage for all server bits. The required level of automation changes slightly when this recommendation is not followed, as noted in each section.