Example: Creating a collective and installing a simple application
CreateCollectiveSampleApp.zip file contains an example IBM UrbanCode Deploy application that creates a WebSphere Liberty collective and deploys a simple web application to the servers in the collective. The sample application runs processes to complete the following tasks:
- Create a Liberty server and collective.
- Register a target host with the collective.
- Upload a Liberty package file to the registered host.
- Join Liberty member servers from the package file to the collective.
- Start collective member servers.
- Deploy a simple application to the collective servers.
The example IBM UrbanCode Deploy application assumes that you have two hosts. One host (the collective controller host) must be running the IBM UrbanCode Deploy agent software and also must have WebSphere Liberty installed.
See this example in action in a video: Create a WebSphere Liberty collective and deploy applications using UrbanCode Deploy.
After you import the example application archive, complete the following steps.
- Create a top-level resource directory, and then add the agent that is running on the collective controller host to the new top-level resource.
- Add the WebSphereLiberty and HelloWorld components under the agent, as shown in the following screen capture:
- Go to the Test environment of the ConfigureLibertyCollective application, and then click Add Base Resources to add the new resource tree as the base resource of the Test environment, as shown in the following screen capture:
- Set the environment properties for the Test environment so that the values are correct for your specific environment. Change the values for all properties other than the Collective Controller Hostname, Controller Name, and Controller Port properties. Click the Configuration tab for the Test environment, and then click Environment Properties to set the values. After you enter all of the property values, click Save.
- You can now run the CreateConfigureDeployCollective application process on the Test environment. In the Run Process window, select the Version1 snapshot.
The process runs and installs the HelloWorld application to the member servers of the Liberty collective. Browse to the following URLs to see the output of the HelloWorld applications. The application output is “Hello Tom.”
You can also see information about the new collective by adding the Liberty Admin Center feature to the
server.xml file for the controller1 server. On the collective controller host, add the following line to the
Browse to the following URL to access the Liberty Admin Center:
Log in to the Liberty Admin Center. For the sample application, the default administrator ID is
admin and the default password is
adminpwd. Click the Explore icon and to display the applications, servers, and other information that is associated with the collective that the sample application created.