AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1121175
Accepted
sflyer
sflyer
Asked: 2023-01-27 01:19:15 +0800 CST2023-01-27 01:19:15 +0800 CST 2023-01-27 01:19:15 +0800 CST

Nomad 上的 Rabbitmq 集群

  • 772

我想在游牧集群中创建一个 rabbitmq 集群。现在我可以运行 rabbitmq docker 容器,但我无法创建基于 consul 发现的集群。containters 启动后,我在每个节点上都得到了这个消息:

[warning] <0.229.0> Could not auto-cluster with node [email protected]: {badrpc,nodedown}
[warning] <0.229.0> Could not auto-cluster with node rabbit@test-nomad1: {badrpc,nodedown}
[warning] <0.229.0> Could not auto-cluster with node rabbit@test-nomad2: {badrpc,nodedown}
[warning] <0.229.0> Could not auto-cluster with node rabbit@test-nomad3: {badrpc,nodedown}

我的问题在哪里?我在想也许需要先启动一个节点,然后我添加了一个带有 prestart 的容器,但这对我没有帮助。我的游牧工作:

job "test" {
datacenters = ["dc1"]

group "test-group" {
count = 4
update {
  max_parallel = 1
}

migrate {
  max_parallel = 1
  health_check = "checks"
  min_healthy_time = "30s"
  healthy_deadline = "60s"
}
task "rabbit" {
  driver = "docker"
  config {
    image = "<my_registry>/rabbitmq:consul"
    force_pull = true
    hostname = "${attr.unique.hostname}"
    port_map {
      amqp = 5672
      ui = 15672
      discovery = 4369
      clustering = 25672
    }
    auth {
      server_address = "<my_registry>"
      username = "user"
      password = "pass"
    }
  }

  env {
    RABBITMQ_ERLANG_COOKIE = "RabbitMQ"
    RABBITMQ_DEFAULT_USER = "test"
    RABBITMQ_DEFAULT_PASS = "test"
    CONSUL_HOST = "10.14.1.109"
    CONSUL_SVC_PORT = "${NOMAD_HOST_PORT_amqp}"
    CONSUL_SVC_TAGS = "amqp"
  }

  resources {
    network {
      port "amqp" { static = 5672 }
      port "ui" { static = 15672 }
      port "discovery" { static = 4369 }
      port "clustering" { static = 25672 }
    }
  }

  service {
    name = "rabbitmq"
    port = "ui"
    tags = ["management", "http"]
  }
}
}
}

兔子配置:

loopback_users.guest = false
listeners.tcp.default = 5672
hipe_compile = false
management.listener.port = 15672
management.listener.ssl = false
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_consul
cluster_formation.consul.acl_token = <my_token>
cluster_formation.consul.host = 10.14.1.109
cluster_formation.consul.svc_addr_auto = true
cluster_formation.consul.svc_addr_use_nodename = false

在领事服务中,我看到了兔子 感谢您的帮助!

rabbitmq
  • 1 1 个回答
  • 35 Views

1 个回答

  • Voted
  1. Best Answer
    sflyer
    2023-02-02T22:30:17+08:002023-02-02T22:30:17+08:00

    问题已解决,docker 容器未配置为获取 consul dns。如何修复它https://awesomeprogrammer.com/blog/2021/12/22/consul-dns-services-discovery-in-docker-gotchas/

    • 0

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve