Re: [jgroups-users] Eclipselink cache coordination with JGroups in Docker in AWS
Questions/problems related to using JGroups <[email protected]> Sat, 4 Feb 2017 17:09:09 +0100
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <[email protected]> |
When you attach to the docker container and/or run a shell, ifconfig lists the available NICs and you need to pick one of them, e.g. using match-interface or match-address. When multiple docker containers are started via beanstalk, can you netcat/telnet between them? I suggest run a 'nc -l 7500' on one of the containers and then 'nc <addr> 7500' on another to connect to the 'server' container. 'netstat -na |grep 7500' should then show you the addresses (NICs) that should be used. I don't know beanstalk and therefore don't know how it starts docker containers, so you need to find out how the containers can talk to each other (via TCP). Once this is done and works, pick the IP addresses used and inject them into the JChannel as TCP.bind_addr before calling JChannel.connect(), and this should work. Again, once the containers can talk to each other (which is a beanstalk/docker issue and not a JGroups issue), JGroups will work, too. On 03/02/17 21:05, Questions/problems related to using JGroups wrote: > Hi, thanks for your reply. I decided to go for the S3_PING as discovery > mechanism. Since I run the application in Docker, I'm under the impression > that I must bind to the IP-address of the host so that the other instances > can connect to it. In AWS the IP of the host can be found with the following > command: > http://169.254.169.254/latest/meta-data/local-ipv4 > I then use a sed command to stick the IP into the jgroups xml config file. > > Problem is that when I start up the application I get the following error: > Internal Exception: Exception [EclipseLink-22118] (Eclipse Persistence > Services - 2.6.1.v20150605-31e8258): > org.eclipse.persistence.exceptions.RemoteCommandManagerException > Exception Description: Failed to create JGroups connection using config > file: /usr/local/glassfish4/glassfish/domains/domain1/config/jgroups.xml > Internal Exception: java.net.BindException: [TCP] /172.31.41.16 is not a > valid address on any local network interface. Please see server.log for more > details. > Command deploy failed. > > I understand that since 172.31.41.16 is the IP of the host but not bound to > any local network interface on the container jgroups cannot bind to it, but > I have no clue how to resolve this. Is it any way around it ? > > When I run my container on my local machine it works if I run docker with > --net="host" so that the container > uses the host's networks stack, but in AWS Elastic Beanstalk I don't think I > have that option. > > Regards > Steinar > > > > -- > View this message in context: http://jgroups.1086181.n5.nabble.com/jgroups-users-Eclipselink-cache-coordination-with-JGroups-in-Docker-in-AWS-tp11257p11268.html > Sent from the JGroups - General mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > javagroups-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/javagroups-users > -- Bela Ban, JGroups lead (http://www.jgroups.org) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot