The Cargo Daemon is a Web-based application that uses the Cargo API to configure, start and stop containers on a remote machine.
The daemon is meant to be listening 24/7, to allow users to deploy new containers and web applications at their command.
It can be accessed using a browser-based UI, via Java API, Ant tasks or Maven 3 plugin.
Most web containers (e.g. Tomcat, Jetty) provide built-in remote deployment facilities already, also many of them already have daemon integrations; so why use the Cargo Daemon?
java.lang.OutOfMemoryError: PermGen space
exception if something in the web application is leaking memory.The documentation for the Cargo Daemon includes:
To install and run the Cargo Daemon:
java -jar cargo-daemon-webapp-<version>.war |
where <version>
is the version number of the daemon that you have downloaded.
By default, the Cargo Daemon will run on HTTP port 18000
. To change it, use the -p
option:
java -jar cargo-daemon-webapp-<version>.war -p 18001 |
Additionally, Cargo Daemon will save log files in the cargo home directory unless the -nologging
option is used.
Note that the Cargo Daemon is a WAR file; you can actually also deploy it as a WAR on any existing container. This can be useful if you want to, for example, reuse a certain security configuration.
The daemon also accepts other parameters, in the form of system properties:
Property name | Description | Mandatory? | Default value | |
---|---|---|---|---|
| Directory in which the standalone daemon server stores its files. These include the temporary files (such as its own WAR and server temporary files) as well as the server log files ( This property is not used and completely ignored if the daemon WAR file is deployed on an existing container. |
| ||
| Directory in which the daemon (be it standalone or deployed on an existing container) stores the list of containers, downloaded container archives, container logs, etc. |
Note that the standalone daemon by default sets this to | ||
cargo.daemon.passwordFile | Property file with username and passwords which would be allowed to access the Cargo Daemon:
Some examples:
Note: This functionality is new with Cargo Daemon version 1.10.11. | N/A |
To use the Cargo Daemon via the browser UI, simply open http://<machine>:<port>/
-where <machine>
is the machine host name or IP address and <port>
is the port number used (default is 18000
):
handle id
already exists then it will be stopped first before your container is started. This also implies that in case the new container fails to start, the old one will not be restarted.autostart
property, this will automatically restart the container if the daemon notices it is stopped.As stated before, the Cargo Daemon is also available programmatically:
To use the Daemon via Ant tasks, simply add the <daemon>
tag in the task and use the daemon-start or daemon-stop tasks:
<cargo containerId="tomcat7x" action="daemon-start"> <zipUrlInstaller installURL="https://repo.maven.org/maven2/org/apache/tomcat/tomcat/7.0.68/tomcat-7.0.68.zip" downloadDir="${basedir}/../../../../core/samples/java/installs" extractDir="${catalina.root}"> </zipUrlInstaller> <configuration home="${catalina.base}"> [...] </configuration> <daemon> <property name="cargo.daemon.handleid" value="test1"/> <property name="cargo.daemon.url" value="http://localhost:18000/"/> <property name="cargo.daemon.username" value="myuser"/> <property name="cargo.daemon.password" value="secret"/> </daemon> </cargo> |