DbGroupAdmin (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep.util

## Class DbGroupAdmin

- java.lang.Object
- - com.sleepycat.je.rep.util.DbGroupAdmin

-     public class DbGroupAdmin
      extends Object

  DbGroupAdmin supplies the functionality of the administrative class `ReplicationGroupAdmin` in a convenient command line utility. For example, it can be used to display replication group information, or to remove a node from the replication group.

  Note: This utility does not handle security and authorization. It is left to the user to ensure that the utility is invoked with proper authorization.

  See `main(java.lang.String...)` for a full description of the command line arguments.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DbGroupAdmin(String groupName, Set<InetSocketAddress> helperSockets)` Create a DbGroupAdmin instance for programmatic use.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dumpGroup()` Display group information.
    `static void` | `main(String... args)` Usage:
    `void` | `removeMember(String name)` Remove a node from the replication group.
    `void` | `transferMaster(String nodeList, String timeout)` Transfers the master role from the current master to one of the electable replicas specified in the argument list.
    `void` | `updateAddress(String nodeName, String newHostName, int newPort)` Update the network address for a specified node.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DbGroupAdmin

          public DbGroupAdmin(String groupName,
                      Set<InetSocketAddress> helperSockets)

      Create a DbGroupAdmin instance for programmatic use.
      Parameters:
        `groupName` - replication group name
        `helperSockets` - set of host and port pairs for group members which can be queried to obtain group information.

  - ### Method Detail

    - #### main

          public static void main(String... args)
                           throws Exception

      Usage:

           java {com.sleepycat.je.rep.util.DbGroupAdmin |
                 -jar je-<version>.jar DbGroupAdmin}
             -groupName <group name>  # name of replication group
             -helperHosts <host:port> # identifier for one or more members
                                      # of the replication group which can be
                                      # contacted for group information, in
                                      # this format:
                                      # hostname[:port][,hostname[:port]]*
             -dumpGroup               # dump group information
             -removeMember <node name># node to be removed
             -updateAddress <node name> <new host:port>
                                      # update the network address for a specified
                                      # node. The node should not be alive when
                                      # updating address
             -transferMaster [-force] <node1,node2,...> <timeout>
                                      # transfer master role to one of the
                                      # specified nodes.

      Throws:
        `Exception`

    - #### dumpGroup

          public void dumpGroup()

      Display group information. Lists all members and the group master. Can be used when reviewing the group configuration.

    - #### removeMember

          public void removeMember(String name)

      Remove a node from the replication group. Once removed, a node cannot be added again to the group under the same node name.

      `Secondary` nodes cannot be removed; they automatically leave the group when they are shut down or become disconnected from the master.

      Parameters:
        `name` - name of the node to be removed
      See Also:
        `ReplicationGroupAdmin.removeMember(java.lang.String)`

    - #### updateAddress

          public void updateAddress(String nodeName,
                           String newHostName,
                           int newPort)

      Update the network address for a specified node. When updating the address of a node, the node cannot be alive. See `ReplicationGroupAdmin.updateAddress(java.lang.String, java.lang.String, int)` for more information.

      The address of a `NodeType.SECONDARY` node cannot be updated with this method, since nodes must be members but not alive to be updated, and secondary nodes are not members when they are not alive. To change the address of a secondary node, restart the node with the updated address.

      Parameters:
        `nodeName` - the name of the node whose address will be updated
        `newHostName` - the new host name of the node
        `newPort` - the new port number of the node

    - #### transferMaster

          public void transferMaster(String nodeList,
                            String timeout)

      Transfers the master role from the current master to one of the electable replicas specified in the argument list.
      Parameters:
        `nodeList` - comma-separated list of nodes
        `timeout` - in same form as accepted by duration config params
      See Also:
        `ReplicatedEnvironment.transferMaster(java.util.Set<java.lang.String>, int, java.util.concurrent.TimeUnit)`

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.