RabbitMQ ubuntu 在线安装
1. ubuntu 20.04,换阿里源
cp /etc/apt/sources.list /etc/apt/sources-bk.list
vim /etc/apt/sources.list
将下面内容放到文件最上面,会先用上面的源去更新文件。这样就不用删下面以前的旧源了。
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
保存后再运行下面的内容。
2.更新包列表
sudo apt update
3.安装RabbitMQ
sudo apt install rabbitmq-server
4.启动RabbitMQ服务
sudo systemctl start rabbitmq-server
5.查看RabbitMQ状态
sudo systemctl status rabbitmq-server
6.(可选)启用RabbitMQ管理插件,以便能够通过Web界面管理RabbitMQ:
sudo rabbitmq-plugins enable rabbitmq_management
7.(可选)创建用户和设置权限(请替换your_username
和your_password
为你想要的用户名和密码):
sudo rabbitmqctl add_user your_username your_password
sudo rabbitmqctl set_user_tags your_username administrator
sudo rabbitmqctl set_permissions -p / your_username ".*" ".*" ".*"