Removing members from a Liberty collective

You 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.

About this task

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, you might need to use a client such as JConsole to delete references to the member server from the collective.

Procedure

  1. Stop the member server or remove collective-related elements from the member server configuration.
    To stop the member server, run the server stop command at a command line:
    wlp/bin/server stop memberServerName
    If you want to keep the member server running, remove any of the following elements from the server.xml file of the member server:
    <featureManager>
       <feature>collectiveController-1.0</feature>
       <feature>collectiveMember-1.0</feature>
    </featureManager>
    <collectiveMember ... />
    <hostAuthInfo ... />
  2. Use a command line to remove a member server.
    1. Run the collective remove command at a command line.
      wlp/bin/collective remove memberServerName --host=collectiveControllerHost --port=collectiveControllerHTTPSPort --user=collectiveControllerAdminUserID --password=collectiveControllerAdminUserPassword

      To reduce the number of options needed, use the --controller option instead of --user, --password, --host, and --port:

      wlp/bin/collective remove memberServerName --controller=collectiveControllerAdminUserID:collectiveControllerAdminUserPassword@collectiveControllerHost:collectiveControllerHTTPSPort

      For example, for a collective controller on host machineA that uses port 1090 and that has a collective controller administrative user Admin1 with password Admin1pwd and member server member1, run the following command to remove the member server:

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

      To reduce the number of options needed, use the --controller option instead of --user, --password, --host, and --port:

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

      This example includes the required settings for the remove command:

      --host=collectiveControllerHost
      The host setting specifies the name of the host on which the collective controller server resides. The defaultHostName variable in the server.xml file of the collective controller server sets the host name.
      --port=collectiveControllerHTTPSPort
      The port setting specifies the HTTPS port number of the target collective controller. The httpsPort variable in the server.xml file of the collective controller server sets the port number.
      --user=collectiveControllerAdminUserID
      The user setting specifies an administrative user of the target collective controller. A userName variable in the server.xml file of the collective controller server sets a user name.
      --password=collectiveControllerAdminUserPassword
      The password settings specifies the password of the administrative user for the target collective controller. A userPassword variable in the server.xml file of the collective controller server sets a user password. If no password is defined, you 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 wlp/usr/servers/member1/resources/collective directory. 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. If you want to keep the server, complete all instructions in the messages. For example, remove the elements listed in the messages from the server.xml file of the removed member server.

      If you no longer need the server, delete the server directory. For example, 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. On Windows, run Java_installation\bin\jconsole.exe.
      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. On the JConsole MBeans tab, 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.
      2. 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. You 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 that you 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.