Elastic agent supervisor

Elastic agents use the agent supervisor for monitoring the agent process. If an elastic agent crashes, the supervisor will automatically attempt to restart it, and the agent will try to reconnect to a Bamboo node.

The elastic agent supervisor is an implementation of the Java Service Wrapper, the same as the remote agent supervisor. For more information about the supervisor, see remote agent supervisor.

All Java Service Wrapper files are downloaded together with the elastic agent bootstrap files from an S3 bucket provided by Atlassian during an elastic instance startup. The elastic agent installer automatically installs the Java Service Wrapper on the elastic instance.

If you use a custom elastic image that was created before Bamboo 8.0, you must recreate it with the new version of the atlassian-bamboo-agent-elastic-installer.jar on it in order to use the Elastic agent supervisor.

Configuring wrapper properties

The elastic agent process is executed by the Java Service Wrapper installed on the elastic instance and is controlled by various settings defined in the wrapper.conf file. The file is created by the elastic agent startup script.

Wrapper configuration properties can't be modified once the agent is running. However, you can override them by passing wrapper properties to the elastic agent Installer. You can override any of the Java Service Wrapper properties.

Elastic agent startup scripts provided in the atlassian-bamboo-elastic-image use a dedicated WRAPPER_PROPERTIES variable that can carry one or multiple properties and is passed to the elastic agent startup command as follows:

Unix, Linux
java -Dbamboo.agent.syncOnly ${WRAPPER_PROPERTIES:-} -jar $bambooAgentBin/*installer*.jar
"%JAVA_HOME%/bin/java" %WRAPPER_PROPERTIES% -jar C:\opt\bamboo-elastic-agent\bin\atlassian-bamboo-agent-elastic-installer.jar

You can set the WRAPPER_PROPERTIES variable in an elastic image startup script. For example, to increase the initial and maximum Java heap size, use the following scripts:

Unix, Linux
sudo su -c "echo \"export WRAPPER_PROPERTIES='\"-Dwrapper.java.maxmemory=2048\" \"-Dwrapper.java.initmemory=512\"'\" >> /etc/profile.d/bamboo.sh"
powershell.exe -Command "[System.Environment]::SetEnvironmentVariable(\"WRAPPER_PROPERTIES\", '\"-Dwrapper.java.maxmemory=2048\" \"-Dwrapper.java.initmemory=512\"', 'Machine')"

Values containing spaces can cause problems and the best way to avoid them is to use a \"key=value\" syntax (in quotes escaped with backslashes). For example, to set the maximum amount of memory for the JVM to 2048 MB, use:


最終更新日 2022 年 11 月 23 日


Powered by Confluence and Scroll Viewport.