Updating the port of a controller

Use this task to change the port that is used by a single collective controller or a controller that is part of a replica set.

Before you begin

Create a collective with one or more controllers. See Configuring Liberty collective replica sets. The topic includes Example: Create and activate a replica set, an example of creating a replica set consisting of three collective controllers on the same host.

About this task

When you created a controller, you either specified a port number for it, or used the default value. For example, the following element in a controller server.xml file specifies a replica port of 10011:

<collectiveController replicaPort="10011"
                      replicaSet="localhost:10010"
                      isInitialReplicaSet="false" />

When a replica set contains only one controller, change the replicaPort value, adding the configuration element for it, if necessary. However, when the replica set has many controllers, you must stop a controller before you change its port. Also, a majority of controllers in the replica set must remain running, with the port unchanged, until after you successfully change the port of the stopped controller.

Procedure

  1. Stop the controller.

    If the controller is part of a multicontroller collective, ensure that most of the controllers remain running.

  2. Update the replicaPort attribute of the collectiveController element.

    When you update a single controller collective, or the initial controller in a multicontroller collective, add the collectiveController element with a replicaPort attribute, as demonstrated in the following example.

    <collectiveController replicaPort="44444" />

    It is not necessary to add other attributes to the collectiveController element.

  3. Restart the stopped controller.
  4. Check the messages.log file of the controller, and verify that it can communicate with the other controllers.

    Look for the CWWKX6011I message in the controller messages to see whether the controller synchronized correctly.