你只須要簡單的將隊列綁定到交換機上。一個發送到交換機的消息都會被轉發到與該交換機綁定的全部隊列上。很像子網廣播,每臺子網內的主機都得到了一份複製的消息。Fanout 交換機轉發消息是最快的。mysql
rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpmlinux
yum install -y rabbitmq-server.noarchweb
/sbin/rabbitmq-plugins listsql
/sbin/rabbitmq-plugins enable rabbitmq_management後端
systemctl start rabbitmq-server.service 等價 /sbin/rabbitmq-server start | stop | restart | reload服務器
[root@mage-monitor-01~/]#/sbin/rabbitmqctl add_user xiaoming 123456 Creating user "xiaoming" ... ...done.
也能夠在web頁面操做:登陸http://10.0.0.201:15672 (你本身的IP),用戶guest(超級用戶),密碼:guest架構
[root@mage-monitor-01~/]#/sbin/rabbitmqctl add_vhost test_linux Creating vhost "test_linux" ... ...done.
[root@mage-monitor-01~/]#/sbin/rabbitmqctl set_permissions -p test_linux xiaoming ".*" ".*" ".*" Setting permissions for user "xiaoming" in vhost "test_linux" ... ...done.
[root@mage-monitor-01~/]#/sbin/rabbitmqctl delete_user xiaoming Deleting user "xiaoming" ... ...done.