#!/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 ".*" ".*" ".*"
The above script can only be executed to service rabbitmq-server start, and then the detailed print information of rabbitmq server startup appears, and the following startup components cannot be executed, and operations such as creating user passwords to grant access rights are displayed.
#!/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 ".*" ".*" ".*"
After the modification, rabbitmq-server is started in the background and continues to execute, but it needs to sleep for a while to ensure that the rabbitmq server starts normally, and then perform other creation authorization operations