rabbitmq / rabbitmq-autocluster

RabbitMQ peer discovery and cluster formation plugin, supports RabbitMQ 3.6.x
BSD 3-Clause "New" or "Revised" License
242 stars 54 forks source link

How is RABBITMQ_NODENAME value used by rabbitmq-autocluster? #56

Closed galindro closed 6 years ago

galindro commented 6 years ago

Problem description

I have started two rabbitmq docker containers in two AWS EC2 different instances in sa-east-1 region using AWS ECS to manage them. I've constructed the image and I'm pretty sure that this plugin was correctly installed (this info could be confirmed by the logs bellow).

I need to use RABBITMQ_NODENAME to setup the rabbitmq node name to a defined hostname because I can't use docker container with host networking.

For testing, you should start a rabbitmq 3.6.x container with rabbitmq-autocluster plugin version 0.10.0 using the following run command in two EC2 instances tagged with env=socialbase:

docker run -ti --name rmq --hostname rabbitmq \
    -e AUTOCLUSTER_CLEANUP=true \
    -e AUTOCLUSTER_DELAY=30 \
    -e AUTOCLUSTER_LOG_LEVEL=debug \
    -e AUTOCLUSTER_TYPE=aws \
    -e AWS_DEFAULT_REGION=sa-east-1 \
    -e AWS_EC2_TAGS='{"env": "socialbase"}' \
    -e CLEANUP_WARN_ONLY=false \
    -e RABBITMQ_ERLANG_COOKIE=xxx \
    -e RABBITMQ_NODENAME=rabbit@rabbitmq \
  rabbitmq-image-name

Here are the details of my env:

Environment variables

/ # printenv
AUTOCLUSTER_LOG_LEVEL=debug
HOSTNAME=rabbitmq
AWS_EC2_TAGS={"env": "socialbase"}
SHLVL=2
HOME=/var/lib/rabbitmq
RABBITMQ_LOGS=-
RABBITMQ_NODENAME=rabbit@rabbitmq
RABBITMQ_ERLANG_COOKIE=xxx
AUTOCLUSTER_TYPE=aws
S6_FILE=s6-overlay-amd64.tar.gz
AWS_DEFAULT_REGION=sa-east-1
RABBITMQ_GPG_KEY=0A9AF2115F4687BD29803A206B73A36E6026DFCA
RABBITMQ_VERSION=3.6.12
TERM=xterm
AUTOCLUSTER_CLEANUP=true
AUTOCLUSTER_DELAY=30
RABBITMQ_SASL_LOGS=-
PATH=/opt/rabbitmq/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CONFD_FILE=confd-0.11.0-linux-amd64.gz
BIN_PATH=/usr/local/bin
PWD=/
RABBITMQ_HOME=/opt/rabbitmq
CLEANUP_WARN_ONLY=false
DOCKERIZE_FILE=dockerize-linux-amd64-v0.2.0.tar.gz
RABBITMQ_GITHUB_TAG=rabbitmq_v3_6_12

RabbitMQ/Erlang Version

