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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With