Closed CloudS-Hu closed 1 year ago
.env 配置:
#
# RABBITMQ
# Available RABBITMQ_PLUGINS:
# rabbitmq_amqp1_0,rabbitmq_auth_backend_ldap,rabbitmq_auth_backend_http,rabbitmq_auth_mechanism_ssl,
# rabbitmq_consistent_hash_exchange,rabbitmq_federation,rabbitmq_federation_management,rabbitmq_management,
# rabbitmq_management_agent,rabbitmq_mqtt,rabbitmq_prometheus,rabbitmq_shovel,rabbitmq_shovel_management,
# rabbitmq_stomp,rabbitmq_tracing,rabbitmq_trust_store,rabbitmq_web_stomp,rabbitmq_web_mqtt,
# rabbitmq_web_stomp_examples,rabbitmq_web_mqtt_examples,rabbitmq_delayed_message_exchange
#
RABBITMQ_VERSION=management
RABBITMQ_CONF_FILE=./services/rabbitmq/rabbitmq.yml
RABBITMQ_HOST_PORT_C=5672
RABBITMQ_HOST_PORT_S=15672
RABBITMQ_DEFAULT_USER=myuser
RABBITMQ_DEFAULT_PASS=mypass
RABBITMQ_PLUGINS=rabbitmq_amqp1_0,rabbitmq_delayed_message_exchange
docker-compose.yml 配置
rabbitmq:
build:
context: ./services/rabbitmq
args:
RABBITMQ_VERSION: ${RABBITMQ_VERSION}
RABBITMQ_PLUGINS: ${RABBITMQ_PLUGINS}
container_name: rabbitmq
restart: always
ports:
- "${RABBITMQ_HOST_PORT_C}:5672"
- "${RABBITMQ_HOST_PORT_S}:15672"
environment:
TZ: "$TZ"
RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}"
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}"
networks:
- default
系统环境:
[root@localhost dnmp]# cat /proc/version
Linux version 3.10.0-1160.71.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jun 28 15:37:28 UTC 2022
[root@localhost dnmp]# uname -a
Linux localhost.localdomain 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
我看了容器里面没有rabbitmq_delayed_message_exchange,自己下一个拖进去启用
我看了容器里面没有rabbitmq_delayed_message_exchange,自己下一个拖进去启用
已解决,解决方法
1、在 ./services/rabbitmq/ 下创建 plugins目录,下载插件 rabbitmq_delayed_message_exchange-3.11.1.ez 放到目录中
2、Dockerfile 中添加拷贝脚本 COPY ./plugins /plugins
重新构建并启动容器
=> [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/rabbitmq:management 4.4s => CACHED [1/2] FROM docker.io/library/rabbitmq:management@sha256:4e07766c0f2347d52550e75698b0ef998489f015ca1b59f691d435992381c4da 0.0s => => resolve docker.io/library/rabbitmq:management@sha256:4e07766c0f2347d52550e75698b0ef998489f015ca1b59f691d435992381c4da 0.0s => ERROR [2/2] RUN if [ -z "${PLUGINS##,rabbitmq_amqp1_0,}" ]; then printf "y\n"
0 0.973 Enabling plugins on node rabbit@buildkitsandbox:
0 0.973 rabbitmq_amqp1_0
0 2.009 The following plugins have been configured:
0 2.009 rabbitmq_amqp1_0
0 2.009 rabbitmq_management
0 2.009 rabbitmq_management_agent
0 2.009 rabbitmq_prometheus
0 2.009 rabbitmq_web_dispatch
0 2.009 Applying plugin configuration to rabbit@buildkitsandbox...
0 2.123 The following plugins have been enabled:
0 2.123 rabbitmq_amqp1_0
0 2.123
0 2.123 set 5 plugins.
0 2.123 Offline change; changes will take effect at broker restart.
0 2.793 Enabling plugins on node rabbit@buildkitsandbox:
0 2.793 rabbitmq_delayed_message_exchange
0 3.829 Error:
0 3.829 {:plugins_not_found, [:rabbitmq_delayed_message_exchange]}
failed to solve: executor failed running [/bin/sh -c if [ -z "${PLUGINS##,rabbitmq_amqp1_0,}" ]; then printf "y\n"| rabbitmq-plugins enable rabbitmq_amqp1_0; fi && if [ -z "${PLUGINS##,rabbitmq_auth_backend_ldap,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_auth_backend_ldap; fi && if [ -z "${PLUGINS##,rabbitmq_auth_backend_http,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_auth_backend_http; fi && if [ -z "${PLUGINS##,rabbitmq_auth_mechanism_ssl,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_auth_mechanism_ssl; fi && if [ -z "${PLUGINS##,rabbitmq_consistent_hash_exchange,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_consistent_hash_exchange; fi && if [ -z "${PLUGINS##,rabbitmq_federation,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_federation; fi && if [ -z "${PLUGINS##,rabbitmq_federation_management,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_federation_management; fi && if [ -z "${PLUGINS##,rabbitmq_management_agent,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_management_agent; fi && if [ -z "${PLUGINS##,rabbitmq_mqtt,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_mqtt; fi && if [ -z "${PLUGINS##,rabbitmq_prometheus,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_prometheus; fi && if [ -z "${PLUGINS##,rabbitmq_shovel,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_shovel; fi && if [ -z "${PLUGINS##,rabbitmq_shovel_management,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_shovel_management; fi && if [ -z "${PLUGINS##,rabbitmq_stomp,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_stomp; fi && if [ -z "${PLUGINS##,rabbitmq_trust_store,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_trust_store; fi && if [ -z "${PLUGINS##,rabbitmq_web_stomp,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_web_stomp; fi && if [ -z "${PLUGINS##,rabbitmq_web_mqtt,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_web_mqtt; fi && if [ -z "${PLUGINS##,rabbitmq_web_stomp_examples,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_web_stomp_examples; fi && if [ -z "${PLUGINS##,rabbitmq_web_mqtt_examples,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_web_mqtt_examples; fi && if [ -z "${PLUGINS##,rabbitmq_delayed_message_exchange,}" ]; then printf "y\n" | rabbitmq-plugins enable rabbitmq_delayed_message_exchange; fi]: exit code: 70