[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2


drm_admin Command

Purpose

Administers servers based on the Data Replication Manager (DRM), such as glbd, the replicated version of the global location broker (GLB).

Syntax

drm_admin [ -version ]

Description

The drm_admin tool administers servers based on the Data Replication Manager (DRM) such as glbd, the replicated version of the global location broker (GLB).

With drm_admin, you can inspect or modify replica lists, merge databases to force convergence among replicas, stop servers, and delete replicas.

The role of drm_admin is to administer the replication of databases, not to change the data they contain. For instance, you can use drm_admin to merge two replicas of the GLB database, but you must use lb_admin to add a new entry to the database. Also, although drm_admin can stop or delete a GLB replica, you must invoke glbd directly if you want to start or create a replica.

Once invoked, drm_admin enters an interactive mode, in which it accepts the commands described below.

Flags


-version Displays the version of NCS that this glbd belongs to, but does not start the daemon.

Subcommands

Most drm_admin commands operate on a default object (DefaultObj) at a default host (DefaultHost). Together, DefaultObj and DefaultHost specify a default replica. Defaults are established by the set command and are remembered until changed by another set.

Currently, the only known object is GLB.

Some drm_admin commands operate on a host other than the default. We identify this host as OtherHost.

The host name you supply as a DefaultHost or an OtherHost takes the form Family:Host, where the host can be specified either by its name or by its network address. For example, ip:jeeves, ip:bertie, and ip:#192.5.5.5 are acceptable host names.

addrep OtherHost Adds OtherHost to the replica list at DefaultHost. The replica at DefaultHost will propagate OtherHost to all other replica lists for DefaultObj.
chrep -from OtherHost -to NewOtherHost Changes the network address for OtherHost in the replica list at DefaultHost to NewOtherHost. The replica at DefaultHost will propagate this change to all other replica lists for DefaultObj. The chrep command will fail if a replica of DefaultObj is running at OtherHost or if OtherHost is not on the replica list at DefaultHost.
delrep OtherHost Deletes the replica of DefaultObj at OtherHost. The delrep command tells the replica at OtherHost to:
  1. Propagate all of the entries in its propagation queue.
  2. Propagate a delete request to all other replicas, causing OtherHost to be deleted from all other replica lists for DefaultObj.
  3. Delete its copy of DefaultObj.
  4. Stop running.

The delrep command returns you immediately to the drm_admin prompt, but the actual deletion of the replica can take a long time in configurations that are not stable and intact. You can check whether the daemon for the deleted replica has stopped by listing the processes running on its host.

info Gets status information about the replica for DefaultObj at DefaultHost.
lrep [-d] [-clocks] [-na] Lists replicas for DefaultObj as stored in the replica list at DefaultHost.

-d
Lists deleted as well as existing replicas.

-clocks
Shows the current time on each host and indicates clock skew among the replicas.

-na
Lists the network address of each host.
merge {-from | -to} OtherHost Copies entries in the DefaultObj database and replica list from one replica to another. It copies an entry if no corresponding entry exists in the destination database or if the corresponding entry in the destination database bears an earlier timestamp.

A merge does not cause entries to be propagated. The database and replica list at the origination are not changed.

The -from option copies entries from the DefaultObj database and replica list at OtherHost to the DefaultObj database and replica list at DefaultHost.

The -to option copies entries from the database and replica list at DefaultHost to the database and replica list at OtherHost.

A merge -from followed by a merge -to causes the replicas at the two hosts to converge.

merge_all Uses DefaultHost as the hub for a global merge of all replicas for DefaultObj. For each host on the replica list at DefaultHost, a merge_all first does a merge -from, then does a merge -to. All replicas of DefaultObj are thereby forced into a consistent state. The merge_all operation does not cause any entries to be propagated.

You should do a merge_all when:

A replica is purged.

A replica is reset.

A replica has been inaccessible for two weeks or more.

A replica has become physically inaccessible (for example, when its database is destroyed by a disk failure)

monitor [-r n] This command causes drm_admin to read the clock of each replica of DefaultObj every n minutes and to report any clock skews or nonanswering replicas. If you do not specify -r, the period is 15 minutes.
purgerep OtherHost Purges OtherHost from the replica list at DefaultHost. The replica at DefaultHost then propagates a delete request to the replicas at the hosts remaining on its list, thereby removing OtherHost from all other replica lists for DefaultObj. The delete request is not sent to OtherHost.

A purgerep can cause data to be lost and should only be used when a replica has become physically inaccessible. You should do a merge_all operation after the purgerep to prevent the remaining replicas of the DefaultObj database from becoming inconsistent. If the purged replica is still running, it should be reset.

We recommend that you use chrep (rather than addrep and purgerep) to change entries on the replica list.

quit Quits the drm_admin session.
reset OtherHost Resets the replica of DefaultObj at OtherHost.

The reset command tells the replica at OtherHost to delete its copy of DefaultObj and to stop running. It does not cause OtherHost to be deleted from any other replica lists. This command can cause data to be lost unless a successful merge_all is done first.

set [-o ObjName] -h HostName Sets the default object and host. All subsequent commands will operate on ObjName. Subsequent commands that do not specify a host will be sent to HostName. If you do not specify the -o option, drm_admin keeps the current DefaultObj.

If you use set with the -o option, drm_admin checks the clocks at all hosts with replicas of the specified object.

stop Stops the server for DefaultObj that is running at DefaultHost.

Example

The following example starts drm_admin, sets the default object to GLB, and sets the default host to mars:

/etc/ncs/drm_admin drm_admin: set -o glb -h dds:mars
 Default object: glb default host: dds:mars
 state: in service
 Checking clocks of glb replicas
 dds:mars 1987/04/09.17:09
 dds:pluto 1987/04/09.17:09
 dds:mercury  1987/04/09.17:07

Related Information

The lb_admin command.

The glbd (NCS) daemon


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]