JBoss Community Archive (Read Only)

JBoss Cloud Access

Deploy your application

To deploy your own application, it is recommended to insert the necessary user data while launching an instance. If you start with the user data for deploying the included sample application, you could remove the `cp' command that deploys the app to the application server and instead use the wget command to download your application from a trusted and secured with SSL remote web server (e.g. your S3 storage).

Customizing the deployment

The deployment of your application may be more complex than copying a WAR file to the deployment directory, requiring further customization. The recommended method of customizing an instance and deploying your application is to use the instance's User Data field. If you need to apply changes later, it is preferable to stop the running instance and start a new instance with updated user data. Make sure to carry over any important files from old instance to the new instance if needed. The reasons for this recommendation are:

  1. no manual intervention is needed after instance launch;

  2. it's independent of the instance itself;

  3. multiple instances with exactly the same configuration can be deployed by copying the same text into the User Data field;

    1. allows much easier scaling of running instances

    2. allows you to easily create test instances to try out any changes before they go in production

  4. the standard text to be pasted into the User Data field can be maintained in a version control system, providing a history of changes for audit purposes and back-up.

The contents of the User Data field are treated slightly differently depending on the platform. On JBoss Enterprise Web Server the contents are treated as a script. If the first line begins with "#!" it is run as a standalone script but if not, it's called from the Red Hat Enterprise Linux init script. On JBoss Enterprise Application Platform, the use of the User Data field's contents allows for flexible configurations via the use of shell variables.

The User Data field can be used to download and execute a standard customization script:

## set up a secure communications channel with the remote server if its certificate not already trusted
cat > mycertificate.crt << "EOF"
<Paste your certificate here. Using a custom certificate is only needed if using self-signed certificates or the certificate authority is not recognized>
EOF
## download customization script
wget --user=myuser --password=mypassword --ca-certificate=mycertificate.crt https://<remote-host>/myscript.sh
## execute customization script
. myscript.sh
The contents of the User Data field are processed on every boot, so it's important to take into account that commands may be duplicated. The AMIs are configured so that the parameters which affect JBoss Enterprise Application Platform, also the JBoss Operations Navigator agent's configuration are set only once. If you have personal customizations to be made and don't want these duplicated, you could use a flag file in the User Data field or your customization script:

if [ -f /etc/sysconfig/my_script_executed ]; then
    exit # configuration has already been done
fi
<customization-commands>
touch /etc/sysconfig/my_script_executed

Appendix 1 provides details of parameters which can be used to:

  • To Configure the JBoss Enterprise Application Platform AMI;

  • To Change the JBoss Enterprise Application Platform's startup script;

  • In your own customization script or the User Data field.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 09:48:22 UTC, last content change 2012-05-22 15:26:01 UTC.