kyleaa / libcluster_ec2

MIT License
96 stars 38 forks source link

I couldn't make it work (Killed) #26

Closed tiagodavi closed 2 years ago

tiagodavi commented 3 years ago

Hey Guys. I was playing with it and I couldn't make it work. I think is due to my EC2 instance memory that is too low (t2micro). My application is being killed during compilation and I can't even test it.

iex --sname n1 --cookie aws -S mix
==> poison
Compiling 4 files (.ex)
Killed

I would like to know if you guys know if it's possible to connect two or more nodes on EC2 by using Epmd or Gossip Strategy? I tried many times with those two strategies without any success either; Do you have some article that shows how to do it with Epmd or Gossip for EC2 instances? I couldn't find something specifically for that.

I also noticed someone said there's a video on ElixirConf that shows how to use uselibcluster_ec2 Do you guys have the link for this specific video?

Thank you;

kyleaa commented 3 years ago

libcluster_ec2 is a discovery strategy, to help with cluster discovery. It calls the EC2 API to find instances with defined characteristics and then attempts to connect. EPMD takes a static list of nodes, and Gossip uses UDP multicast. Gossip should definitely work just fine in EC2, I have less experience with how VPCs handle multicast.

I agree with your assessment that your instance is terminating the compile, and doesn't appear to be related to the library. Assuming your application is not resource intensive, you may try compiling it on a larger instance and then copying the compiled code to your micro instance. This should work fine if you're using the same AMI for each.

I'd recommend starting with two instances and using barebones communication (eg https://elixirschool.com/en/lessons/advanced/otp-distribution/) to confirm your VPC is set up correctly to allow communication between nodes.

I was not aware of the ElixirConf talk mentioned, but I think it is https://www.youtube.com/watch?v=gsnjstLQigQ - thanks for the tip! :-)

tiagodavi commented 3 years ago

Thank You Kyleaa. Coincidentally. The author of this talk works in my team haha. I was just playing with it to see if I could connect two ec2 instances by using simple strategies such as EPMD, Gossip, but after testing many times, opening ports etc I couldn't make it work so I am assuming is not that simple.