meltmedia / jgroups-aws

An AWS Discovery Component for JGroups
http://meltmedia.github.com/jgroups-aws
Apache License 2.0
44 stars 25 forks source link

Support cross-region node discovery #20

Open mogarg opened 6 years ago

mogarg commented 6 years ago

I am running the demo on 2 nodes in different regions with a user with full EC2 access and security group with a configuration of all inbound and outbound traffic. Also, I have given the nodes tags with the same key.

<com.meltmedia.jgroups.aws.AWS_PING
     port_number="7800"
     tags = "Application"
     access_key="**"
     secret_key="****"/>

The tag has the same value on both the nodes. Is this a problem with the chat demo or is this a problem with the AWS discovery?

screen shot 2017-12-23 at 10 28 29 pm
sorrachai commented 6 years ago

Same problem here; I can get them to talk only in the same region. is it possible to make it work for different regions.

ctrimble commented 6 years ago

As far as I am aware, the demo should be working. Thank you for raising this issue. I will spin up the demo and see if I can figure out what is wrong. Just to be clear, you state that the instances have matching tag keys, but do they have matching tag key/value pairs? In this case, are the values for the tag Application all the same? Edit: Reread the comment and noticed that you provided this information.

mogarg commented 6 years ago

Same as @sorrachai. Can only get them to talk in the same region. I tried this after I discovered a comment in the source code which states that the instances have to be in the same region. I checked the Amazon Java SDK, and it does provides describeTag information across regions. Can we have this as a feature request please?

ctrimble commented 6 years ago

@mogarg and @sorrachai thank you for the details. It is good to know that the demo works in the same region. This seems like a feature request, instead of a bug. I am going to update the title and description so that this issue is focused.

I would be happy to support a PR to get this working the way you want, but I don't know if I have the time to dev and test a solution for you. Would either of you like to take a stab at this?

ctrimble commented 6 years ago

Just did a quick read to refresh my memory on the exact limitations here. We probably picked this limitation up from the way that security group rules work in EC2 Classic.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html#security-group-rules

ctrimble commented 6 years ago

It seems like a reasonable way to implement this would be to execute an ec2:describeRegions call or have the user provide a list of regions, and then run the ec2:describeInstances queries against all the regions in parallel.

NOTE: I also read the ec2:describeTags call and it does not return the information that is needed to configure the cluster.

Reference: