Remove members from a Liberty collective


Overview

We can use the collective utility remove command to remove a member server from a collective. The remove command unregisters the member server from the collective and removes member files that pertain to the collective. The remove command does not delete the member server or change the member server.xml file.

Administrators of a collective can add a server to the collective using the join command and, after the member server is no longer needed, remove the server from the collective using the remove command.

The remove command can remove a member server that does not exist. For example, the command can remove information about the member from the collective controller in the following situations:

  • If the member is deleted accidentally or intentionally

  • If deployment fails and the member is partially created or the member configuration contains errors, but the join command completed

Also, after the remove command runs, port values allocated by the member are released for reuse.

If the entire wlp/usr user directory on the member host was deleted, we might need to use a client such as JConsole to delete references to the member server from the collective.


Remove members

  1. Stop the member server...

      wlp/bin/server stop memberServerName

    Alternatively, On the member server host, keep the server running, but remove remove collective-related elements from server.xml:

  2. Remove the member server from the collective controller server.

    1. Run the collective remove command...

      For example...

        wlp/bin/collective remove member1 
            --host=machineA 
            --port=1090 
            --user=Admin1 
            --password=Admin1pwd

      Alternate syntax:

        wlp/bin/collective remove member1 
            --controller=Admin1:Admin1pwd@machineA:1090

      ...where...

        --host Name of the host on which the collective controller server resides. The defaultHostName variable in server.xml of the collective controller server sets the host name.
        --port HTTPS port number of the target collective controller. The httpsPort variable in server.xml of the collective controller server sets the port number.
        --user Administrative user of the target collective controller. A userName variable in server.xml of the collective controller server sets a user name.
        --password Password of the administrative user for the target collective controller. A userPassword variable in server.xml of the collective controller server sets a user password. If no password is defined, we are prompted for the password of the administrative user specified by the --user setting.

    2. If prompted to accept a certificate chain, enter y (yes).

      The remove command deletes the directory...

        wlp/usr/servers/member1/resources/collective

      The product prints messages resembling the following:

        Server member1 successfully unregistered.

        Attempting to remove resources for the collective from the server...
        The resources for collective membership were successfully removed.

        Please update the server.xml and remove any of the following elements:

        <featureManager>
            <feature>collectiveController-1.0</feature>
            <feature>collectiveMember-1.0</feature>
        </featureManager>
        <collectiveMember ... />
        <hostAuthInfo ... />

    3. To keep the server, complete all instructions in the messages.

      If we no longer need the server, delete...

        wlp/usr/servers/member1.

  3. If the entire wlp/usr user directory was deleted on the member host prior to running the remove command, delete any references to the removed member server from the collective using the delete operation on a client such as JConsole.

    1. Connect JConsole to the collective controller process.

      1. Ensure the collective controller is running.

          wlp/bin/server status collective_controller_name

      2. Start JConsole if it is not running.

          /java_installation/bin/jconsole.sh

      3. Select the process for the collective controller.

    2. Run the CollectiveRepository getDescendantData operation in JConsole to check for references to the removed member server.

      1. Go to the JConsole MBeans tab

      2. Select the CollectiveRepository getDescendantData operation and specify the name of the node on which the collective resides. The node name resembles...

          /sys.was.collectives/local/hosts/host_name

        For example

          /sys.was.collectives/local/hosts/machineA

      3. Look for references to the removed member server in the list of data. If the name of the removed member server is not in the list of data, then the server is no longer a member of the collective. The member was successfully removed from the collective.

        However, if references to the member exist in the data, proceed to the next step. We must run the delete operation to remove the member.

    3. Run the CollectiveRepository delete operation in JConsole to delete remaining references to the removed member server from the collective.

      1. On the JConsole MBeans tab, select the CollectiveRepository delete operation.

      2. For nodeName, specify the fully qualified node name of the member server we want to delete. The operation deletes the member server node and all nodes under it.

        The node name on a local process where the collective controller is on host machineA and the member path was C:\wlp\usr\servers\member1 on a Windows computer resembles:

          /sys.was.collectives/local/hosts/machineA/userdirs/C%3A%2Fwlp%2Fusr/servers/member1

      3. Click delete.

    4. To confirm that the server is no longer a member of the collective, repeat step 2b. Run the CollectiveRepository getDescendantData operation in JConsole and check for references to the removed member server.