ubuntu安装rabbitmq
- 安装所需软件包
sudo apt-get install wget apt-transport-https -y
- 添加密钥,整个一起复制
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
- 添加 Erlang的Launchpad PPA
curl -1sLf "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg > /dev/null
- 添加rabbitmq的仓库
curl -1sLf "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.packagecloud.rabbitmq.gpg > /dev/null
- 添加RabbitMQ团队维护的apt库,整个一起复制,EOF包含的是对list文件的配置
点击查看代码
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
## "bionic" as distribution name should work for any reasonably recent Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main
deb-src [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main
## Provides RabbitMQ
##
## "bionic" as distribution name should work for any reasonably recent Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ bionic main
deb-src [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ bionic main
EOF
deb https://launchpad.proxy.ustclug.org/ubuntu-toolchain-r/test/ubuntu xenial main
上述命令代码中bionic、xenial为ubuntu codename,查看后修改为对应的名称cat /etc/os-release
更新包索引,加上-y可以默认同意一些询问
sudo apt-get update -y
安装Erlang,rabbitmq开发语言,相当于java项目需要jdk环境一样
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
安装rabbitmq-server及其依赖项
sudo apt-get install rabbitmq-server -y --fix-missing
安装apt HTTPS传输
sudo apt-get install apt-transport-https
安装完毕,输入以下命令查看
sudo systemctl status rabbitmq-server或service rabbitmq-server status