/ # rabbitmqctl status
Status of node rabbit@rabbitmq
[{pid,2222},
 {running_applications,
     [{autocluster,
          "Forms RabbitMQ clusters using a variety of backends (AWS EC2, DNS, Consul, Kubernetes, etc)",
          "0.9.0+4.g0e7899d"},
      {rabbitmq_management,"RabbitMQ Management Console","3.6.12"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.12"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.12"},
      {rabbitmq_delayed_message_exchange,"RabbitMQ Delayed Message Exchange",
          "0.0.1"},
      {rabbit,"RabbitMQ","3.6.12"},
      {mnesia,"MNESIA  CXC 138 12","4.13.4"},
      {amqp_client,"RabbitMQ AMQP Client","3.6.12"},
      {rabbit_common,
          "Modules shared by rabbitmq-server and rabbitmq-erlang-client",
          "3.6.12"},
      {cowboy,"Small, fast, modular HTTP server.","1.0.4"},
      {xmerl,"XML parser","1.3.10"},
      {os_mon,"CPO  CXC 138 46","2.4"},
      {ranch,"Socket acceptor pool for TCP protocols.","1.3.0"},
      {rabbitmq_aws,
          "A minimalistic AWS API interface used by rabbitmq-autocluster (3.6.x) and other RabbitMQ plugins",
          "3.6.13.milestone1+2.g946e794"},
      {ssl,"Erlang/OTP SSL application","7.3.1"},
      {public_key,"Public key infrastructure","1.1.1"},
      {asn1,"The Erlang ASN1 compiler version 4.0.2","4.0.2"},
      {compiler,"ERTS  CXC 138 10","6.0.3"},
      {cowlib,"Support library for manipulating Web protocols.","1.0.2"},
      {crypto,"CRYPTO","3.6.3"},
      {syntax_tools,"Syntax tools","1.7"},
      {inets,"INETS  CXC 138 49","6.2.2"},
      {sasl,"SASL  CXC 138 11","2.7"},
      {stdlib,"ERTS  CXC 138 10","2.8"},
      {kernel,"ERTS  CXC 138 10","4.2"}]},
 {os,{unix,linux}},
 {erlang_version,
     "Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:4:4] [async-threads:64] [kernel-poll:true]\n"},
 {memory,
     [{connection_readers,0},
      {connection_writers,0},
      {connection_channels,0},
      {connection_other,2712},
      {queue_procs,2712},
      {queue_slave_procs,0},
      {plugins,1895896},
      {other_proc,23448304},
      {metrics,194360},
      {mgmt_db,142288},
      {mnesia,68456},
      {other_ets,2247272},
      {binary,123032},
      {msg_index,40864},
      {code,28026822},
      {atom,1033377},
      {other_system,14351505},
      {total,71577600}]},
 {alarms,[]},
 {listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{http,15672,"::"}]},
 {vm_memory_calculation_strategy,rss},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,429496729},
 {disk_free_limit,50000000},
 {disk_free,6930915328},
 {file_descriptors,
     [{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
 {processes,[{limit,1048576},{used,334}]},
 {run_queue,0},
 {uptime,187},
 {kernel,{net_ticktime,60}}]

RabbitMQ server and client application log files

=INFO REPORT==== 31-Oct-2017::10:21:16 ===
Starting RabbitMQ 3.6.12 on Erlang 18.3.2
Copyright (C) 2007-2017 Pivotal Software, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

              RabbitMQ 3.6.12. Copyright (C) 2007-2017 Pivotal Software, Inc.
  ##  ##      Licensed under the MPL.  See http://www.rabbitmq.com/
  ##  ##
  ##########  Logs: tty
  ######  ##        tty
  ##########
              Starting broker...

=INFO REPORT==== 31-Oct-2017::10:21:16 ===
node           : rabbit@rabbitmq
home dir       : /var/lib/rabbitmq
config file(s) : /etc/rabbitmq/rabbitmq.config
cookie hash    : Q8goAtoH0kfw25pdUQxb2Q==
log            : tty
sasl log       : tty
database dir   : /var/lib/rabbitmq/mnesia/rabbit@rabbitmq

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: log level set to debug

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Running discover/join step

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
    application: mnesia
    exited: stopped
    type: temporary

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Apps 'rabbit' and 'mnesia' successfully stopped

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Running step initialize_backend

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Using AWS backend

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Starting dependencies of backend aws: [rabbitmq_aws]

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Running step acquire_startup_lock

=INFO REPORT==== 31-Oct-2017::10:21:18 ===
autocluster: Delaying startup for 27737ms.

=INFO REPORT==== 31-Oct-2017::10:21:45 ===
autocluster: Running step find_best_node_to_join

=INFO REPORT==== 31-Oct-2017::10:21:45 ===
autocluster: Setting region: "sa-east-1"

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: AWS request: /?Action=DescribeInstances&Filter.1.Name=tag%3Aenv&Filter.1.Value.1=socialbase&Version=2015-10-01
Response: [{"DescribeInstancesResponse",
            [{"requestId","f9c2ee3f-4292-4515-a1c5-735021b18161"},
             {"reservationSet",
              [{"item",
                [{"reservationId","r-0c26f5305400263de"},
                 {"ownerId","832266673134"},
                 {"groupSet",[]},
                 {"instancesSet",
                  [{"item",
                    [{"instanceId","i-01b5692949213d3c9"},
                     {"imageId","ami-ae0971c2"},
                     {"instanceState",[{"code","16"},{"name","running"}]},
                     {"privateDnsName",
                      "ip-10-0-3-20.sa-east-1.compute.internal"},
                     {"dnsName",
                      "ec2-54-233-190-88.sa-east-1.compute.amazonaws.com"},
                     {"reason",[]},
                     {"keyName","mysshkey"},
                     {"amiLaunchIndex","0"},
                     {"productCodes",[]},
                     {"instanceType","c3.xlarge"},
                     {"launchTime","2017-10-31T09:11:59.000Z"},
                     {"placement",
                      [{"availabilityZone","sa-east-1c"},
                       {"groupName",[]},
                       {"tenancy","default"}]},
                     {"monitoring",[{"state","disabled"}]},
                     {"subnetId","subnet-b90123ff"},
                     {"vpcId","vpc-656bd800"},
                     {"privateIpAddress","10.0.3.20"},
                     {"ipAddress","54.233.190.88"},
                     {"sourceDestCheck","true"},
                     {"groupSet",
                      [{"item",
                        [{"groupId","sg-88d9a5ef"},{"groupName","SG_ECS"}]}]},
                     {"architecture","x86_64"},
                     {"rootDeviceType","ebs"},
                     {"rootDeviceName","/dev/xvda"},
                     {"blockDeviceMapping",
                      [{"item",
                        [{"deviceName","/dev/xvda"},
                         {"ebs",
                          [{"volumeId","vol-05afac15ca8df17b4"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:12:00.000Z"},
                           {"deleteOnTermination","true"}]}]},
                       {"item",
                        [{"deviceName","/dev/xvdcz"},
                         {"ebs",
                          [{"volumeId","vol-0be274acfd288e5b6"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:12:00.000Z"},
                           {"deleteOnTermination","true"}]}]}]},
                     {"instanceLifecycle","spot"},
                     {"spotInstanceRequestId","sir-2m4rdafm"},
                     {"virtualizationType","hvm"},
                     {"clientToken","e308a29e-27fc-4d9d-8f78-c4dd35f38d2d"},
                     {"tagSet",
                      [{"item",
                        [{"key","weave:peerGroupName"},
                         {"value","socialbase"}]},
                       {"item",
                        [{"key","aws:ec2spot:fleet-request-id"},
                         {"value",
                          "sfr-25ac2bb7-6c67-42b5-b2b0-26683c7f6496"}]},
                       {"item",[{"key","ssh_user"},{"value","ec2-user"}]},
                       {"item",[{"key","ssh_port"},{"value","22"}]},
                       {"item",[{"key","Name"},{"value","ecs"}]},
                       {"item",
                        [{"key","ssh_key"},{"value","mysshkey.pem"}]},
                       {"item",[{"key","env"},{"value","socialbase"}]}]},
                     {"hypervisor","xen"},
                     {"networkInterfaceSet",
                      [{"item",
                        [{"networkInterfaceId","eni-33bdd52b"},
                         {"subnetId","subnet-b90123ff"},
                         {"vpcId","vpc-656bd800"},
                         {"description",[]},
                         {"ownerId","832266673134"},
                         {"status","in-use"},
                         {"macAddress","0a:57:74:cc:cf:4c"},
                         {"privateIpAddress","10.0.3.20"},
                         {"privateDnsName",
                          "ip-10-0-3-20.sa-east-1.compute.internal"},
                         {"sourceDestCheck","true"},
                         {"groupSet",
                          [{"item",
                            [{"groupId","sg-88d9a5ef"},
                             {"groupName","SG_ECS"}]}]},
                         {"attachment",
                          [{"attachmentId","eni-attach-6ef50185"},
                           {"deviceIndex","0"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:11:59.000Z"},
                           {"deleteOnTermination","true"}]},
                         {"association",
                          [{"publicIp","54.233.190.88"},
                           {"publicDnsName",
                            "ec2-54-233-190-88.sa-east-1.compute.amazonaws.com"},
                           {"ipOwnerId","amazon"}]},
                         {"privateIpAddressesSet",
                          [{"item",
                            [{"privateIpAddress","10.0.3.20"},
                             {"privateDnsName",
                              "ip-10-0-3-20.sa-east-1.compute.internal"},
                             {"primary","true"},
                             {"association",
                              [{"publicIp","54.233.190.88"},
                               {"publicDnsName",
                                "ec2-54-233-190-88.sa-east-1.compute.amazonaws.com"},
                               {"ipOwnerId","amazon"}]}]}]}]}]},
                     {"iamInstanceProfile",
                      [{"arn",
                        "arn:aws:iam::832266673134:instance-profile/ecsInstanceRole"},
                       {"id","AIPAJOCNFNPLL25WXF3DQ"}]},
                     {"ebsOptimized","false"},
                     {"enaSupport","true"}]}]},
                 {"requesterId","AIDAJKWGGSFI5CGBVYWOY"}]},
               {"item",
                [{"reservationId","r-038d132ce42f84dec"},
                 {"ownerId","832266673134"},
                 {"groupSet",[]},
                 {"instancesSet",
                  [{"item",
                    [{"instanceId","i-03972fdcc1fef7506"},
                     {"imageId","ami-ae0971c2"},
                     {"instanceState",[{"code","16"},{"name","running"}]},
                     {"privateDnsName",
                      "ip-10-0-1-162.sa-east-1.compute.internal"},
                     {"dnsName",
                      "ec2-54-233-153-55.sa-east-1.compute.amazonaws.com"},
                     {"reason",[]},
                     {"keyName","mysshkey"},
                     {"amiLaunchIndex","0"},
                     {"productCodes",[]},
                     {"instanceType","c3.xlarge"},
                     {"launchTime","2017-10-31T09:43:08.000Z"},
                     {"placement",
                      [{"availabilityZone","sa-east-1a"},
                       {"groupName",[]},
                       {"tenancy","default"}]},
                     {"monitoring",[{"state","disabled"}]},
                     {"subnetId","subnet-9018def5"},
                     {"vpcId","vpc-656bd800"},
                     {"privateIpAddress","10.0.1.162"},
                     {"ipAddress","54.233.153.55"},
                     {"sourceDestCheck","true"},
                     {"groupSet",
                      [{"item",
                        [{"groupId","sg-88d9a5ef"},{"groupName","SG_ECS"}]}]},
                     {"architecture","x86_64"},
                     {"rootDeviceType","ebs"},
                     {"rootDeviceName","/dev/xvda"},
                     {"blockDeviceMapping",
                      [{"item",
                        [{"deviceName","/dev/xvda"},
                         {"ebs",
                          [{"volumeId","vol-01a8d67bf15d79b4c"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:43:08.000Z"},
                           {"deleteOnTermination","true"}]}]},
                       {"item",
                        [{"deviceName","/dev/xvdcz"},
                         {"ebs",
                          [{"volumeId","vol-0864bd115f76fc03d"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:43:08.000Z"},
                           {"deleteOnTermination","true"}]}]}]},
                     {"instanceLifecycle","spot"},
                     {"spotInstanceRequestId","sir-j8sgctnm"},
                     {"virtualizationType","hvm"},
                     {"clientToken","a8fe9bf3-069a-4075-b8ea-bb8e3391aa7e"},
                     {"tagSet",
                      [{"item",[{"key","env"},{"value","socialbase"}]},
                       {"item",[{"key","Name"},{"value","ecs"}]},
                       {"item",
                        [{"key","aws:ec2spot:fleet-request-id"},
                         {"value",
                          "sfr-25ac2bb7-6c67-42b5-b2b0-26683c7f6496"}]},
                       {"item",[{"key","ssh_user"},{"value","ec2-user"}]},
                       {"item",
                        [{"key","weave:peerGroupName"},
                         {"value","socialbase"}]},
                       {"item",
                        [{"key","ssh_key"},{"value","mysshkey.pem"}]},
                       {"item",[{"key","ssh_port"},{"value","22"}]}]},
                     {"hypervisor","xen"},
                     {"networkInterfaceSet",
                      [{"item",
                        [{"networkInterfaceId","eni-0b052c07"},
                         {"subnetId","subnet-9018def5"},
                         {"vpcId","vpc-656bd800"},
                         {"description",[]},
                         {"ownerId","832266673134"},
                         {"status","in-use"},
                         {"macAddress","02:ab:16:6e:be:2e"},
                         {"privateIpAddress","10.0.1.162"},
                         {"privateDnsName",
                          "ip-10-0-1-162.sa-east-1.compute.internal"},
                         {"sourceDestCheck","true"},
                         {"groupSet",
                          [{"item",
                            [{"groupId","sg-88d9a5ef"},
                             {"groupName","SG_ECS"}]}]},
                         {"attachment",
                          [{"attachmentId","eni-attach-e8929901"},
                           {"deviceIndex","0"},
                           {"status","attached"},
                           {"attachTime","2017-10-31T09:43:08.000Z"},
                           {"deleteOnTermination","true"}]},
                         {"association",
                          [{"publicIp","54.233.153.55"},
                           {"publicDnsName",
                            "ec2-54-233-153-55.sa-east-1.compute.amazonaws.com"},
                           {"ipOwnerId","amazon"}]},
                         {"privateIpAddressesSet",
                          [{"item",
                            [{"privateIpAddress","10.0.1.162"},
                             {"privateDnsName",
                              "ip-10-0-1-162.sa-east-1.compute.internal"},
                             {"primary","true"},
                             {"association",
                              [{"publicIp","54.233.153.55"},
                               {"publicDnsName",
                                "ec2-54-233-153-55.sa-east-1.compute.amazonaws.com"},
                               {"ipOwnerId","amazon"}]}]}]}]}]},
                     {"iamInstanceProfile",
                      [{"arn",
                        "arn:aws:iam::832266673134:instance-profile/ecsInstanceRole"},
                       {"id","AIPAJOCNFNPLL25WXF3DQ"}]},
                     {"ebsOptimized","false"},
                     {"enaSupport","true"}]}]},
                 {"requesterId","AIDAJKWGGSFI5CGBVYWOY"}]}]}]}]

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: List of registered nodes retrieved from the backend: ['rabbit@ip-10-0-1-162',
                                                                   'rabbit@ip-10-0-3-20']

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Fetching node details. Unreachable nodes (or nodes that responded with an error): ['rabbit@ip-10-0-1-162',
                                                                                                'rabbit@ip-10-0-3-20']

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Fetching node details. Responses: []

=ERROR REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: No nodes to choose the preferred from!

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Picked node as the preferred choice for joining: undefined

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Running step maybe_cluster

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: We are the first node in the cluster, starting up unconditionally.

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Starting back 'rabbit' application

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Memory high watermark set to 409 MiB (429496729 bytes) of 1024 MiB (1073741824 bytes) total

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Enabling free disk space monitoring

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Disk free limit set to 50MB

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Limiting to approx 924 file handles (829 sockets)

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
FHC read buffering:  OFF
FHC write buffering: ON

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Waiting for Mnesia tables for 30000 ms, 9 retries left

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Waiting for Mnesia tables for 30000 ms, 9 retries left

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Priority queues enabled, real BQ is rabbit_variable_queue

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Starting rabbit_node_monitor

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Management plugin: using rates mode 'basic'

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
msg_store_transient: using rabbit_msg_store_ets_index to provide index

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
msg_store_persistent: using rabbit_msg_store_ets_index to provide index

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
started TCP Listener on [::]:5672

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Running registeration step

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Running step register_with_backend

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Running lock release step

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: Running step release_startup_lock

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Management plugin started. Port: 15672

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Statistics database started.

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
autocluster: (cleanup) Timer started {60,false}
 completed with 9 plugins.

=INFO REPORT==== 31-Oct-2017::10:21:46 ===
Server startup complete; 9 plugins started.
 * autocluster
 * rabbitmq_management
 * rabbitmq_web_dispatch
 * rabbitmq_management_agent
 * rabbitmq_delayed_message_exchange
 * amqp_client
 * cowboy
 * rabbitmq_aws
 * cowlib

RabbitMQ plugin information via rabbitmq-plugins list

/ # rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:   * = running on rabbit@rabbitmq
 |/
[e*] amqp_client                       3.6.12
[E*] autocluster                       0.9.0+4.g0e7899d
[e*] cowboy                            1.0.4
[e*] cowlib                            1.0.2
[  ] rabbitmq_amqp1_0                  3.6.12
[  ] rabbitmq_auth_backend_ldap        3.6.12
[  ] rabbitmq_auth_mechanism_ssl       3.6.12
[e*] rabbitmq_aws                      3.6.13.milestone1+2.g946e794
[  ] rabbitmq_consistent_hash_exchange 3.6.12
[E*] rabbitmq_delayed_message_exchange 0.0.1
[  ] rabbitmq_event_exchange           3.6.12
[  ] rabbitmq_federation               3.6.12
[  ] rabbitmq_federation_management    3.6.12
[  ] rabbitmq_jms_topic_exchange       3.6.12
[E*] rabbitmq_management               3.6.12
[e*] rabbitmq_management_agent         3.6.12
[  ] rabbitmq_management_visualiser    3.6.12
[  ] rabbitmq_mqtt                     3.6.12
[  ] rabbitmq_recent_history_exchange  3.6.12
[  ] rabbitmq_sharding                 3.6.12
[  ] rabbitmq_shovel                   3.6.12
[  ] rabbitmq_shovel_management        3.6.12
[  ] rabbitmq_stomp                    3.6.12
[  ] rabbitmq_top                      3.6.12
[  ] rabbitmq_tracing                  3.6.12
[  ] rabbitmq_trust_store              3.6.12
[e*] rabbitmq_web_dispatch             3.6.12
[  ] rabbitmq_web_mqtt                 3.6.12
[  ] rabbitmq_web_mqtt_examples        3.6.12
[  ] rabbitmq_web_stomp                3.6.12
[  ] rabbitmq_web_stomp_examples       3.6.12
[  ] sockjs                            0.3.4

Operating system, version, and patch level

Alpine Linux 3.4

rabbitmq-collect-env

https://drive.google.com/file/d/0B7odw6Q-9mFdSzFZWDl5eFBRZ1k/view?usp=sharing

michaelklishin commented 6 years ago

This plugin generally has no effect on RABBITMQ_NODENAME except for two things:

So, backends either assume that they can compute hostnames (that will actually resolve) and can communicate them to their discovery mechanism or that the hostnames are provided e.g. by DNS or using an external API (such as EC2 instance listing or DNS A/AAAA record resolution)

This is design and will not change.

michaelklishin commented 6 years ago

On AWS your options are private DNS-provided hostnames and private IP addresses.

If Docker or anything else hardcodes or otherwise messes with hostnames, it's not a problem with this plugin. It is opinionated by design. You can use Consul-based discovery (for which there are examples that use Docker) or not use Docker and rely on the AWS backend which will use the options above.

We are not interested in complicating the AWS backend more to support hybrid scenarios.

galindro commented 6 years ago

@michaelklishin if this plugin has no effect on RABBITMQ_NODENAME, why is it documented?

image

Another thing is: I'm not using 'N' nodes per machine. I'm using 1 node per machine.

michaelklishin commented 6 years ago

@galindro I'm quite confident that parts of the docs is from the first year or so of this plugin, well before private IP addresses or all the countless Consul node name options were introduced. This plugin does not change the way RABBITMQ_NODENAME is used — that happens in the core server's scripts. It DOES expect certain node name values or naming schemes depending on the backend as explained above and that may or may not work well with hardcoded RABBITMQ_NODENAME values.

Our team does not use GitHub issues for questions and discussions. If you have something else to say, take it to rabbitmq-users.

michaelklishin commented 6 years ago

@galindro according to the log, the node name is rabbit@rabbitmq, so exactly the value provided in RABBITMQ_NODENAME. So clearly this is a misunderstanding of some kind => mailing list material.