amqp

http://www.rabbitmq.com/cookie

# 設置ERLANG_HOME
set ERLANG_HOME=C:\Program Files\erl9.0
set PATH=%ERLANG_HOME%\bin;%PATH%server

# 安裝RabbitMQServer
set RABBITMQ_SERVER=C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.10
set PATH=%RABBITMQ_SERVER%\sbin;%PATH%rabbitmq

# 同步cookie
ren C:\Users\%username%\.erlang.cookie .erlang.cookie.bak
xcopy /y /c /h /r "C:\Windows\.erlang.cookie" "C:\Users\%username%\"隊列

cd /d %RABBITMQ_SERVER%\sbinrem

# 安裝Broker服務
rabbitmq-service install
rabbitmq-service enable
rabbitmq-service start同步

# 移除服務
rabbitmq-service removeit

# 刪除Windows服務
sc delete RabbitMQ
# 啓動RabbitMQ服務
net stop RabbitMQ && net start RabbitMQio

# 中止Broker
rabbitmqctl stop後臺

# 查看Broker狀態
rabbitmqctl statuscli

# 激活Management Plugin
rabbitmq-plugins.bat enable rabbitmq_management

# 默認 username=guest
# 默認 password=guest
# 默認 user_tags=administrator

# 查詢用戶
rabbitmqctl list_users
# 建立管理用戶
rabbitmqctl add_user {username} {passowrd}
# 設置管理員
rabbitmqctl set_user_tags {username} administrator
# 修改密碼
rabbitmqctl change_password {username} {new-passowrd}
# 刪除用戶
rabbitmqctl delete_user {username}
# 示例
rabbitmqctl add_user admin 1234
rabbitmqctl set_user_tags admin administrator
rabbitmqctl change_password admin 12345
# 刪除guest
rabbitmqctl delete_user guest

# 列出權限
rabbitmqctl list_permissions [-p vhost]
# 示例
# 1.列出默認vhost上的權限
rabbitmqctl list_permissions
rabbitmqctl list_permissions -p /
# 2.列出名字爲monitor上的vhost上的權限
rabbitmqctl list_permissions -p monitor

# 設置權限
rabbitmqctl set_permissions [-p vhost] {username} ".*" ".*" ".*"
# 示例
# 1.設置用戶admin在默認vhost的權限
rabbitmqctl set_permissions admin ".*" ".*" ".*"
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
# 2.設置用戶admin在名字爲monitor上的vhost的權限
rabbitmqctl set_permissions -p monitor admin ".*" ".*" ".*"

# 查詢vhosts
rabbitmqctl list_vhosts
# 增長vhost
rabbitmqctl add_vhost {vhost}
# 刪除vhost
rabbitmqctl delete_vhost {vhost}
# 示例
rabbitmqctl add_vhost monitor
rabbitmqctl delete_vhost monitor

# 查詢隊列
rabbitmqctl list_queues [-p vhost]
# 示例
# 1.查詢默認隊列
rabbitmqctl list_queues
rabbitmqctl list_queues -p /
# 2.查詢名字爲monitor的vhost的隊列
rabbitmqctl list_queues -p monitor

# 查看connections
rabbitmqadmin list connections
# 查看exchanges
rabbitmqadmin list exchanges
# 查看bindings
rabbitmqadmin list bindings
# 查看channels
rabbitmqadmin list channels
# 查看queues
rabbitmqadmin list queues
# 查看consumers
rabbitmqadmin list consumers

# rabbitmq的管理後臺
http://localhost:15672
username:guest
password:guest

 

---------------------------------------------------------------

# erlang
set ERLANG_HOME=C:\Program Files\erl9.0
set PATH=%ERLANG_HOME%\bin;%PATH%

# rabbitmq
set RABBITMQ_SERVER=C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.10
set PATH=%RABBITMQ_SERVER%\sbin;%PATH%

#
cd /d %RABBITMQ_SERVER%\sbin

# vhost
rabbitmqctl add_vhost monitor

# users:admin
rabbitmqctl add_user admin 12345
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p monitor admin ".*" ".*" ".*"

# users:client
rabbitmqctl add_user client 12345
rabbitmqctl set_user_tags client administrator
rabbitmqctl set_permissions -p monitor client ".*" ".*" ".*"

# list users rabbitmqctl list_permissions -p monitor  

相關文章
相關標籤/搜索