TeamCity - multiple agents on ONE MACHINE? Possible?
Asked Answered
P

1

36

Coming "from" TFS and using TeamCity in a customer project....

...is there a way to install multiple agent instances on one computer? I could easily do that with TFS.

The reason is that we have build scripts that are linear in execution for some (large) part and take a significant amount of time. Basically with a a modern server (4, 6, 8, 12 cores) there is nothing stopping the server from actually efficiently running multiple builds AT THE SAME TIME - except there seems to be no way to install multiple agent instances on one machine.

Posehn answered 2/12, 2010 at 10:35 Comment(1)
possible duplicate of Running multiple TeamCity Agents on the same computer?Barbed
M
59

Yes it is possible (I also have 2 agents installed on one machine) see TeamCity docs:

Several agents can be installed on a single machine. They function as separate agents and TeamCity works with them as different agents, not utilizing the fact that they share the same machine.

After installing one agent you can install additional one, providing the following conditions are met:

  • the agents are installed in the separate directories
  • they have distinctive work and temp directories
  • buildAgent.properties is configured to have different values for name and ownPort properties

Make sure, there are no build configurations that have absolute checkout directory specified (alternatively, make sure such build configurations have "clean checkout" option enabled and they cannot be run in parallel).

Under Windows, to install additional agents as services, modify \launcher\conf\wrapper.conf to change:

  • wrapper.console.title,
  • wrapper.ntservice.name
  • wrapper.ntservice.displayname
  • wrapper.ntservice.description

properties to have distinct name within the computer.

More resources:

another question

excellent post

Muskrat answered 3/12, 2010 at 16:53 Comment(2)
I am glad the excellent post has helped some people. However, following the directions in it ruined my existing service. Even after a complete uninstall of both services, deleting the two directories, and reinstalling only the original service, it still won't run some jobs that were working fine before I started all this. I highly recommend the solution from the top-voted answer in the question that this one is a duplicate of.Rattle
It's good to be advise that you may have an issue with the new agent after installing it, an error like "Teamcity agent in disconnected state (Agent has unregistered (will upgrade))". This can be solved stopping the fisrt agent(or the other agents installed) and restarting the new from the services (on Windows/Windows Server). This will set your new agent from Disconnected to Connected.Rorry

© 2022 - 2024 — McMap. All rights reserved.