A request we’ve received consistently from our customers is – How do I know what DFS Replication is currently doing on my server? In Windows Server 2008 R2, we have attempted to provide a way for administrators to better understand the state of replication on their servers.
This feature is available by virtue of a new command line switch for the dfsrdiag.exe diagnostic tool. The ‘ReplicationState’ (or ‘ReplState’) command line switch enables an administrator to query the DFS Replication service and retrieve information about the status of replication activity on that server.
This command line switch can be executed against servers running Windows Server 2008 R2 only
. The output of this command line switch consists of a list of updates that are currently being serviced by the replication service on all inbound and outbound replication connections. Since this command line switch provides a point in time snapshot of replication activity on a server, it is possible to see whether replication is making any progress by comparing the output of this command obtained at different points in time.
We can better understand how to use this command for monitoring purposes with a sample setup as described below.
Consider a replication group called ‘ContosoPublication’. The folder ‘ContosoPub’ is replicated between two servers (CONTOSO-HUB and CONTOSO-BRANCH) in this replication group. Typically, the administrator publishes data on the hub server (CONTOSO-HUB) and this data is replicated to the branch office server (CONTOSO-BRANCH) using the DFS Replication service.
An administrator may want to monitor the state of replication on either of the servers to better understand what the DFS Replication service is currently up to. The following sections explain how to use the new ‘ReplicationState’ command line switch for the dfsrdiag.exe diagnostic tool for this purpose.
Monitoring replication on the branch office server
In order to monitor the current replication state of the DFS replication service on these servers, the command
can be used. The /member (or /mem) option can be used along with the ‘ReplicationState’ command line switch to specify the server against which this command should be run. In this example, I’ve dumped a few files from the ‘Windows\System32’ directory into the replicated folder.
dfsrdiag ReplicationState /member:CONTOSO-BRANCH
The verbose option (
‘dfsrdiag ReplicationState /all’
) prints out more information for each update. This includes the versioning information maintained by the DFS Replication service (UID, GVSN, Parent UID) and the replicated folder to which the update belongs.
Active inbound connection:
These are connections over which data/updates are replicated in onto the server being monitored. In this example, the active inbound connection is used by the DFS Replication service to replicate updates from CONTOSO-HUB to the branch office server (CONTOSO-BRANCH). Expect to see at least one active inbound connection per replication partner for all replication member servers on which this command is executed. On a server which is replicating with many replication partners (such as a hub server), if the ‘ReplicationState’ command line is executed, the output will display all the current active connections with these replication partners.
The connection GUID is a unique identifier which distinguishes individual connections on a DFS Replication member server.
Active outbound connection:
This is a connection over which data/updates are replicated out to other replication partners from the server being monitored. In this example, the replicated folder ‘ContosoPub’ has been configured to be a
read-only replicated folder
on the branch office server (CONTOSO-BRANCH). Therefore, the branch office server will not have any active outbound connections – simply because it is not expected to replicate out any changes to its replication partners. That’s why the above output shows ‘Active outbound connections: 0’.
This is the name of the replication partner which is sending data over this particular connection. In this example, the sending partner is the hub server (CONTOSO-HUB), which sends updates to the branch office server (CONTOSO-BRANCH) over the active inbound connection.
Number of updates:
This value signifies the sum of the number of updates being currently processed for the given connection and the number of updates which have been scheduled for processing for that connection. In short,
Number of updates = (Updates being processed + Updates scheduled)
Updates being processed:
This value signifies the number of updates that the DFS Replication service is currently processing. For an active inbound connection, this means that the DFS Replication service is downloading data corresponding to that update from its replication partner. For an active outbound connection, it means that the DFS Replication service is currently transmitting the update to its replication partner.
This value signifies the number of updates that have been queued for processing over the connection. Once the DFS Replication service is done with the updates that are currently being processed, it will begin to process these queued/scheduled updates.
This contains more information about the update including the name of the file, version information maintained by the DFS Replication service and the path. In case of files which are currently being downloaded or have been scheduled for processing, the path to the file may not always be available. In such cases the path is not logged in the output. Updates may also be directories contained within the replicated folder.
Monitoring replication on the hub server
The same command line switch can be executed against the DFS Replication service on the hub server (“
dfsrdiag.exe ReplicationState /member:CONTOSO-HUB
”) in order to monitor the state of the hub server.