rabbitMQ 是一個AMQP(高級消息隊列協議)協議標準基礎上完整的,可適用企業消息系統。他遵循Mozilla Public License 開源協議。採用Erlang實現的工業級的消息隊列服務器。javascript
AMQP是一個異步消息傳遞所使用的應用層協議規範,做爲線路層協議而不是API(例如JMS)java
Rabbit MQ 是創建在Erlang OTP平臺上,所以須要先安裝Erlang 瀏覽器
1.下載Erlang OTP For Window (otp_win32_R16B02.exe)服務器
2.安裝運行otp_win32_R16B02.exe文件異步
3.配置系統環境變量ERLANG_HOME爲安裝地址中bin文件夾所在目錄spa
1.運行安裝Rabbit MQ Server For window (rabbitmq-server-3.2.3.exe)插件
2.配置激活Management Plugin命令行
默認安裝的Rabbit MQ 監聽端口爲5672code
使用Rabbit MQ 管理插件可以更好的可視化服務器實例狀態,安裝激活使用CMD命令行以下:server
"C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin\rabbitmq-plugins.bat" enable rabbitmq_management
重啓服務才能生效CMD
net stop RabbitMQ && net start RabbitMQ
3.配置用戶密碼設置權限
Rabbit 默認用戶(guest/guest)只能在localhost狀況下使用,因此最好從新建立用戶
cmd命令以下:
c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin 的目錄 2014/11/01 15:04 <DIR> . 2014/11/01 15:04 <DIR> .. 2014/01/23 22:57 817 rabbitmq-echopid.bat 2014/01/23 22:57 1,900 rabbitmq-plugins.bat 2014/01/23 22:57 4,356 rabbitmq-server.bat 2014/01/23 22:57 7,123 rabbitmq-service.bat 2014/01/23 22:57 1,621 rabbitmqctl.bat 5 個文件 15,817 字節 2 個目錄 96,078,618,624 可用字節 c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t list_users Listing users ... guest [administrator] ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t list_vhosts Listing vhosts ... / ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t add_user root admin Creating user "root" ... ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t list_users Listing users ... root [] guest [administrator] ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t set_user_tags root administrator Setting tags for user "root" to [administrator] ... ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t set_permissions -p / root ".*" ".*" ".*" Setting permissions for user "root" in vhost "/" ... ...done. c:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.2.3\sbin>rabbitmqctl.ba t list_users Listing users ... root [administrator] guest [administrator] ...done.
rabbitmqctl.bat經常使用命令以下
add_user <UserName> <Password>
delete_user <UserName>
change_password <UserName> <NewPassword>
list_users
add_vhost <VHostPath>
delete_vhost <VHostPath>
list_vhosts
set_permissions [-p <VHostPath>] <UserName> <Regexp> <Regexp> <Regexp>
clear_permissions [-p <VHostPath>] <UserName>
list_permissions [-p <VHostPath>]
list_user_permissions <UserName>
list_queues [-p <VHostPath>] [<QueueInfoItem> ...]
list_exchanges [-p <VHostPath>] [<ExchangeInfoItem> ...]
list_bindings [-p <VHostPath>]
list_connections [<ConnectionInfoItem> ...]
使用瀏覽器打開http://localhost:15672
訪問Rabbit Mq的管理控制檯 使用配置的用戶root/admin登陸