Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of the vhost in RabbitMQ?

Tags:

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?

like image 416
aircraft Avatar asked Jul 22 '17 03:07

aircraft


People also ask

How do I get rid of RabbitMQ vhost?

Click on the vhost reset_vhost at the /vhosts path and then on the Delete this Virtual Host button at the bottom of the page. Click ok if prompted by RabbitMQ. The broker will drop the vhost and any related structure. The action does not affect the attached users, it merely removes the vhost.

How do I access vhost?

The solution is easy, because we can simply add the new IP address ( 172.20. 30.50 ) to the VirtualHost directive. The vhost can now be accessed through the new address (as an IP-based vhost) and through the old address (as a name-based vhost).

Can access virtual hosts RabbitMQ?

Different users can be granted access only to specific virtual hosts. Their permissions in each virtual hosts also can be limited. RabbitMQ supports two major authentication mechanisms as well as several authentication and authorisation backends. Password-based authentication has a companion guide.

What are RabbitMQ definitions?

RabbitMQ is a message-queueing software also known as a message broker or queue manager. Simply said; it is software where queues are defined, to which applications connect in order to transfer a message or messages. A message can include any kind of information.


2 Answers

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.

like image 181
Chandan Rai Avatar answered Oct 27 '22 15:10

Chandan Rai


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/

like image 27
Gupta Avatar answered Oct 27 '22 13:10

Gupta