markito / geode-docker

Apache Geode (incubating) Dockerfile
Apache License 2.0
23 stars 19 forks source link

docker-compose scale server has port issues #2

Closed nitin-amp closed 7 years ago

nitin-amp commented 8 years ago

Tried starting containers using docker-compose. Initial startup of locator and server works well, however, scaling of the cluster fails - error message below:

$ docker-compose scale server=3
WARNING: The "server" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Creating and starting 2 ... error
Creating and starting 3 ... error

ERROR: for 2  failed to create endpoint composer_server_2 on network bridge: Bind for 0.0.0.0:40404 failed: port is already allocated
ERROR: for 3  failed to create endpoint composer_server_3 on network bridge: Bind for 0.0.0.0:40404 failed: port is already allocated

Does this script require an update?

viacheslavtar commented 7 years ago

@nitin-amp I've faced this issue, and replacing "40404:40404" with "40404" in the docker-compose.yml file helped. I see that this value was changed back and forth earlier (504e6f8, eeabba7). I'm wrapping my head around Geode and this container, it would be great if @markito could provide more details about scaling and this port value.

nitin-amp commented 7 years ago

Yes, this may appear to be confusing. I've gone back and forth in my compose files as well.

If I may ask, what is your use-case?

markito commented 7 years ago

I've just replied on the geode@dev list but please let me know if you have more questions. Long story short, that port mapping on the docker just matter if your client is running outside of the container and if that's the case I don't know another way to scale with Compose and avoid the port conflict as well.

viacheslavtar commented 7 years ago

@nitin-amp thanks for the details! Sorry, use cases and evaluation scenarios are somewhat off topic.

@markito thank you, it definitely makes sense. With the latest commit scaling works, so this issue might be closed.