I'm trying to run 2 different servers on the same machine under different ports. This is necessary to simulate a development and production environment without increasing hardware costs. However I get the following error when the 2nd server is started. I should mention that the servers are running on a Linux box. It also seems to be impossible to connect the admin tools to a server that isn't running under the default port of 9933.
14:35:34,334 INFO [main] api.SFSApi - Room created: [ Room: The Lobby, Id: 4, Group: default, isGame: false ]
14:35:34,352 DEBUG [main] Extensions - {Admin}: Admin Extension started
14:35:34,354 INFO [main] api.SFSApi - Room created: [ Room: AdminRoom, Id: 5, Group: default, isGame: false ]
14:35:34,362 INFO [main] core.AdminToolService - AdminTool Service started
14:35:36,036 ERROR [main] v2.SmartFoxServer -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.net.BindException
Message: Address already in use
Description: Unexpected error during Server boot. The server cannot start.
Solution: Please email us the content of this error message, including the stack trace to support@smartfoxserver.com
+--- --- ---+
Stack Trace:
+--- --- ---+
sun.nio.ch.Net.bind(Native Method)
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:77)
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
org.mortbay.jetty.Server.doStart(Server.java:235)
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
com.smartfoxserver.v2.http.SFSHttpServer.start(SFSHttpServer.java:93)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:197)
com.smartfoxserver.v2.Main.main(Main.java:31)
Issues running multiple servers on the same machine
-
peter.dalton
- Posts: 11
- Joined: 10 Aug 2010, 21:51
-
peter.dalton
- Posts: 11
- Joined: 10 Aug 2010, 21:51
I have configured the two server instances separately. Both are set to use the same IPs however one is on port 9933 and the other is on port 9940, however I get the error reported. I have also configured the admin tool to use port 9940 however I still can't connect. After numerous tests it is my belief that the admin tool can not connect to anything not using the default port of 9933.
I think the bind error you are seeing is caused by the embedded Jetty webserver which runs on port 8080 and that must be configured separately.
You have two options. Either turn the webserver off or configure it so that it uses a free TCP port, maybe 8081 or so.
This is done by editing config/jetty/jetty.xml
Search for "8080" and substitute it with a free port number
You have two options. Either turn the webserver off or configure it so that it uses a free TCP port, maybe 8081 or so.
This is done by editing config/jetty/jetty.xml
Search for "8080" and substitute it with a free port number
-
peter.dalton
- Posts: 11
- Joined: 10 Aug 2010, 21:51