An IBM Liberty cluster installation involves setting up multiple Liberty server instances to work together as a cohesive unit, known as a collective. This setup allows for centralized administration, monitoring, and application deployment, enabling efficient management of resources and ensuring high availability. A Liberty cluster can be used for various purposes, including load balancing, failover, and scaling applications to meet demand. This section provides a step-by-step approach to installing and configuring a Liberty cluster, covering essential aspects like downloading the software, setting up the environment, creating a collective, adding members, and deploying applications.
This section provides detailed instructions for installing and configuring an IBM Liberty collective on Linux and Windows systems. A collective in Liberty is a group of servers that work together for administration, monitoring, and scaling purposes.
Liberty installation steps
IBM Liberty is a lightweight, flexible application server. Follow these steps to download and install it.
Download IBM liberty
The above installation folder, /net/InfogixShare/igx, is called
<install_folder> throughout the rest of this section.
Install IBM liberty
- Extract the package. Tip: For Linux, use the following command, replacing
<version>with the specific version number of the downloaded package:unzip ibm-liberty-<version>-linux-x86_64.tar.gz -
Tip: For Windows, open Command Prompt and navigate to the extracted directory. Ensure that you have sufficient permissions to install software on your system.
- Verify the installation by checking the IBM Liberty installation directory and starting the server.
Create a collective
To create a collective in IBM Liberty, navigate to the installation directory and execute the following command:
-
Linux:
./server create collective -
Windows:
server create collective
This initializes a new collective, setting up a central management group of Liberty servers for streamlined administration and configuration.
Configure security
To configure security for a Liberty collective, you need to generate a collective configuration file. This file includes security settings and other configurations necessary for managing the collective. The command differs slightly depending on the operating system.
password with a
secure password of your choice and adjust the file paths as needed for your installation
environment. -
Linux:
./collective create collective --keystorePassword=password \ --createConfigFile=/opt/ibm/wlp/usr/servers/collective/collective.xml -
Windows:
collective.bat create collective --keystorePassword=password --createConfigFile=C:\IBM\Liberty\usr\servers\collective\collective.xml
Add to server.xml
For the collective server, include the collective configuration by adding the
following line in the server.xml file:
<include location="/path/to/collective/collective.xml" />
For example:
<include location="Z:/LibertyCluster/Libertyzip/wlp/usr/servers/collective/collective.xml" />
Modify collective.xml
Add
quickStartSecurity to collective.xml. Locate the
collective.xml file and edit it to include:
<quickStartSecurity userName="psu" userPassword="password" />
Start the Collective
After including the collective
location in the server.xml file of each server, follow these steps to
start the collective:
-
Linux:
./server start collective -
Windows:
server start collective
These commands initiate the collective, making it operational and ready for managing and administering the member servers.
Create and Add Members to the Collective
Create Member Server
server create <member_name>Join a Member to the Collective
To add the new member to the collective, use
the collective join command as shown
below:
Syntax:
collective join <member_name> \
--host=<collective_controller_host> \
--port=<collective_controller_port> \
--user=<collective_admin_user> \
--password=<collective_admin_password> \
--keystorePassword=<keystore_password> \
--createConfigFile=<LIBERTY_HOME>/wlp/usr/servers/<member_name>/member.xmlExample:
collective join member2 \
--host=us-r9-dq-igx02.syncdi1.us.syncsort.com \
--port=9443 \
--user=psu \
--password=password \
--keystorePassword=memberKSPassword \
--createConfigFile=/home/wlp/usr/servers/member1/member.xmlEnable the REST Connector for JMX API Access
To enable REST JMX API functionality,
add the REST connector feature to the member.xml
file:
<featureManager>
<feature>restConnector-2.0</feature>
</featureManager>Configure Administrative and Remote File Access
Add the following configuration to server.xml to allow
administrative access and remote file
management:
<!-- Basic Registry Configuration -->
<basicRegistry id="basic" realm="BasicRealm">
<user name="<WAS_ADMIN>" password="<WAS_PASSWORD>" />
</basicRegistry>
<!-- Administrator Role Configuration -->
<administrator-role>
<user><WAS_ADMIN></user>
</administrator-role>
<!-- Remote File Access Configuration -->
<remoteFileAccess>
<!-- Specific server directory access -->
<writeDir><LIBERTY_HOME>/wlp/usr/servers/<member_name></writeDir>
<readDir><LIBERTY_HOME>/wlp/usr/servers/<member_name></readDir>
<!-- Global servers directory access (optional) -->
<writeDir>/opt/Liberty/wlp/usr/servers</writeDir>
<readDir>/opt/Liberty/wlp/usr/servers</readDir>
<!-- Server config directory variable (optional) -->
<writeDir>${server.config.dir}</writeDir>
<readDir>${server.config.dir}</readDir>
</remoteFileAccess>${server.config.dir} variable due to known issues. The variable works
correctly on Windows platforms.Include Member Configuration in Server Configuration
Add the following include statement to your
server.xml file to include the member
configuration:
<include location="member.xml" /> Start Member Servers
Start each configured member server by running the following command:
server start <member_name> Verify the JMX REST API is enabled by accessing this URL:
https://<NODE_HOSTNAME>:<NODE_SECURE_PORT>/IBMJMXConnectorREST<NODE_HOSTNAME> and
<NODE_SECURE_PORT> with the correct values for your
environment.Final Configuration and Deployment
To finalize the setup of your Liberty collective, follow these steps for configuration validation, Liberty configuration, and application deployment.
- Extract the downloaded product builds. Run the following script to extract the files
to the installation folder:
- For Windows:
infogixextract.bat - For UNIX or Linux:
./infogixextract.sh
- For Windows:
- Execute
Init-configand choose option 2 (websphereLiberty) for appserver.
Validate Configuration Values
-
Linux:
./validate-config-values.sh -
Windows:
validate-config-values.bat
-
Linux:
./populate-db.sh <product> -
Windows:
populate-db.bat <product>
-
Linux:
./deploy.sh -
Windows:
deploy.bat
Configure WebSphere Liberty
-
Linux:
./config-websphere-liberty.sh -
Windows:
config-websphere-liberty.bat
Common Issues and Troubleshooting
Issue - Server not starting
Solution: Check the logs located in the logs directory of the
server for error messages. Ensure that all required environment variables are set
correctly, and that the system has sufficient resources.
Issue - Member not joining the collective
Solution: Verify that the correct host, port, user, and password are being used. Check network connectivity between the member and the collective host.
Issue - Security configuration errors
Solution: Double-check the quickStartSecurity credentials in
collective.xml and ensure they match the credentials used during the
join process.
This guide provides the necessary steps for setting up and configuring an IBM Liberty collective. For further customization and advanced configurations, refer to the official IBM WebSphere Liberty documentation: https://www.ibm.com/docs/en/was-liberty.