Ubuntu apt安装RabbitMQ

释放双眼,带上耳机,听听看~!
  • Ubuntu版本 18.04

设置apt清华源

root@iZ2zeipez8ut08dv6ypru0Z:~# cat /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricted universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverse restricted universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverse restricted universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main multiverse restricted universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverse restricted universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricted universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverse restricted universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverse restricted universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main multiverse restricted universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverse restricted universe

#更新apt源
apt-get update

由于rabbitmq是用erlang语言写的,所以要安装配置erlang环境

root@iZ2zeipez8ut08dv6ypru0Z:~#  apt-get install erlang-nox 

安装rabbitmq

root@iZ2zeipez8ut08dv6ypru0Z:~#  apt-get install rabbitmq-server 

查看rabbitmq运行状态

root@iZ2zeipez8ut08dv6ypru0Z:~# systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ Messaging Server
   Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2022-08-21 17:19:21 CST; 41s ago
 Main PID: 28765 (rabbitmq-server)
    Tasks: 82 (limit: 4915)
   CGroup: /system.slice/rabbitmq-server.service
           ├─28765 /bin/sh /usr/sbin/rabbitmq-server
           ├─28776 /bin/sh -e /usr/lib/rabbitmq/bin/rabbitmq-server
           ├─28853 /usr/lib/erlang/erts-7.3/bin/epmd -daemon
           ├─28914 /usr/lib/erlang/erts-7.3/bin/beam.smp -W w -A 64 -P 1048576 -K true -B i -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabb
           ├─29029 inet_gethost 4
           └─29030 inet_gethost 4

Aug 21 17:19:19 iZ2zeipez8ut08dv6ypru0Z systemd[1]: Starting RabbitMQ Messaging Server...
Aug 21 17:19:20 iZ2zeipez8ut08dv6ypru0Z rabbitmq[28766]: Waiting for rabbit@iZ2zeipez8ut08dv6ypru0Z ...
Aug 21 17:19:20 iZ2zeipez8ut08dv6ypru0Z rabbitmq[28766]: pid is 28776 ...
Aug 21 17:19:21 iZ2zeipez8ut08dv6ypru0Z systemd[1]: Started RabbitMQ Messaging Server.

启用 web端可视化操作界面,我们还需要配置Management Plugin插件

rabbitmq-plugins enable rabbitmq_management   # 启用插件
service rabbitmq-server restart    # 重启

检查rabbitmq端口

root@iZ2zeipez8ut08dv6ypru0Z:~# netstat -lntup|egrep "5672"
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      29630/beam.smp      
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN      29630/beam.smp      
tcp6       0      0 :::5672                 :::*                    LISTEN      29630/beam.smp 

创建管理员用户和密码

rabbitmqctl delete_user guest # 删掉默认guest用户
rabbitmqctl add_user admin admin #  添加新用户
rabbitmqctl set_user_tags admin administrator # 设置用户tag
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"  # 赋予用户默认vhost的全部操作权限

访问: rabbitmq_server:15672 输入admin密码就可以登陆

给TA买糖
共{{data.count}}人
人已赞赏
Ubuntu报错锦集

Code: 210. DB::NetException: Connection refused (localhost:9000)

2022-8-19 18:05:01

ELKStackUbuntu

Ubuntu deb安装Elasticsearch

2022-8-21 18:52:55

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索