Code Monkey home page Code Monkey logo

alpine-rabbitmq-autocluster's Introduction

alpine-rabbitmq-autocluster

Small RabbitMQ image (~42MB) with the autocluster plugin

RabbitMQ Version: 3.6.2 Autocluster Version: 0.6.1

Stars Pulls

Enabled plugins

  • Autocluster
  • Consistent Hash Exchange
  • Delayed Message Exchange
  • Federation
  • Federation Management
  • Management
  • Management Visualiser
  • Message Timestamp
  • MQTT
  • Recent History Exchange
  • Sharding
  • Shovel
  • Shovel Management
  • Stomp
  • Top
  • WebStomp

Configuration

All configuration of the auto-cluster plugin should be done via environment variables.

See the RabbitMQ AutoCluster plugin Wiki for configuration settings.

Example Usage

The following example configures the autocluster plugin for use in an AWS EC2 Autoscaling group:

docker run --name rabbitmq -d \
  -e AUTOCLUSTER_TYPE=aws \
  -e AUTOCLUSTER_CLEANUP=true \
  -e CLEANUP_WARN_ONLY=false \
  -e AWS_DEFAULT_REGION=us-east-1 \
  -p 4369:4369 \
  -p 5672:5672 \
  -p 15672:15672 \
  -p 25672:25672 \
  gavinmroy/alpine-rabbitmq-autocluster

To use the AWS autocluster features, you will need an IAM policy that allows the plugin to discover the node list. The following is an example of such a policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "autoscaling:DescribeAutoScalingInstances",
                "ec2:DescribeInstances"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}

If you do not want to use the IAM role for the instances, you could create a role and specify the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY when starting the container.

I've included a CloudFormation template that should let you test the plugin. The template creates an IAM Policy and Role, Security Group, ELB, Launch Configuration, and Autoscaling group.

The following is the user data snippet that for the Ubuntu image that is used in the Launch Configuration:

#cloud-config
apt_update: true
apt_upgrade: true
apt_sources:
  - source: deb https://apt.dockerproject.org/repo ubuntu-trusty main
    keyid: 58118E89F3A912897C070ADBF76221572C52609D
    filename: docker.list
packages:
  - docker-engine
runcmd:
  - export AWS_DEFAULT_REGION=`ec2metadata --availability-zone | sed s'/.$//'`
  - docker run -d --name rabbitmq --net=host -p 4369:4369 -p 5672:5672 -p 15672:15672 -p 25672:25672 -e AUTOCLUSTER_TYPE=aws -e AWS_AUTOSCALING=true -e AUTOCLUSTER_CLEANUP=true -e CLEANUP_WARN_ONLY=false -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION gavinmroy/alpine-rabbitmq-autocluster:3.6.2-0.6.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.