简体   繁体   English

不同主机之间的Docker容器中的RabbitMQ群集

[英]RabbitMQ Cluster in Docker Container among different hosts

I want to create a rabbitMQ cluster that is very resilient to failures. 我想创建一个对故障非常有弹性的rabbitMQ集群。

So far I've managed to create a cluster with three nodes, each of these nodes runs inside a docker container. 到目前为止,我已经设法创建了一个包含三个节点的集群,每个节点都在一个docker容器内运行。 To enable the nodes to join a cluster, the hosts needs to know each other via links. 要使节点加入群集,主机需要通过链接相互了解。

Now, the whole architecture runs in the cloud (on AWS to be precise). 现在,整个架构在云中运行(准确地说在AWS上)。 So far, my containers can only be linked with one another, when they run on the same AWS-instance. 到目前为止,我的容器只能在同一个AWS实例上运行时才能相互链接。 I want to create the cluster in a way that nodes can lie on diffrent hosts. 我想以节点可以位于不同主机上的方式创建集群。

So far I've tried: 到目前为止,我已经尝试过:

  1. Using federation / shovel instead. 使用联合/铲子代替。 This does not serve my purpose, because I need CP from the CAP-Theorem and not CA. 这不符合我的目的,因为我需要来自CAP-Theorem的CP而不是CA. I need my nodes to be all replicas of one another and to be able to act as the same broker to clients. 我需要我的节点是彼此的所有副本,并且能够作为客户端的同一个代理。

  2. Creating a docker swarm. 创建一个docker swarm。 I am able to set-up the docker swarm and connect two instances via docker swarm. 我能够设置docker swarm并通过docker swarm连接两个实例。 But if I try to run multiple rabbit-containers on this swarm, they either are placed on the same node or I cannot link them with one another. 但是如果我尝试在这个群上运行多个兔子容器,它们要么被放置在同一个节点上,要么我无法将它们彼此链接起来。 So I end up with the same constellation, of all my hosts running on the same node. 所以我最终得到了在同一节点上运行的所有主机的相同星座。

Is there any solution or other approach, with which I could create a rabbitmMQ-cluster inside docker containers among different AWS-instances / hosts? 有没有任何解决方案或其他方法,我可以用它在不同的AWS实例/主机之间的docker容器中创建一个rabbitmMQ-cluster?

You mentioned "To enable the nodes to join a cluster, the hosts needs to know each other via links" .. but I'm not sure why you require the links. 您提到“要启用节点加入群集,主机需要通过链接相互了解”..但我不确定您为什么需要链接。 The main thing is for each of the containers to be able to locate each other, which is basically a service discovery problem. 主要的是每个容器能够相互定位,这基本上是服务发现问题。 I've done something similar (with rabbitmq) using consul on a bunch of different VMs (not even using swarm), but if you're already running a swarm cluster then you might be able to hit the API to discover other instances of the container? 我已经使用consul在一堆不同的VM(甚至不使用swarm)上做了类似的事情(使用rabbitmq),但是如果你已经运行了一个swarm集群,那么你可能可以点击API来发现其他的容器?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在集群上的Docker容器中配置应用程序 - Configuration for application in docker container on cluster 具有Rabbitmq主机名的Docker容器(用于EC2服务器) - Docker container with rabbitmq hostname ( with EC2 Server) 使用ip地址在不同主机上ping docker容器 - Ping docker containers on different hosts with ip addresses Docker容器中的Elasticsearch,AWS中的集群发现 - Elasticsearch in Docker container, cluster discovery in AWS 在AWS ECS集群中显示Docker容器日志 - Showing docker container log in aws ECS cluster 从另一台主机上的另一个容器SSH到docker容器 - SSH into a docker container from another container on a different host aws-secretsmanager-caching-python:: 缓存是否在同一 EC2 实例上运行的不同 docker 容器之间共享? - aws-secretsmanager-caching-python :: Is cache shared among different docker containers running on the same EC2 instance? 如何使用 Pulumi 配置 AWS ECS Fargate 任务/集群以访问私有 Docker 容器注册表(如 GitHub 容器注册表)? - How to configure AWS ECS Fargate Tasks/Cluster to access private Docker Container Registry (like GitHub Container Registry) with Pulumi? 如何设置自动扩展RabbitMQ群集AWS - How to set up autoscaling RabbitMQ Cluster AWS aws 中的 rabbitmq 自动缩放集群:管理缩放事件 - rabbitmq autoscaling cluster in aws: managing scaling events
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM