I've recently been setting up multiple remote agents for Bamboo on the same machine to run as Windows service instances. Although there's information out there as to how this is achieved, I thought I'd document all the steps here for future reference.
Assumptions are that you have:
- Installed Bamboo on a server somewhere;
- Have another machine that you want to install remote agents on;
- This other machine can access the server over http;
- The other machine has java installed on it;
Under Bamboo Administation (cog in the top right), you should be able to choose Agents.
On this screen, there should be a button to Install remote agent
in the top right. Click it.
This screen gives you a link to download a jar package and a command to run to run the remote agent instance.
If you're installing multiple remote agents, you'll probably want them to all have separate and easily locatable home directories. Create some home directories somewhere, lets say in C:\Bamboo
. Go to the Install remote agent
link in a browser in your remote machine and download the java package.
Now, you're ready to run the remote agent instance using the command provided, which should be something like this:
java -jar atlassian-bamboo-agent-installer-X.X.X.jar http://server-address:8085/agentServer/
However, this will only run the remote agent in a command prompt and will use a pre-configured home directory. We want to install the agent as a service and use a custom directory.
This option specifies the custom home directory:
java
-Dbamboo.home=C:\Bamboo\agent-01-home
-jar atlassian-bamboo-agent-installer-X.X.X.jar http://server-address:8085/agentServer/
This suffix installs the agent as a service:
java -Dbamboo.home=C:\Bamboo\agent-01-home -jar atlassian-bamboo-agent-installer-X.X.X.jar http://server-address:8085/agentServer/
installntservice
So far so good, if you run this command you will get a remote agent installed as a service pointing to your custom home directory. However, running it a second time will result in an error, because the same service name is chosen each time. We need to re-name each service instance once it has been installed.
First, under C:\Bamboo\agent-01-home\bin
run UninstallBambooAgent-NT.bat
.
This uninstalls the service with its default name.
Then, edit C:\Bamboo\agent-01-home\conf\wrapper.conf
. At the end of this file, you'll find references to the name of the service. Modify these to a unique name.
Finally, re-install the service using C:\Bamboo\agent-01-home\bin\InstallBambooAgent-NT.bat
.
If you take a look at your local services, you should now have a service installed with the name you specified. You can now carry on installing additional agents as services as required.
Does this work the same on a linux machine?