Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run multiple instances of TeamCity on the same server?

I am on Windows and trying to run multiple (currently two) instances of TeamCity on the same server. I chose not to install the Windows services and instead run the server via runAll.bat start command. When I ran the installer I chose different ports, names and paths for each one. The first server starts successfully, but the second one does not - I see the tomcat window showing up, but it's gone after a while, though the build agent window stays. Here's some output:

c:\Tools\TeamCity\bin>runAll.bat start
starting TeamCity server and agent...
Using CATALINA_BASE:   "c:\Tools\TeamCity\bin\.."
Using CATALINA_HOME:   "c:\Tools\TeamCity\bin\.."
Using CATALINA_TMPDIR: "c:\Tools\TeamCity\bin\..\temp"
Using JRE_HOME:        "c:\Tools\TeamCity\bin\..\jre"
Using CLASSPATH:       "c:\Tools\TeamCity\bin\..\bin\bootstrap.jar"
Starting TeamCity Build Agent Launcher...
Agent home directory is C:\Tools\TeamCity\buildAgent
Current JRE version is 1.6

c:\Tools\TeamCity\bin>cd c:\Tools\TeamCity2\bin

c:\Tools\TeamCity2\bin>runAll.bat start
starting TeamCity server and agent...
Using CATALINA_BASE:   "c:\Tools\TeamCity2\bin\.."
Using CATALINA_HOME:   "c:\Tools\TeamCity2\bin\.."
Using CATALINA_TMPDIR: "c:\Tools\TeamCity2\bin\..\temp"
Using JRE_HOME:        "c:\Tools\TeamCity2\bin\..\jre"
Using CLASSPATH:       "c:\Tools\TeamCity2\bin\..\bin\bootstrap.jar"
Starting TeamCity Build Agent Launcher...
Agent home directory is C:\Tools\TeamCity2\buildAgent
Current JRE version is 1.6
like image 761
Pawel Krakowiak Avatar asked Jun 07 '11 15:06

Pawel Krakowiak


1 Answers

You need to edit conf\server.xml for the second Tomcat/TeamCity instance so that it uses different ports or binds to different network interfaces, changing the following ports should be enough:

  • Server port="8005"
  • Connector port="8080"

Two servers cannot share the same database, so you must configure them to use different locations via TEAMCITY_DATA_PATH environment variable.

If you also want to run multiple agents on the same machine, refer to my answer here.

like image 178
CrazyCoder Avatar answered Sep 20 '22 00:09

CrazyCoder