-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Docker Hosts discovery #20
Comments
also did you read the README section on "Containerization (Docker) notes"? I.E. the Have you looked at just running your stuff in docker swarm mode w/ https://github.com/bitsofinfo/hazelcast-docker-swarm-discovery-spi ? Its way better way to go if running hz apps in docker, hazelcast has too many interface/binding issues when running in containers mentioned in numerous hazelcast issues. see below for how I did it |
i.e. what I had to do for a non-swarm docker host to docker host hz app setup was below. Its a chicken before the egg kind of issue.
|
Hi, Thanks for the quick replay, highly appreciated. currently we are trying to run this on AWS ECS, docker swarm isn't really an option we've considered. This is what consul returns for the nodes IP: curl http://10.0.1.160:8500/v1/catalog/service/hz-cluster { |
see my above comment, unfortunately again, see the hazelcast issues for "docker" and "this node is not requested endpoint" etc, tons of issues, complaints and outstanding todos on their end for all these stupid interface/binding issues. Some these SPIs tools I've made can make it all work |
Late to the party, but @dannygu I think you need to specify your Hazelacast public address IP and port in the
|
Hi, @bitsofinfo @bmudda Thanks for all the suggestions, i managed to get everything working by utilizing public-address option in hazelcast.xml I pull all of the information (host+randomPort) from AWS metadata before i bootstrap Hazelcast, works great. bottom line discover using consul and bootstrap with AWS = win. Thanks Again! |
great! please star the project if you found it useful! |
also @dannygu would be great if you could contribute a little PR w/ a markdown file describing a how-to w/ your use-case and solution |
Hi,
We have 2 hosts running several docker instances, we are trying to leverage consul to assist us in Hazelcast discovery.
I managed to get Hazelcast nodes listed In consul but seems as if HC refuses to connect:
12-Jul-2017 19:28:38.353 INFO [hz._hzInstance_1_docker_int.IO.thread-in-0] com.hazelcast.nio.tcp.TcpIpConnection.null [172.17.0.3]:5701 [docker_int] [3.8.3] Connect
ion[id=1, /172.17.0.3:42637->/172.17.0.6:5701, endpoint=[172.17.0.6]:5701, alive=false, type=MEMBER] closed. Reason: Connection closed by the other side
This somewhat makes sense - we have 2 hosts running at 10.0.1.160 and 10.0.2.71, our HC nodes are set to listen on port 5701 and map to a random port on the host, i.e 10.0.1.160:42637 -> 172.17.0.3:5701.
Not really sure why the nodes are trying to connect in their internal IP, this obviously wont work, each docker container is running on a different hosts and they cannot communicate between 172.17.0.3 to 172.17.0.6, they can only communicate between 10.0.1.160 to 10.0.2.71 which is the real host IP.
I switched org.bitsofinfo.hazelcast.discovery.consul.LocalDiscoveryNodeRegistrator to DoNothingRegistrator and used Regisrator to automatically register my nodes in Consul, this worked fine and got the correct IP and Port from consul but now HC is refusing to connect stating 'This node is not requested endpoint' since it's looking for 172.17.0.3:5701 but consul returned 10.0.1.160:randomport.
Is it even possible to make this work on 2 different hosts with random ports ?
Thanks for the help!
here is my configuration:
The text was updated successfully, but these errors were encountered: