Skip to content

A high available cluster of nodes that will assure availability and consistency.

License

Notifications You must be signed in to change notification settings

Anikcb/Highly-Available-Cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Topic you needs to know, to run this project

Node Names (Identifiers)

RabbitMQ nodes are identified by node names. A node name consists of two parts, a prefix (usually rabbit) and hostname. For example, rabbit@node1.messaging.svc.local is a node name with the prefix of rabbit and hostname of node1.messaging.svc.local

Resolving hostnames

Resolving hostnames refers to the process of converting human-readable domain names (like www.example.com) into IP addresses that computers can understand and use to communicate over a network. In a cluster environment, where multiple computers or nodes are interconnected, it means that each member of the cluster should be capable of translating the hostnames of other cluster members into their respective IP addresses.

Hostname Resolution

Every cluster member must be able to resolve hostnames of every other cluster member, its own hostname, as well as machines on which command line tools such as rabbitmqctl might be used.Nodes will perform hostname resolution early on node boot. In container-based environments it is important that hostname resolution is ready before the container is started.

Why need a network in docker?

This is very important for rabbitmq instances to communicate with one another and they must be able to resolve DNS. So if you're running inside docker you use the container names to create a docker network make sure they can resolve each other's host names to connect and form a cluster.

Port Access

RabbitMQ nodes bind to ports (open server TCP sockets) in order to accept client and CLI tool connections.

Erlang Cookie

RabbitMQ nodes and CLI tools (e.g. rabbitmqctl) use a cookie to determine whether they are allowed to communicate with each other. For two nodes to be able to communicate they must have the same shared secret called the Erlang cookie. The cookie is just a string of alphanumeric characters up to 255 characters in size

volumes

This section specifies the volumes to mount into the container. Volumes are used for persisting data or configuration outside of the container

  • ./rabbitmq.config into /etc/rabbitmq/rabbitmq.config: This is likely a custom RabbitMQ configuration file that overrides default settings.
  • ./definitions.json into /etc/rabbitmq/definitions.json : This is likely a JSON file containing RabbitMQ definitions, such as queues, exchanges, and bindings.

Queue Leader Replica Placement

Queue leaders can be distributed between nodes using several strategies. Which strategy is used is controlled in three ways, namely, using the x-queue-master-locator. You can read this from here

Publisher Confirms

To sent acknowledgment after sync in mirrored queues ha-sync-mode: manual

Restart Node

restart: unless-stopped: Restart the container unless it is explicitly stopped by the user (e.g., using docker stop). The container will be restarted on Docker daemon restarts, system reboots, or if the container exits unexpectedly, but not if the user stopped it.

Setup Highly Available Cluster

Go to the Folder RabbitMq, open command Shell and run the commands

docker network create rabbitmq-HAC
docker-compose up -d

Run Producer & Consumer

From Consumer folder open cmd and run the command

dotnet run

same for the Producer

dotnet run

About

A high available cluster of nodes that will assure availability and consistency.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages