IT序号网

kubernetes之RabbitMQ和Kubernetes

tintown 2025年05月04日 编程语言 48 0

我们想将RabbitMQ与Kubernetes一起使用,但是我们发现一些意见告诉我们,这不是很容易,甚至是不可能的。
例如,人们说,当 pod 掉落时,要正确地建立RabbitMQ的节点并不容易。

我的问题是真的不可能吗,如果响应为“否”,是否有一些最佳实践可以了解实现?

谢谢你的帮助

请您参考如下方法:

这个问题太笼统了,顺便说一句,可以在k8s上使用rmq。

您可以在此处找到有关该文档的文档:

http://www.rabbitmq.com/cluster-formation.html#peer-discovery-k8s

It is highly recommended that RabbitMQ clusters are deployed using a stateful set. If a stateless set is used recreated nodes will not have their persisted data and will start as blank nodes. This can lead to data loss and higher network traffic volume due to more frequent eager synchronisation of newly joining nodes. Stateless sets are also prone to the natural race condition during initial cluster formation, unlike stateful sets that initialise pods one by one.



在这里您可以找到完整的示例:

https://github.com/rabbitmq/rabbitmq-peer-discovery-k8s/tree/master/examples/k8s_statefulsets


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!