The Windows NT replicator service maintains identical sets of files and directories on different servers and workstations. When you update files on one server, the replicator service replaces the replicated files on other servers and workstations with the updated files. This replication process not only simplifies the task of updating and coordinating files, but it maintains the integrity of the replicated data.
Replication is controlled by options you set in the LANMAN.INI file using the following categories of replicator functions:
To replicate a set of files and directories on several computers, you place a master set of files and directories on a server that you designate as an export server. You then designate servers and workstations that receive the replicated files as import servers. The export servers keep the set of master files in an export directory tree of up to 32 levels. Each directory may contain as many as 1000 files. The import servers and workstations have corresponding import directories. When you change a file, or add or delete a directory or file in the export directory, the replicator service copies the same changes to the corresponding import directories on all import servers and workstations.
A network can have any number of export and import servers. A server can be both an export and an import server. However, you can configure only workstations as import servers.
If you are unable to replicate files, before using the replicator functions, check the Control Panel Services application to make sure the replicator service is configured to log on using a specific user account. This user account must be a member of the Replicator local group, and it must not be disabled or lacking permission to access the import and export trees on the respective servers. Failure specify the user account is the most common error in configuring the Replicator service.
The Windows NT Replicator service is intended to copy relatively small directory trees. If you are attempting to replicate multimegabyte directory trees or trees containing thousands of directories and files, you should consider some other means of doing so.
The change from the file system based control in LAN Manager 2.x to replicator function control in Windows NT has the following implications:
Each of the intended operations listed preceding can be specified to the Windows NT replicator service through an appropriate function.
Any user or application logged on as a member of the administration group or the server operator group on a local or remote export server can modify the parameters that control the replication service.
The configuration parameters of the replicator service can be examined and modified using the replicator configuration functions. The replicator configuration functions are:
The configuration parameters of the replictor can be examined using NetReplGetInfo. They can be modified using NetReplSetInfo.
The replicator configuration information structures are:
REPL_INFO_0
REPL_INFO_1000
REPL_INFO_1001
REPL_INFO_1002
REPL_INFO_1003
The replicator export directory functions control top-level directories under the export path on the master. The replicator export directory functions are:
NetReplExportDirAdd
NetReplExportDirDel
NetReplExportDirEnum
NetReplExportDirGetInfo
NetReplExportDirLock
NetReplExportDirSetInfo
NetReplExportDirUnlock
A user can create a new directory under the export path and the Replicator service will automatically replicate that directory. Or, a directory under the export path can be registered using NetReplExportDirAdd. When adding a directory to be replicated using these functions, the replication controls (integrity and extent) are specified using the NetReplExportDirAdd function. If the directory is created in the file system and no replicator functions are called, then the directory is treated as having file integrity and tree extent.
The integrity control determines when a master updates a client. When integrity is REPL_INTEGRITY_FILE, the client gets a replica of a file within the directory when it is not in use (being changed or replicated). When integrity is set to REPL_INTEGRITY_TREE, every file and directory within the replicated directory must be stable for the amount of time specified by the guardtime parameter before the client is updated. The extent control determines whether the entire tree within the directory is replicated (REPL_EXTENT_TREE) or only the files in the first-level directory is replicated (REPL_EXTENT_FILE).
The replication controls of each replicated directory can be examined using NetReplExportDirGetInfo, and dynamically modified using NetReplExportDirSetInfo. These control fields used to be specified in the REPL.INI file within each replicated directory on LAN Manager 2.x, and they could not be dynamically set. On Windows NT, the REPL.INI file is not used and will be ignored in the replication process.
The NetReplExportDirEnum function returns a list of directories that are currently replicated. The NetReplExportDirDel function removes registration from a directory so that it is no longer replicated.
The lock status information is returned in two fields: lockcount and locktime. The lockcount field indicates the number of outstanding locks on a directory. The locktime field indicates the time (in seconds since 1970, GMT) when the directory was first locked, or is 0 if the directory is not locked at the present time.
The NetReplExportDirLock function locks a directory so that it is not replicated, by incrementing a lock reference count for the directory. A lock on a directory can be unlocked using NetReplExportDirUnlock. The replication does not resume unless all outstanding locks on that directory are released, and the lock reference count is returned to 0. (The locktime field is automatically set to 0 when lockcount is 0.)
The replicator export directory functions can be called regardless of whether the Replicator service is running. If the Replicator service is running as a master, any modification to the directory controls takes effect immediately, and is persistent after the Replicator service has been stopped. If the Replicator service is not started, the controls for the directory is stored as persistent information and will take effect when the Replicator service starts up.
The replicator export directory functions are available at the following information levels:
REPL_EDIR_INFO_0
REPL_EDIR_INFO_1
REPL_EDIR_INFO_2
REPL_EDIR_INFO_1000
REPL_EDIR_INFO_1001
The replicator import directory functions designate the top-level directories under the import path to receive updates on. They also return status information about a replicated directory on the client. On LAN Manager 2.x, a user must create a directory under the import path and the Replicator service automatically replicates to it. The replicator import directory functions are:
NetReplImportDirAdd
NetReplImportDirDel
NetReplImportDirEnum
NetReplImportDirGetInfo
NetReplImportDirLock
NetReplImportDirUnlock
On Windows NT, import directories are automatically added if they are exported by an export server from which importer is importing. Another way to register a directory in advance of it being exported, is to use the NetReplImportDirAdd functions. This function does not create the directory itself. This is useful if you wish to modify some of the properties of the import directory (for example, to lock it) prior to it first beginning to import this directory.
The NetReplImportDirDel function unregisters a directory. This is used to clean up a directory that is no longer being exported. It will not stop replication if there is an active exporter, since it will be re-registered the next time the exporter tells the importer what directories it is exporting. If you wish to prevent importing of an actively exported directory, use NetReplImportDirLock.
The NetReplImportDirEnum function lists all the directories that are replicated to a client, and NetReplImportDirGetInfo returns the status of a specified directory.
The status information of a directory consists of the replication state, the UNC computer name of the master (mastername), and the time (in seconds since 1970, GMT) when the directory was last updated (last_update_time). If the state is REPL_STATE_OK, the directory currently has a master, and is receiving regular update notices from it. If the state is REPL_STATE_NO_MASTER, the directory is not supported by any master, and it is typically empty. If the state is REPL_STATE_NO_SYNC, the directory has a master, but the master has not sent any update notices within the interval time period. This may be due to a communication failure, the master crashing, the directory being locked, files in the client directory being opened at update time, or an unstable REPL_INTEGRITY_TREE integrity directory on the master. If the client Replicator service is not started, the state is REPL_STATE_NEVER_REPLICATED, mastername is a NULL string, and last_update_time is 0. The NetReplImportDirLock function locks a directory so that it does not receive updates, by incrementing a lock reference count for the directory. A lock on a directory can be unlocked using NetReplImportDirUnlock. The directory is not updated unless all outstanding locks on that directory are released, and the lock reference count is returned to 0.
The lock status information is returned in two fields: lockcount and locktime. The lockcount field indicates the number of outstanding locks on a directory. The locktime field indicates the time (in seconds since 1970, GMT) when the directory was first locked. (locktime is set to 0 whenever lockcount goes to 0.)
The replicator import directory functions can be called whether the Replicator service is running or not. If the Replicator service is running as a client, directory adds or deletes take effect immediately, and is persistent after the Replicator service has been stopped. If the Replicator service is not started, any added directory will receive updates when the Replicator service starts up (if there exists a master that exports the directory).
The replicator import directory function are available at the following information levels:
REPL_IDIR_INFO_0
REPL_IDIR_INFO_1