Elastic Agent supervisor

Starting from Bamboo 8.0, Elastic Agents are using the agent supervisor for monitoring the agent process. If an elastic agent crashes, the Elastic Agent supervisor will automatically attempt to restart it, and the Elastic 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 Service Wrapper files are downloaded together with Elastic Agent bootstrap files from an S3 bucket provided by Atlassian during an Elastic Instance startup. The Elastic Agent Installer automatically installs the Service Wrapper on the Elastic Instance.

If you use a custom Elastic Image that has been 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 Elastic Instance and controlled by various settings defined in the wrapper.conf file. The file is created during Elastic Agent startup once the startup script is executed.

Wrapper configuration properties cannot be modified once the agent is running. However, they can be overridden 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 variable WRAPPER_PROPERTIES that can carry one or multiple properties and is passed to the Elastic Agent startup command.

Elastic Agent startup command on Linux...
java -Dbamboo.agent.syncOnly ${WRAPPER_PROPERTIES:-} -jar $bambooAgentBin/*installer*.jar

Elastic Agent startup command on Windows...
"%JAVA_HOME%/bin/java" %WRAPPER_PROPERTIES% -jar C:\opt\bamboo-elastic-agent\bin\atlassian-bamboo-agent-elastic-installer.jar

The WRAPPER_PROPERTIES variable can be set up in an Elastic Image startup script in Bamboo. For example, to increase the initial and maximum Java heap size use the following scripts:

  • Linux

    sudo su -c "echo \"export WRAPPER_PROPERTIES='\"-Dwrapper.java.maxmemory=2048\" \"-Dwrapper.java.initmemory=512\"'\" >> /etc/profile.d/bamboo.sh"
  • Windows 

    powershell.exe -Command "[System.Environment]::SetEnvironmentVariable(\"WRAPPER_PROPERTIES\", '\"-Dwrapper.java.maxmemory=2048\" \"-Dwrapper.java.initmemory=512\"', 'Machine')"

    Values which contain spaces can cause problems and the best practice is to include “key=value” pair in quotes escaped with backslashes. To set maximum memory for JVM to use to 2048Mb use:

    \"-Dwrapper.java.maxmemory=2048\"



Last modified on Jul 30, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.