preface
In recent days, I’m not feeling well. I haven’t written a blog for a long time. I also said that the. Net project Department of the company did it. I used to use scale. I thought I would do it in Java, so I tried my best to learn java last month. I’ve been having trouble with my neck these days, so I don’t want to learn it. I’ve been chasing drama all the time. I’ve also discussed whether or not to do it when I chat with Chen Gong Switch to Java, continue to learn, after a long time of consideration, decided to not toss and continue. Net. Originally, I wanted to take another week off, but my neck is much better recently. I just had nothing to do today, so I studied rabbitmq.
The full name of MQ is message queue. Message queue (MQ) is a communication method between application and application. MQ is a typical representative of the consumer producer model. One end writes messages to the message queue, while the other end can read messages in the queue.
Rabbitmq is a kind of MQ. Here is a detailed introduction to the installation and configuration of rabbitmq. Let’s have a look
1、 Download
Rabbit MQ is built on a powerful Erlang OTP platform. Therefore, before installing rabbitmq, Erlang should be installed first.
erlang:http://www.erlang.org/download.html
rabbitmq:http://www.rabbitmq.com/download.html
2、 Installation
After downloading, install Erlang first and then rabbitmq. Here, I install these two in D: program files
3、 Configuration
1. Using the rabbitmq management plug-in, you can view the status of rabbit MQ server instance in a better visual way.
Open the command window:
Input command:rabbitmq-plugins.bat enable rabbitmq_management
2. Restart the server
net stop RabbitMQ && net start RabbitMQ
At this time, the above error will appear. It is necessary to use the role of administrator. The administrator has opened the CMD command window again to execute the command.
At this point, the service has started.
3. User and authority management
To create the user’s permissions, such as mqtbbl, password binding, etc.
To view existing users and their roles: rabbitmqctl.bat list_ Users has a guest account by default
Add a user:rabbitmqctl.bat add_user username password
You can see that a cywadmin user has been created, but the role of the guest is administrator.
Rabbitmq user roles can be divided into five categories: Super administrator, monitor, policy maker, general manager and others
(1) Super administrator
You can log in to the management console (when the management plugin is enabled), you can view all the information, and you can operate on users and policies.
(2) Monitoring
You can log in to the management console (when the management plugin is enabled), and at the same time, you can view the relevant information of rabbitmq node (process number, memory usage, disk usage, etc.)
(3) Policy maker
You can log in to the management console (when the management plugin is enabled) and manage the policy at the same time.
(4) General manager
You can only log in to the management console (when the management plugin is enabled), and you cannot see the node information and manage the policies.
(5) Others
Unable to log in to the management console, usually ordinary producers and consumers
Let’s add the administrator role to cywadmin
rabbitmqctl.bat set_user_tags username administrator
At this point, the role administrator has been added to cywadmin, or multiple roles can be added to itrabbitmqctl.bat set_user_tags username tag1 tag2 ...
Change Password
The default password of guest is guest, which can be changed
You can also delete users
rabbitmqctl.bat delete_user username
4. Management of message queue
Open with browser http://localhost : 15672 visit rabbit MQ’s management console and log in to the system with the account you just created
The above is mainly to demonstrate the management of the user, through the above management page can not only manage the user, but also manage the user’s authority
summary
The above is the whole content of this article, I hope that the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message and exchange, thank you for your support to developeppaer.