目录
Installing on Debian and Ubuntu
将 Apt 与 Cloudsmith 镜像一起使用
安装基本依赖项
启用 apt HTTPS 传输
添加存储库签名密钥
添加存储库 (apt source list) 文件
安装软件包
docker安装rabbitmq
Installing on Debian and Ubuntu
在 Debian 和 Ubuntu 上安装 |RabbitMQ 函数
将 Apt 与 Cloudsmith 镜像一起使用
安装基本依赖项
sudo apt-get update -ysudo apt-get install curl gnupg -y
启用 apt HTTPS 传输
为了让 apt 能够从 Cloudsmith.io 镜像或 Launchpad 下载 RabbitMQ 和 Erlang 包, 必须安装该软件包:apt-transport-https
sudo apt-get install apt-transport-https
添加存储库签名密钥
Cloudsmith 使用自己的 GPG 密钥对分发的软件包进行签名,每个存储库一个密钥。 Team RabbitMQ 的镜像具有相同的内容,因此,包 使用相同的密钥进行签名。
要使用存储库,必须将其签名密钥添加到系统中。 这将使 apt 能够信任由该密钥签名的软件包。
sudo apt-get install curl gnupg apt-transport-https -y## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Community mirror of Cloudsmith: modern Erlang repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Community mirror of Cloudsmith: RabbitMQ repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null
添加存储库 (apt source list) 文件
与所有第三方 apt 存储库一样,描述 RabbitMQ 和 Erlang 软件包存储库的文件 必须放在目录下。 是推荐的位置。/etc/apt/sources.list.d/
/etc/apt/sources.list.d/rabbitmq.list
文件的内容将根据所使用的分发而略有不同。
cd /etc/apt/sources.list.d/
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main## Provides RabbitMQ from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
EOF
安装软件包
更新源列表后,必须运行 :apt
apt-get update
sudo apt-get update -y
然后使用
## Install Erlang packages
sudo apt-get install -y erlang-base \erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \erlang-runtime-tools erlang-snmp erlang-ssl \erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
docker安装rabbitmq
docker run -d --hostname my-rabbit --name mq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULTPASS=123456 -p 5672:5672 -p 15672:15672 rabbitmq:4.0.2-management
#进入容器
docker exec -it rabbitmq /bin/bash
#执行rabbitmq的命令