RabbitMQ Linux一键安装脚本定制教程
<pre class="brush:cpp;toolbar:false">#!/bin/sh
service rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user admin 123456
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
上面脚本运行只能执行到service rabbitmq-server start,然后就出现rabbitmq server启动的详细打印信息,无法执行下面的启动组件,以及创建用户密码赋予访问权限等操作
<pre class="brush:cpp;toolbar:false">#!/bin/sh
rabbitmq-server -detached
sleep 120
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user root 123456
rabbitmqctl set_user_tags root administrator
rabbitmqctl set_permissions -p "/" root ".*" ".*" ".*"
修改后rabbitmq-server以后台方式启动,继续执行,但是需要睡眠一下,保证rabbitmq server 正常启动之后,进行其他的创建授权操作