In this blog series we will present several ways to deploy an application on an EAP Domain. The series consists of five parts. Each one will be a standalone article, but the series as a whole will present a range of useful topics for working with JBoss EAP. In the part one, we set up a simple EAP domain with the following topology:
In part two we reviewed the EAP management console deployment mechanism, and deployed the helloworld-html5 EAP Quickstart on the main-server-group ( Server11 and Server21).
When it comes to interactions with a continuous deployment software factory, however, we need more powerful and flexible tools to organize the build and deployment process — the management console is not a good fit for build automation.
To solve this problem, JBoss EAP provides users with both a CLI tool and a simple REST API to perform complex administration tasks.
In this blog, we will use the EAP CLI to deploy the helloworld-html5 Application on the secondary-server-group.
Remember, from parts one and two, that the management CLI is available through the native management interface configured in host-master.xml on 127.0.0.0:9999.
Prior to EAP 7.0, you needed your EAP instance / controller to be up and running before connecting and interacting with the CLI, but EAP 7.0 brings a new feature called the offline management CLI. This means you don’t need the server to be started in order to use the CLI (learn more about the Offline CLI). The deploy command, however, still requires a connection to the controller.
Make sure your domain and hosts controllers are started, then run the following commands:
/jboss-cli.sh --connect --controller=127.0.0.1:9999
You are now connected to the CLI and can check the existing deployments in the domain repository:
[email@example.com:9999 /] deploy -l
jboss-helloworld-html5.war is deployed on the primary-server-group, and you can verify this by checking the deployment info of the group:
[firstname.lastname@example.org:9999 /] deployment-info --server-group=primary-server-group
NAME RUNTIME-NAME STATE
jboss-helloworld-html5.war jboss-helloworld-html5.war enabled
[email@example.com:9999 /] deployment-info --server-group=secondary-server-group
NAME RUNTIME-NAME STATE
jboss-helloworld-html5.war jboss-helloworld-html5.war not added
Now we can add the jboss-helloworld-html5.war deployment on our secondary server group, with the following command:
[firstname.lastname@example.org:9999 /] deploy --name=jboss-helloworld-html5.war --server-groups=secondary-server-group
With the —name option, the deployment is located in the EAP content repository, if you want to specify another file location you can just use the –file_path option and remove —name.
Congratulations! The deployment is now active on server 12 (HTTP 8280) and server 22 (HTTP 8480). In the next section (part four) we will see how to perform deployments using the REST Management API.
Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development. The developer program and software are both free!
Download and learn more about Red Hat JBoss Fuse, an innovative modular, cloud-ready architecture, powerful management and automation, and world class developer productivity. It is Java™ EE 7 certified and features powerful, enterprise-grade features such as high availability clustering, distributed caching, messaging, transactions, and a full web services stack.