2

I am trying to add a new build agent on the build server (team city 6.5.5) - I was able to add a new agent but now the first one is disconnected and second one is running, I think there is some problem with the ownport & ServerURL that I have specified - So for my first one : name:abc ownPort=9090 serverUrl=http\://localhost\:xxxx

I tried giving another port other than xxxx, but it was not able to connect, only when i gave xxxx when adding the second agent it worked and thus replaced the old one..any help on how to changes these properties.

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
user1022521
  • 509
  • 3
  • 9
  • 16
  • I've got exactly the same problem right now. Am I right in thinking the 'bundled' build server is now not running, and all my projects have been transferred over to the newly installed build agent? Although I told the installer to install it as a Windows service, I still only get 1 build agent appearing in TC, and one service called 'TeamCity Build Agent Service'. I was expecting perhaps another service to appear somewhere. Incidentally, my new one has excactly the same 'name' property in buildAgent.properties, so I reckon there's a name clash. Have changed that and trying to restart them both – Richard Jan 26 '12 at 14:50
  • I've just noticed that only one seems to be able to run as a service. If I start A, and then start B (using the service.start.bat file), A will shut down as soon as B connects. So, I think for now I will use the 'agent.bat start' command to start mine. Doing this, I get 2 enabled build agents (woohoo). I suspect I would have 3 if I were to start the bundled agent too. I've got C:\BuildAgentA, C:\BuildAgentB, and C:\TeamCity\buildAgent now - that's three in total – Richard Jan 26 '12 at 15:01
  • Yeah, I've got 3 build agents! Make sure the name is unique in the buildAgent.properties file. And start them manually from a command line (works for me). And if one is building one project, and another project wants to build, it automatically distributes the builds across to one of the idle agents. TC is excellent. – Richard Jan 26 '12 at 15:08

2 Answers2

3

Don't change the port number in serverUrl, it should remain the same for all agents. Specify different ownPort in buildAgent.properties for each agent installation to run multiple agents on the same host. Also, I don't think you need to escape ':' symbol, http://localhost:xxxx is ok.

Default value:

ownPort=9090

Try to clean all build agents info on server. To do that, first stop every agent with agent.sh stop or agent.bat stop if on Windows. Then, to be sure, hunt and kill possible remaining agents' java processes with your process management tool of choice. After that all agents should have state 'disconnected' on the server. Press 'Remove Agent' button for each one.

Then, with the help of Build Agent Conf page, re-install your agents one by one, and keep your eye on them appearing on the server :)

sehe
  • 374,641
  • 47
  • 450
  • 633
Utgarda
  • 686
  • 4
  • 23
0

I had a problem getting more than one service to appear. I found the fix here:

https://www.placona.co.uk/1327/technology/new-teamcity-agents-the-right-way/

for each build agent -

enter unique information into each build agent launch configuration file( <build agent directory>\launcher\conf\wrapper.conf ) on the following lines

wrapper.ntservice.name=<Unique service name>
wrapper.ntservice.displayname=<unique display name>
wrapper.ntservice.description=<unique description>

cd into each buildagent's bin folder and run:

..\launcher\bin\TeamCityAgentService-windows-x86-32.exe -i ../conf/wrapper.conf

Note if you use -64 it probably will not start your service. If you have services.msc open when you run the command you will have to interact with another service to make the new ones appear. If you want to change a service you will have to delete the service and readadd it with something like:

sc.exe delete <service name here>
Jacob Brewer
  • 2,574
  • 1
  • 22
  • 25