Skip to content

A Peerage provider for easy clustering on AWS EC2 and Elastic Beanstalk

Notifications You must be signed in to change notification settings

dylanfareed/peerage_ec2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peerage EC2 Provider

Peerage helps your nodes find each other.

It supports DNS-based discovery, which means you can use it out of the box with Kubernetes (and probably also Weave, discoverd, Swarm, or other anything else with dns-based service discovery).

It also supports UDP-based discovery, so that nodes on the same network (like docker containers on the same host) can find each other.

This library adds support for API-based discovery of nodes running in an AWS VPC on EC2 or Elastic Beanstalk.

Installation

Add peerage and peerage_ec2 to your list of dependencies in mix.exs, and start its application:

    def application do
      [applications: [:peerage]]
    end

    def deps do
      [
      	{:peerage, "~> 1.0.2"},
      	{:peerage_ec2, "~> 1.0.0"},
      ]
    end

Note that the latest hex versions may be higher than what is listed here. You can find the latest version on hex for peerage and peerage_ec2. You should match the version or alternatively you can use a looser version constraint like "~> 1.0".

Usage

See Peerage for setup instructions specific to that library. To configure the Peerage.Via.Ec2 provider:

   config :peerage, via: Peerage.Via.Ec2, aws_access_key_id: "...",
                                          aws_secret_access_key: "...",
                                          tags: [{:cluster, "..."}, {:service, "..."}]

tags are mappings to tags set on your EC2 instances. If using Elastic Beanstalk, these tags are set within the EB environment configuration. The cluster tag is used to discover all nodes in your cluster ("production", "staging", etc). The service tag is used to name each node/service that is found ("accounts", "payments", etc).

Peerage.Via.Ec2 uses a polling mechanism, so a GenServer is not necessary.

About

A Peerage provider for easy clustering on AWS EC2 and Elastic Beanstalk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%