Отказ от подключения к rabbitmq в docker - PullRequest
0 голосов
/ 21 февраля 2020

Я пытаюсь установить и использовать RabbitMQ с контейнером docker, но, похоже, он не работает. Кажется, что узел не инициализирован даже при начальном успехе из CLI сервера RabbitMQ.

Вот мой Dockerfile с ОС Ubuntu:

FROM ubuntu:latest

# Update system and install dependencies
RUN apt-get update
RUN apt-get install -y wget gnupg2 lsb-release systemd

# Install Erlang
RUN sh -c 'echo "deb https://packages.erlang-solutions.com/ubuntu $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/erlang.list'
RUN wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
RUN apt-key add erlang_solutions.asc
RUN apt-get install -y erlang

# Pre-install RabbitMQ
RUN wget -O - https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add -
RUN echo "deb https://dl.bintray.com/rabbitmq/debian $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/rabbitmq.list

# Install RabbitMQ
RUN apt-get update
RUN apt-get install -y rabbitmq-server apt-transport-https

# Run RabbitMQ
RUN service rabbitmq-server start

# Create RabbitMQ queues
RUN wget http://127.0.0.1:15672/cli/rabbitmqadmin
RUN chmod +x rabbitmqadmin
RUN ./rabbitmqadmin declare queue name=TOPIC durable=true

Вот выходной журнал с ошибкой :

Step 13/15 : RUN wget http://127.0.0.1:15672/cli/rabbitmqadmin
 ---> Running in b60f9ec89c9e
--2020-02-21 16:25:32--  http://127.0.0.1:15672/cli/rabbitmqadmin
Connecting to 127.0.0.1:15672... failed: Connection refused.
The command '/bin/sh -c wget http://127.0.0.1:15672/cli/rabbitmqadmin' returned a non-zero code: 4

Я попытался отобразить состояние сервера RabbitMQ, и вот вывод:

Step 13/16 : RUN service rabbitmq-server status
 ---> Running in fdf33ac265de
Error: unable to perform an operation on node 'rabbit@fdf33ac265de'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@fdf33ac265de
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@fdf33ac265de]

rabbit@fdf33ac265de:
  * connected to epmd (port 4369) on fdf33ac265de
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on fdf33ac265de
  * suggestion: start the node

Current node details:
 * node name: 'rabbitmqcli-96-rabbit@fdf33ac265de'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: kn4A3TpoTuTPpyYI/ZOBew==

The command '/bin/sh -c service rabbitmq-server status' returned a non-zero code: 3

Если у вас есть идея или решение, я хотел бы услышать о это!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...