When building a test framework/system, RABBITMQ was recently used, and some tools/commands were used to troubleshoot problems, and some notes were recorded here.
Installation, this is not in detail, with Yum tools such as installation (possibly Rabbitmq-server version older), the official website also has rpm package download (version can be the latest).
After installation, start can, do not elaborate.
Add user/vhost/permission settings, I did this:
| The code is as follows |
Copy Code |
Rabbitmqctl Add_user Test Test@smilejay Rabbitmqctl Add_vhost Test_vhost Rabbitmqctl set_permissions-p test_vhost Test ". *" ". *" ". *" |
Delete a queue:
| The code is as follows |
Copy Code |
Rabbitmqadmin list Queues Name # Lists all queue Rabbitmqadmin Delete queue name= ' QueueName ' #删除一个queue |
Delete all queue, you can use the following command (will be all message/queue/vhost/user and so on all delete OH):
| The code is as follows |
Copy Code |
Rabbitmqctl Stop_app Rabbitmqctl Reset Rabbitmqctl Start_app |
Management tools:
After you turn on administrative features with the Rabbitmq-plugins enable Rabbitmq_management command, you can use the Rabbitmqadmin command-line tool for various administrative operations.
Also, management tools provide the Web UI and HTTP APIs to manage RABBITMQ, the Web in http://192.168.222.222:15672/(IP replaced by rabbitmq-server IP).
HTTP API details, or look at the following reference documentation.
When using the Web UI, guest/guest This account password can be logged in localhost; You can set the administrator rights of a user to log in to the Web UI interface for administrative actions by using the following command.
| The code is as follows |
Copy Code |
Rabbitmqctl Add_user Admin 123456 Rabbitmqctl set_user_tags Admin Administrator Rabbitmqctl set_permissions-p/admin ". *" ". *" ". *" |
I think the Web UI and APIs are pretty good and easy to manage.
For a variety of concepts in RABBITMQ, such as: Vhost/exchange/queue, please refer to its official documentation and these two articles.
Http://deepnighttwo.com/post/rabbitmq-1.html
http://blog.csdn.net/cugb1004101218/article/details/21243927