RabbitMQ:Docker Compose部署RabbitMQ
创建目录,用于存放Docker Compose
部署RabbitMQ
的yaml
文件:
mkdir -p /root/composefile/rabbitmq
写入该yaml
文件:
vim /root/composefile/rabbitmq/rabbitmq.yaml
内容如下所示:
version: '3'
services:rabbitmq:image: rabbitmq:managementcontainer_name: rabbitmqrestart: alwaysports:- 5672:5672- 15672:15672environment:RABBITMQ_DEFAULT_VHOST: '/'RABBITMQ_DEFAULT_USER: adminRABBITMQ_DEFAULT_PASS: admin
rabbitmq:management
镜像是开启管理插件的RabbitMQ
镜像,开始部署:
docker compose -f /root/composefile/rabbitmq/rabbitmq.yaml up -d[+] Running 11/11? rabbitmq Pulled 33.5s? 08c01a0ec47e Pull complete 17.9s? 1ceb23964d6c Pull complete 18.9s? 64631f643e2c Pull complete 23.1s? 67525726a753 Pull complete 23.4s? 4b28b554c25b Pull complete 25.0s? 3afdc08bc87a Pull complete 25.2s? 1e22dd212ab8 Pull complete 25.3s? b585ed397156 Pull complete 25.4s? 68de743a7628 Pull complete 25.4s? 68b52ebaee48 Pull complete 27.3s
[+] Running 2/2? Network rabbitmq_default Created 1.2s? Container rabbitmq Started 2.0s
查询运行的服务:
docker compose ls
RabbitMQ
服务在运行中。
NAME STATUS
kafka running(3)
rabbitmq running(1)
zookeeper running(3)
查询运行的容器:
docker ps
RabbitMQ
容器在运行中。
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c1ea80c84342 rabbitmq:management "docker-entrypoint.s…" 4 minutes ago Up 3 minutes 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp rabbitmq
78cc8ff2cdb5 wurstmeister/kafka "start-kafka.sh" 9 hours ago Up 9 hours 0.0.0.0:9092->9092/tcp, :::9092->9092/tcp kafka1
c9c058a28f85 wurstmeister/kafka "start-kafka.sh" 9 hours ago Up 9 hours 0.0.0.0:9094->9092/tcp, :::9094->9092/tcp kafka3
cabac80ad5df wurstmeister/kafka "start-kafka.sh" 9 hours ago Up 9 hours 0.0.0.0:9093->9092/tcp, :::9093->9092/tcp kafka2
0b053b25981f zookeeper "/docker-entrypoint.…" 26 hours ago Up 9 hours 2888/tcp, 3888/tcp, 8080/tcp, 0.0.0.0:9001->2181/tcp, :::9001->2181/tcp zookeeper1
394615a4fef7 zookeeper "/docker-entrypoint.…" 26 hours ago Up 9 hours 2888/tcp, 3888/tcp, 8080/tcp, 0.0.0.0:9003->2181/tcp, :::9003->2181/tcp zookeeper3
ef752b5f2a64 zookeeper "/docker-entrypoint.…" 26 hours ago Up 9 hours 2888/tcp, 3888/tcp, 8080/tcp, 0.0.0.0:9002->2181/tcp, :::9002->2181/tcp zookeeper2
访问http://192.168.1.9:15672/
,即可进入RabbitMQ
的管理界面。
使用yaml
文件中定义的账号进行登陆。
使用Docker Compose
部署RabbitMQ
很方便。如果部署出现问题,可以通过查看容器的日志来发现问题。
docker logs rabbitmq2022-02-14 11:00:44.032131+00:00 [info] <0.228.0> Feature flags: list of feature flags found:
2022-02-14 11:00:44.044573+00:00 [info] <0.228.0> Feature flags: [ ] implicit_default_bindings
2022-02-14 11:00:44.044597+00:00 [info] <0.228.0> Feature flags: [ ] maintenance_mode_status
2022-02-14 11:00:44.044623+00:00 [info] <0.228.0> Feature flags: [ ] quorum_queue
2022-02-14 11:00:44.044650+00:00 [info] <0.228.0> Feature flags: [ ] stream_queue
2022-02-14 11:00:44.044699+00:00 [info] <0.228.0> Feature flags: [ ] user_limits
2022-02-14 11:00:44.044712+00:00 [info] <0.228.0> Feature flags: [ ] virtual_host_metadata
2022-02-14 11:00:44.044724+00:00 [info] <0.228.0> Feature flags: feature flag states written to disk: yes
2022-02-14 11:00:44.377772+00:00 [noti] <0.44.0> Application syslog exited with reason: stopped
2022-02-14 11:00:44.377823+00:00 [noti] <0.228.0> Logging: switching to configured handler(s); following messages may not be visible in this log output
2022-02-14 11:00:44.394528+00:00 [noti] <0.228.0> Logging: configured log handlers are now ACTIVE
2022-02-14 11:00:44.622850+00:00 [info] <0.228.0> ra: starting system quorum_queues
2022-02-14 11:00:44.622906+00:00 [info] <0.228.0> starting Ra system: quorum_queues in directory: /var/lib/rabbitmq/mnesia/rabbit@c1ea80c84342/quorum/rabbit@c1ea80c84342
2022-02-14 11:00:44.708687+00:00 [info] <0.265.0> ra: meta data store initialised for system quorum_queues. 0 record(s) recovered
2022-02-14 11:00:44.738407+00:00 [noti] <0.270.0> WAL: ra_log_wal init, open tbls: ra_log_open_mem_tables, closed tbls: ra_log_closed_mem_tables
2022-02-14 11:00:44.759025+00:00 [info] <0.228.0> ra: starting system coordination
2022-02-14 11:00:44.759062+00:00 [info] <0.228.0> starting Ra system: coordination in directory: /var/lib/rabbitmq/mnesia/rabbit@c1ea80c84342/coordination/rabbit@c1ea80c84342
2022-02-14 11:00:44.760480+00:00 [info] <0.278.0> ra: meta data store initialised for system coordination. 0 record(s) recovered
2022-02-14 11:00:44.760597+00:00 [noti] <0.283.0> WAL: ra_coordination_log_wal init, open tbls: ra_coordination_log_open_mem_tables, closed tbls: ra_coordination_log_closed_mem_tables
2022-02-14 11:00:44.767529+00:00 [info] <0.228.0>
2022-02-14 11:00:44.767529+00:00 [info] <0.228.0> Starting RabbitMQ 3.9.13 on Erlang 24.2.1 [jit]
2022-02-14 11:00:44.767529+00:00 [info] <0.228.0> Copyright (c) 2007-2022 VMware, Inc. or its affiliates.
2022-02-14 11:00:44.767529+00:00 [info] <0.228.0> Licensed under the MPL 2.0. Website: https://rabbitmq.com## ## RabbitMQ 3.9.13## ############ Copyright (c) 2007-2022 VMware, Inc. or its affiliates.###### ############ Licensed under the MPL 2.0. Website: https://rabbitmq.comErlang: 24.2.1 [jit]TLS Library: OpenSSL - OpenSSL 1.1.1m 14 Dec 2021Doc guides: https://rabbitmq.com/documentation.htmlSupport: https://rabbitmq.com/contact.htmlTutorials: https://rabbitmq.com/getstarted.htmlMonitoring: https://rabbitmq.com/monitoring.htmlLogs: /var/log/rabbitmq/rabbit@c1ea80c84342_upgrade.log<stdout>Config file(s): /etc/rabbitmq/conf.d/10-default-guest-user.confStarting broker...2022-02-14 11:00:44.769082+00:00 [info] <0.228.0>
...
2022-02-14 11:00:48.954038+00:00 [info] <0.810.0> started TCP listener on [::]:5672completed with 4 plugins.
2022-02-14 11:00:49.050886+00:00 [info] <0.665.0> Server startup complete; 4 plugins started.
2022-02-14 11:00:49.050886+00:00 [info] <0.665.0> * rabbitmq_prometheus
2022-02-14 11:00:49.050886+00:00 [info] <0.665.0> * rabbitmq_management
2022-02-14 11:00:49.050886+00:00 [info] <0.665.0> * rabbitmq_web_dispatch
2022-02-14 11:00:49.050886+00:00 [info] <0.665.0> * rabbitmq_management_agent
可见版本是RabbitMQ3.9.13
,Docker Compose
部署RabbitMQ
就介绍到这里,如果博主有说错的地方或者大家有不同的见解,欢迎大家评论补充。
RabbitMQ:Docker Compose部署RabbitMQ相关推荐
- Docker安装部署RabbitMQ
https://blog.csdn.net/super_rd/article/details/70792746 http://muxiulin.cn/archives/category/rabbit ...
- Docker实战:Docker安装部署RabbitMQ
使用Docker安装部署RabbitMQ 1.docker search rabbitmq:management 2.docker pull rabbitmq:management 注意:如果dock ...
- docker rabbitmq_Docker部署RabbitMQ集群
安装rabbitmq 下载Docker镜像 docker pull rabbitmq:3.7.12-management 安装RabbitMQ mkdir rabbitmq # node1 172.1 ...
- docker 部署rabbitmq,k8s部署rabbitmq集群,跟踪和监控rabbitmq
全栈工程师开发手册 (作者:栾鹏) 架构系列文章 rabbit原理和架构可以参考https://blog.csdn.net/luanpeng825485697/article/details/8208 ...
- docker compose部署服务
1 用docker compose部署服务 - 需求:假如现在我们手里有很多容器,每个容器对应每个服务,有nginx容器,redis容器,mysql容器等.现在我们需要批量化的去管理,批量启动,停止, ...
- 使用Docker Compose 部署Nexus后提示:Unable to create directory /nexus-data/instance
场景 Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/ ...
- 使用Docker Compose 部署Nexus后初次登录账号密码不正确,并且在nexus-data下没有admin.password
场景 Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/ ...
- Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程)
场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...
- Docker Compose部署Nexus3时的docker-compose.yml代码
场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...
最新文章
- linux dns 添加mx,linux dns配置
- mysql json匹配key为数值_干货篇:一篇文章让你——《深入解析MySQL索引原理》
- 正常正则表达式(不允许为空…
- 基于mysql 5.5+mysql-master-ha实现mysql ha架构
- Pycharm中Python3连接Oracle
- VTK:图片之ImageCheckerboard
- 15. 三数之和 golang
- 央视曝光紫砂锅名单_大家看今天中午《每周质量报告》没,美的牌 紫砂锅含有剧毒。家里有这牌子...
- gcc在64位系统上一个史诗级WARNING
- zabbix mysql 脚本路径_Zabbix监控MySQL脚本
- BZOJ 4736 温暖会指引我们前行 LCT+最优生成树+并查集
- GatewayWorker+laravel5.5+layim即时通讯项目demo
- Spring自动扫描
- MySQL是怎么保证主备一致的?
- JavaWeb网上购物系统项目源码+论文
- er studio mysql_解决ER\Studio无法生成mysql列注释问题
- Java初学笔记30-【MiniQQ聊天部分代码】
- 6.5 Introduce Explaining Variable 引入解释性变量
- 商场会员营销小程序-连接会员,赋能商家
- 【内网安全】——msf木马生成教程