Blogger Information
Blog 11
fans 0
comment 1
visits 13886
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
基于 Docker 安装 RabbitMQ
Alfred的学习笔记
Original
2813 people have browsed it

1.先换源

  1. vi /etc/apt/sources.list

更新成下面的源地址

  1. # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
  2. deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
  3. deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
  4. deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
  5. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
  6. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
  7. deb http://mirrors.aliyun.com/ubuntu/ xenial universe
  8. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  9. deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
  10. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
  11. deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  12. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
  13. deb http://archive.canonical.com/ubuntu xenial partner
  14. deb-src http://archive.canonical.com/ubuntu xenial partner
  15. deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
  16. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
  17. deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
  18. deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
  19. # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
  20. deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

2.更新源

  1. apt-get update

3.查询RabbitMQ镜像

  1. docker search rabbitmq

3.拉取RabbitMQ镜像

  1. docker pull rabbitmq #(镜像未配有控制台)
  2. docker pull rabbitmq:management #(镜像配有控制台)
  3. #注意:rabbitmq是官方镜像,该镜像不带控制台。如果要安装带控制台的镜像,需要在拉取镜像时附带tag标签,例如:management。tag标签可以通过https://hub.docker.com/_/rabbitmq?tab=tags来查询。
  4. #执行
  5. docker pull rabbitmq:management

4.安装RabbitMQ

  1. docker run --name rabbitmq -d -p 15672:15672 -p 5672:5672 rabbitmq:management

常规操作

  1. #启动 RabbitMQ 容器
  2. docker start rabbitmq
  3. #停止 RabbitMQ 容器
  4. docker stop rabbitmq
  5. #重启 RabbitMQ 容器
  6. docker restart rabbitmq
  7. #查看 RabbitMQ 容器进程信息
  8. docker top rabbitmq
  9. #控制台信息
  10. #启动容器后,可以浏览器中访问http://localhost:15672来查看控制台信息。
  11. #RabbitMQ默认的用户名:guest,密码:guest

问题及解决

  1. #docker stop [CONTAINER ID] 失败,导致 docker rm [CONTAINER ID] 失败
  2. docker rm -f [CONTAINER ID] //强制删除
  3. #再次创建容器但是报错,网络节点被占用
  4. #docker: Error response from daemon: endpoint with name rabbitmq already exists in network bridge.
  5. ps -ef | grep rabbitmq
  6. docker network disconnect --force bridge [rabbitmq 节点名称]
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post