trifecta icon indicating copy to clipboard operation
trifecta copied to clipboard

Custom port not working

Open gitime opened this issue 7 years ago • 2 comments

Hi,

As described here https://github.com/ldaniels528/trifecta#configuring-trifecta-ui I have defined a custom port 9010 in /data/mybox/.trifecta/config.properties since I have another application listening in 9000. Even after changing config, still I am getting error that 9000 is in use.

Config:

trifecta.elasticsearch.hosts=localhost
trifecta.common.columns=25
trifecta.storm.hosts=localhost
trifecta.common.autoSwitching=true
trifecta.common.encoding=UTF-8
trifecta.common.debugOn=false
trifecta.zookeeper.host=localhost:2181
trifecta.cassandra.hosts=localhost 
trifecta.web.host=localhost
trifecta.web.port=9010

Error;

[info] play.api.Play$ - Application started (Prod)
Oops, cannot start the server.
org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:9000
        at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
        at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:132)
        at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:129)
        at scala.Option.map(Option.scala:146)
        at play.core.server.NettyServer.<init>(NettyServer.scala:129)
        at play.core.server.NettyServerProvider.createServer(NettyServer.scala:200)
        at play.core.server.NettyServerProvider.createServer(NettyServer.scala:199)
        at play.core.server.ServerProvider$class.createServer(ServerProvider.scala:24)
        at play.core.server.NettyServerProvider.createServer(NettyServer.scala:199)
        at play.core.server.ProdServerStart$.start(ProdServerStart.scala:58)
        at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
        at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
        at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

I am using trifecta-ui-0.22.0rc8b-0.10.1.0. How can I fix this?

Thanks.

gitime avatar Sep 18 '17 10:09 gitime

For me, it worked when I added

http.port=9999

in the PlayFramework application.conf file. I think Netty tries to open the default port even before the config.properties file is even read

jammann avatar Sep 27 '18 16:09 jammann

Note that this also applies to trifecta.web.host, that setting is ignored for the same reasons as trifecta.web.port. Like @jammann I found I could set it by adding the following to application.conf:

http.address="127.0.0.1"

vwesisolak avatar May 22 '19 14:05 vwesisolak