3

I am using this docker command for running graylog2.

docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

I want to run another graylog2 in same server and I run new command with different port numbers as

docker run -t -p 9001:9000 -p 12202:12201 graylog2/allinone

It's not working because of port conflict.

I am getting this error

Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:12900
maskapsiz
  • 244
  • 5
  • 23
  • I am getting Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:12900 error – maskapsiz Mar 25 '15 at 09:18
  • anyway I would add `--name=ports_9000` and `--name=ports_9001` or `--name=graylock1` or such to my run command, see the doc http://docs.docker.com/reference/commandline/cli/#run – user2915097 Mar 25 '15 at 09:19
  • Sorry, I didn't follow before. I don't understand the error though - where do you see the error and which container/port should it be connecting to? Why do you think there is a port conflict? – Adrian Mouat Mar 25 '15 at 09:47
  • 1
    you run with `-t` so you have a tty, but no `-i` "-i, --interactive=false Keep STDIN open even if not attached" so you do not have a stdin, you shoudl try running with `-it` – user2915097 Mar 25 '15 at 09:57
  • You need to include a lot more information. The error message you're giving says you're trying to connect to port `12900` which is not one of the ports you're binding two with the two containers. So...of course you can't connect? – Nathaniel Waisbrot Mar 25 '15 at 12:23
  • Thanks guys, The problem is solved. It's about firewall settings :) only port 9000 open to end users. By the way the error "Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:12900" still continue but it doesn't matter, it works. – maskapsiz Mar 25 '15 at 13:00

1 Answers1

2

Use docker run --name="new_name" -d imagename

Use different port for mapping from container to host or use host networking.

JBSnorro
  • 6,048
  • 3
  • 41
  • 62
Nishad A
  • 103
  • 1
  • 12