Re: [jgroups-users] Eclipselink cache coordination with JGroups in Docker in AWS
Questions/problems related to using JGroups <[email protected]> Tue, 7 Feb 2017 17:18:47 +0100
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <[email protected]> |
I have an AWS account. If you could provide me a simplified/stripped-down image of the docker container, I could test this myself. I don't think I need beanstalk, but a simple way to run 2 containers would do. Perhaps instructions to set this up, as I haven't touched AWS for years... :-) On 06/02/17 22:22, Questions/problems related to using JGroups wrote: > Hi, I tested with two instances in Elastic Beanstalk. Problem is that > they actually get the same IP on the eth0 interface. I'm pretty sure > they would be able to communicate over the IP of their host as long as > the port is forwarded but I guess jgroups won't accept that since that > IP isn't bound to any NIC in the container ? > > Regards > Steinar > > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN > group default qlen 1 > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 > inet 127.0.0.1/8 <http://127.0.0.1/8> scope host lo > valid_lft forever preferred_lft forever > inet6 ::1/128 scope host > valid_lft forever preferred_lft forever > 4: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue > state UP group default > link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff > inet 172.17.0.2/16 <http://172.17.0.2/16> scope global eth0 > valid_lft forever preferred_lft forever > inet6 fe80::42:acff:fe11:2/64 scope link > valid_lft forever preferred_lft forever > > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN > group default qlen 1 > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 > inet 127.0.0.1/8 <http://127.0.0.1/8> scope host lo > valid_lft forever preferred_lft forever > inet6 ::1/128 scope host > valid_lft forever preferred_lft forever > 12: eth0@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue > state UP group default > link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff > inet 172.17.0.2/16 <http://172.17.0.2/16> scope global eth0 > valid_lft forever preferred_lft forever > inet6 fe80::42:acff:fe11:2/64 scope link > valid_lft forever preferred_lft forever > > 2017-02-04 17:09 GMT+01:00 JGroups - General mailing list [via JGroups] > <[hidden email] </user/SendEmail.jtp?type=node&node=11270&i=0>>: > > 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 > <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 > <http://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 > <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 > > [hidden email] <http:///user/SendEmail.jtp?type=node&node=11269&i=0> > > https://lists.sourceforge.net/lists/listinfo/javagroups-users > <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 > _______________________________________________ > javagroups-users mailing list > [hidden email] <http:///user/SendEmail.jtp?type=node&node=11269&i=1> > https://lists.sourceforge.net/lists/listinfo/javagroups-users > <https://lists.sourceforge.net/lists/listinfo/javagroups-users> > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://jgroups.1086181.n5.nabble.com/jgroups-users-Eclipselink-cache-coordination-with-JGroups-in-Docker-in-AWS-tp11257p11269.html > <http://jgroups.1086181.n5.nabble.com/jgroups-users-Eclipselink-cache-coordination-with-JGroups-in-Docker-in-AWS-tp11257p11269.html> > > To unsubscribe from [jgroups-users] Eclipselink cache coordination > with JGroups in Docker in AWS, click here. > NAML > <http://jgroups.1086181.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > > > > > ------------------------------------------------------------------------ > View this message in context: Re: [jgroups-users] Eclipselink cache > coordination with JGroups in Docker in AWS > <http://jgroups.1086181.n5.nabble.com/jgroups-users-Eclipselink-cache-coordination-with-JGroups-in-Docker-in-AWS-tp11257p11270.html> > Sent from the JGroups - General mailing list archive > <http://jgroups.1086181.n5.nabble.com/JGroups-General-f3.html> 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