GithubHelp home page GithubHelp logo

nguyenvantien2009 / cluster-rabbitmq-haproxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 12nguyenduc/cluster-rabbitmq-haproxy

0.0 0.0 0.0 5 KB

RabbitMQ cluster với HAProxy và Docker

Dockerfile 42.07% Shell 57.93%

cluster-rabbitmq-haproxy's Introduction

RabbitMQ cluster with HAProxy and Docker Compose

Requirements:

  1. Create .env from example.env file. Then change config account use for login.

Creates a 3 node RabbitMQ cluster with a HAProxy acting as a load balancer.

You need to build the HAProxy image first, just run:

$ docker build -t haproxy-server .

Now run the docker compose file:

$ docker-compose -f docker-compose.yml up

check if the containers are running:

$ docker ps

Create the cluster by running:

$ docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl stop_app"
$ docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl join_cluster rabbit@rabbitmq-node-1"
$ docker exec -ti rabbitmq-node-2 bash -c "rabbitmqctl start_app"

$ docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl stop_app"
$ docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl join_cluster rabbit@rabbitmq-node-1"
$ docker exec -ti rabbitmq-node-3 bash -c "rabbitmqctl start_app"

Check the cluster status:

$ docker exec -ti rabbitmq-node-1 bash -c "rabbitmqctl cluster_status"

Access HAProxy statistics report at http://localhost:1936/haproxy?stats with the credential haproxy:haproxy, and the RabbitMQ console at http://localhost:15672/ with the credential admin:admin.

cluster-rabbitmq-haproxy's People

Contributors

khangdc2 avatar

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.