简体   繁体   中英

What is the meaning of the vhost in RabbitMQ?

When I set permissions to the rabbitmq user, there is output the vhost :

[root@ha-node1 my.cnf.d]# rabbitmqctl set_permissions openstack ".*" ".*" ".*" 
Setting permissions for user "openstack" in vhost "/" ...

What is the meaning of the vhost when I set permission, and what function does it have?

In RabbitMQ virtual hosts are logical groups of entities, they are similar to virtual hosts in Apache or server blocks in Nginx. Virtual hosts are created using rabbitmqctl or HTTP API and they provide logical grouping and separation of resources. Every virtual host has a name. When an AMQP 0-9-1 client connects to RabbitMQ, it specifies a vhost name to connect to. If authentication succeeds and the username provided was granted permissions to the vhost, connection is established.

Let me say this by giving you an analogy.

  • Vhosts are to Rabbit what virtual machines are to physical servers: Vhosts allow you to run data for multiple applications safely and securely by providing logical separation between instances.

  • This is useful for anything from separating multiple customers on the same Rabbit to avoiding naming collisions on queues and exchanges. Where otherwise you might have to run multiple Rabbits

  • Every RabbitMQ server has a ability to create virtual message brokers called virtual hosts ( vhosts ). Each one is essentially a mini-RabbitMQ server with its own queues, exchanges, and bindings ... etc, more important, with its own permissions .

For details information ref:https://livebook.manning.com/book/rabbitmq-in-action/chapter-2/

When I set permissions to the rabbitmq user, there is output the vhost :

[root@ha-node1 my.cnf.d]# rabbitmqctl set_permissions openstack ".*" ".*" ".*" 
Setting permissions for user "openstack" in vhost "/" ...

What is the meaning of the vhost when I set permission, and what function does it have?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM