On Mon, May 23, 2016 at 6:31 PM, Bruno Filippone <[email protected]> wrote:
> It seems to me that is smart enough after some testing, but the Akka > documentation suggests to use joinSeedNodes in a different manner: > > "You may also use Cluster(system).joinSeedNodes to join programmatically, > which is attractive when dynamically discovering other nodes at startup by > using some external tool or API. When using joinSeedNodes *you should not > include the node itself except for the node that is supposed to be the > first seed node*, and that should be placed first in parameter to > joinSeedNodes." (taken from > http://doc.akka.io/docs/akka/2.4.5/scala/cluster-usage.html) > > It seems like you can always specify the current selfAddress to setup the > cluster using joinSeedNodes even if the akka docs suggest to only include > the selfAddress for the first seed node of the cluster. > The node that is first in the list tries first to join to the other seed nodes. If that fails after retries and a timeout it will join itself to bootstrap the cluster. Safest if you know up front which one that should be the bootstrapper it is safest to do as the documentation says, but it can be convenient to use the same list on all nodes and that will also work except when you have a network partition when restarting the first. > > > Is this a documentation failure or should I be concerned about using > joinSeedNodes this way in production? > > > On Monday, 10 November 2014 07:14:48 UTC, Patrik Nordwall wrote: >> >> >> >> On Sat, Nov 8, 2014 at 12:11 AM, jxtps <[email protected]> wrote: >> >>> There >>> <https://groups.google.com/forum/#!searchin/akka-user/ec2$20seed$20nodes/akka-user/lBcl3WgEM_0/mocdn8-jmXsJ> >>> are >>> a >>> <https://groups.google.com/forum/#!searchin/akka-user/ec2$20seed$20nodes/akka-user/_1oc9aEfEJw/zye9BSVKFccJ> >>> number >>> <https://groups.google.com/forum/#!searchin/akka-user/ec2$20seed$20nodes/akka-user/-rwF3t_OF4I/soogf_uHLgsJ> >>> of threads >>> <https://groups.google.com/forum/#!searchin/akka-user/ec2$20seed$20nodes/akka-user/rKS9jnaFvv8/_1ulsZQvfX0J> >>> on how to deploy an akka cluster on ec2, and it seems straightforward to >>> establish the list of potential members of a cluster (e.g. get the members >>> in an auto scaling group, or a security group, or whatever), and these can >>> be sensibly ordered (e.g. by launch time with IP being a tie-breaker) such >>> that all hosts can agree on which one should be the "primary" seed node. >>> Cluster(system).joinSeedNodes(primary, >>> *[hosts other than current one]*) can then be used to get the cluster >>> going. So far so good. >>> >>> However, when the primary starts the application (after first launch, >>> code deploy, or reboot), it has no idea if there's already a cluster >>> running, or if it should indeed start a new cluster (keep in mind that a >>> cluster may recently have been running, but it may have been shut down in >>> the last 30 seconds so that helpful information you wrote to disk before >>> restarting may be terribly out of date). >>> >>> *Assuming there is no network partitioning*, i >>> *s Cluster(system).joinSeedNodes(myself, host2, host3, host4, ...) smart >>> enough to check for and join an existing cluster if the other hosts are >>> already running it, or does it always start a new one if the current >>> machine is the first entry?* >>> >> >> Yes, it is smart enough. It first tries to join the other nodes and only >> if that fails it will join itself. >> >> /Patrik >> >> PS. I assume that you have seen this blog post: >> http://chrisloy.net/2014/05/11/akka-cluster-ec2-autoscaling.html >> >> >>> Previous answers >>> <https://groups.google.com/d/msg/akka-user/rKS9jnaFvv8/lwW8pzLJ5xEJ> >>> have left this precise point a little ambiguous. >>> >>> If not, what are some best practices for how to have the intended seed >>> node start a new cluster if the cluster isn't running, but be smart enough >>> to join the existing cluster if it's already there? >>> >>> *I do not want to use any external dependencies (= zookeeper) other than >>> the AWS APIs from which I can get a canonical list of all the relevant >>> hosts. * >>> >>> >>> -- >>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>> >>>>>>>>>> Check the FAQ: >>> http://doc.akka.io/docs/akka/current/additional/faq.html >>> >>>>>>>>>> Search the archives: >>> https://groups.google.com/group/akka-user >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Akka User List" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> >> Patrik Nordwall >> Typesafe <http://typesafe.com/> - Reactive apps on the JVM >> Twitter: @patriknw >> >> -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Akka Tech Lead Lightbend <http://www.lightbend.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
