RabbitMQ Server Administrator's Guide
2012-01-06 19:52
417 查看
RabbitMQServerAdministrator'sGuide
http://www.rabbitmq.com/admin-guide.html#installation
1,RabbitmqDB
第一次启动,会检查是否有数据库,没有则创建一个db,存放在
C:\DocumentsandSettings\Administrator\ApplicationData\RabbitMQ,DB会存储关于user,virtual
host,持久化消息等信息
此目录下有两个文件夹:db,log
并会使用到这些资源:
virtualhost:/
user:guest/guest
guest会分配所有的权限到virtualhost/上
2,命令行管理工具rabbitmqctl
Rabbitmqctl是rabbitmq的一个命令行管理工具,它用来对某个机器上(host)的节点(node)进行管理,本机默认的node名称是”rabbit”,hostname可以使用hostname
–s查看
执行相关命令时,可明确指定一个节点,例如:
rabbitmqctl–nnode_name@host_nameadd_userusernamepassword
这个命令将在指定的机器(host_name)的节点(node_name)上创建一个用户
在启动rabbitmq的时命令行中,可以查看到node名称
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RabbitMQ1.6.0(AMQP8-0)
Copyright(C)2007-2009LShiftLtd.,CohesiveFinancialTechnologiesLLC.,andR
abbitTechnologiesLtd.
LicensedundertheMPL.Seehttp://www.rabbitmq.com/
node:rabbit@WWW-65592D80C4A//这里就是node_name@host_name
log:C:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
log/rabbit.log//日志目录
sasllog:C:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
log/rabbit-sasl.log//日志目录
databasedir:c:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
db/rabbit-mnesia//db目录
startingdatabase...done
startingcoreprocesses...done
startingrecovery...done
startingpersister...done
startingguidgenerator...done
startingbuiltinapplications...done
startingTCPlisteners...done
brokerrunning
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3,查看node状态
rabbitmqctl-qstatus
输出:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
{mnesia,"MNESIACXC13812","4.4.10"},
{os_mon,"CPOCXC13846","2.2.2"},
{sasl,"SASLCXC13811","2.1.6"},
{stdlib,"ERTSCXC13810","1.16.2"},
{kernel,"ERTSCXC13810","2.13.2"}]},
{nodes,['rabbit@WWW-65592D80C4A']},
{running_nodes,['rabbit@WWW-65592D80C4A']}]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4,关闭rabbitmq
rabbitmqctlstop
直接关闭rabbitmq,关闭rabbitmq节点(elr进程也关掉了),需要通过rabbitmq-server才能重新启动
rabbitmqctlstop_app
关闭rabbitmq应用程序,但是erl进行还在,可以通过rabbitmqctl
start_app恢复
rabbitmqctlstart_app
启动rabbitmq应用程序
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlstop_app
Stoppingnode'rabbit@WWW-65592D80C4A'...
...done.
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlstop
Stoppingandhaltingnode'rabbit@WWW-65592D80C4A'...
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5,查看rabbitmq状态
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Statusofnode'rabbit@WWW-65592D80C4A'...
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
{mnesia,"MNESIACXC13812","4.4.10"},
{os_mon,"CPOCXC13846","2.2.2"},
{sasl,"SASLCXC13811","2.1.6"},
{stdlib,"ERTSCXC13810","1.16.2"},
{kernel,"ERTSCXC13810","2.13.2"}]},
{nodes,['rabbit@WWW-65592D80C4A']},
{running_nodes,['rabbit@WWW-65592D80C4A']}]
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6,重置rabbitmq
7,修改日志文件后缀名
rabbit.log.rabbit.log
rabbit-sasl.log.rabbit.log
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlrotate_logs.rabbit.log
Rotatinglogstofileswithsuffix".rabbit.log"...
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8,集群管理
9,rabbitmqctl所有命令:
Usage:rabbitmqctl[-q][-n<node>]<command>[<arg>...]
Availablecommands:
stop-stopstheRabbitMQapplicationandhaltsthenode
stop_app-stopstheRabbitMQapplication,leavingthenoderunning
start_app-startstheRabbitMQapplicationonanalready-runningnode
reset-resetsnodetodefaultconfiguration,deletingalldata
force_reset
cluster<ClusterNode>...
status
rotate_logs[Suffix]
close_connection<ConnectionPid><ExplanationString>
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>...]
list_channels[<ChannelInfoItem>...]
list_consumers[-p<VHostPath>]
Quietoutputmodeisselectedwiththe"-q"flag.Informational
messagesaresuppressedwhenquietmodeisineffect.
<node>shouldbethenameofthemasternodeoftheRabbitMQ
cluster.Itdefaultstothenodenamed"rabbit"onthelocal
host.Onahostnamed"server.example.com",themasternodewill
usuallyberabbit@server(unlessRABBITMQ_NODENAMEhasbeensetto
somenon-defaultvalueatbrokerstartuptime).Theoutputofhostname
-sisusuallythecorrectsuffixtouseafterthe"@"sign.
Thelist_queues,list_exchangesandlist_bindingscommandsacceptan
optionalvirtualhostparameterforwhichtodisplayresults.The
defaultvalueis"/".
<QueueInfoItem>mustbeamemberofthelist[name,durable,
auto_delete,arguments,pid,owner_pid,exclusive_consumer_pid,
exclusive_consumer_tag,messages_ready,messages_unacknowledged,
messages_uncommitted,messages,acks_uncommitted,consumers,
transactions,memory].Thedefaultistodisplaynameand(numberof)
messages.
<ExchangeInfoItem>mustbeamemberofthelist[name,type,durable,
auto_delete,arguments].Thedefaultistodisplaynameandtype.
Theoutputformatfor"list_bindings"isalistofrowscontaining
exchangename,queuename,routingkeyandarguments,inthatorder.
<ConnectionInfoItem>mustbeamemberofthelist[pid,address,port,
peer_address,peer_port,state,channels,user,vhost,timeout,
frame_max,client_properties,recv_oct,recv_cnt,send_oct,send_cnt,
send_pend].Thedefaultistodisplayuser,peer_address,peer_port
andstate.
<ChannelInfoItem>mustbeamemberofthelist[pid,connection,
number,user,vhost,transactional,consumer_count,
messages_unacknowledged,acks_uncommitted,prefetch_count].The
defaultistodisplaypid,user,transactional,consumer_count,
messages_unacknowledged.
Theou
1,RabbitmqDB
第一次启动,会检查是否有数据库,没有则创建一个db,存放在
C:\DocumentsandSettings\Administrator\ApplicationData\RabbitMQ,DB会存储关于user,virtual
host,持久化消息等信息
此目录下有两个文件夹:db,log
并会使用到这些资源:
virtualhost:/
user:guest/guest
guest会分配所有的权限到virtualhost/上
2,命令行管理工具rabbitmqctl
Rabbitmqctl是rabbitmq的一个命令行管理工具,它用来对某个机器上(host)的节点(node)进行管理,本机默认的node名称是”rabbit”,hostname可以使用hostname
–s查看
执行相关命令时,可明确指定一个节点,例如:
rabbitmqctl–nnode_name@host_nameadd_userusernamepassword
这个命令将在指定的机器(host_name)的节点(node_name)上创建一个用户
在启动rabbitmq的时命令行中,可以查看到node名称
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RabbitMQ1.6.0(AMQP8-0)
Copyright(C)2007-2009LShiftLtd.,CohesiveFinancialTechnologiesLLC.,andR
abbitTechnologiesLtd.
LicensedundertheMPL.See
node:rabbit@WWW-65592D80C4A//这里就是node_name@host_name
log:C:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
log/rabbit.log//日志目录
sasllog:C:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
log/rabbit-sasl.log//日志目录
databasedir:c:/DocumentsandSettings/Administrator/ApplicationData/RabbitMQ/
db/rabbit-mnesia//db目录
startingdatabase...done
startingcoreprocesses...done
startingrecovery...done
startingpersister...done
startingguidgenerator...done
startingbuiltinapplications...done
startingTCPlisteners...done
brokerrunning
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3,查看node状态
rabbitmqctl-qstatus
输出:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
{mnesia,"MNESIACXC13812","4.4.10"},
{os_mon,"CPOCXC13846","2.2.2"},
{sasl,"SASLCXC13811","2.1.6"},
{stdlib,"ERTSCXC13810","1.16.2"},
{kernel,"ERTSCXC13810","2.13.2"}]},
{nodes,['rabbit@WWW-65592D80C4A']},
{running_nodes,['rabbit@WWW-65592D80C4A']}]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4,关闭rabbitmq
rabbitmqctlstop
直接关闭rabbitmq,关闭rabbitmq节点(elr进程也关掉了),需要通过rabbitmq-server才能重新启动
rabbitmqctlstop_app
关闭rabbitmq应用程序,但是erl进行还在,可以通过rabbitmqctl
start_app恢复
rabbitmqctlstart_app
启动rabbitmq应用程序
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlstop_app
Stoppingnode'rabbit@WWW-65592D80C4A'...
...done.
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlstop
Stoppingandhaltingnode'rabbit@WWW-65592D80C4A'...
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5,查看rabbitmq状态
rabbitmqctlstatus
rabbitmqctl–qstatus
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Statusofnode'rabbit@WWW-65592D80C4A'...
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
{mnesia,"MNESIACXC13812","4.4.10"},
{os_mon,"CPOCXC13846","2.2.2"},
{sasl,"SASLCXC13811","2.1.6"},
{stdlib,"ERTSCXC13810","1.16.2"},
{kernel,"ERTSCXC13810","2.13.2"}]},
{nodes,['rabbit@WWW-65592D80C4A']},
{running_nodes,['rabbit@WWW-65592D80C4A']}]
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6,重置rabbitmq
rabbitmqctlreset
rabbitmqctlforce_reset
使用force_reset与reset不同之外在于:它会无条件的重置rabbitmq,不管rabbitmqdatabasestate,和rabbitmq已经在集群环境中配置,这个命令应该在迫不得已的情况去使用
重置rabbitmq,会有以下影响:
1,从集群节点中删除
2,删除db数据,如user,vhost信息,持久化消息
重置成功后,必须stoprabbitmq,例如使用:rabbitmqctlstop_app
7,修改日志文件后缀名
rabbitmqctlrotate_logssuffix_name
修改日志文件后缀名,执行以后,可以马上看到log目录下创建了指定后缀的日志文件:
rabbit.log.rabbit.log
rabbit-sasl.log.rabbit.log
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
E:\rabbitmq_server-1.6.0\sbin>rabbitmqctlrotate_logs.rabbit.log
Rotatinglogstofileswithsuffix".rabbit.log"...
...done.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8,集群管理
rabbitmqctlclusterclusternode...
9,rabbitmqctl所有命令:
Usage:rabbitmqctl[-q][-n<node>]<command>[<arg>...]
Availablecommands:
stop-stopstheRabbitMQapplicationandhaltsthenode
stop_app-stopstheRabbitMQapplication,leavingthenoderunning
start_app-startstheRabbitMQapplicationonanalready-runningnode
reset-resetsnodetodefaultconfiguration,deletingalldata
force_reset
cluster<ClusterNode>...
status
rotate_logs[Suffix]
close_connection<ConnectionPid><ExplanationString>
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>...]
list_channels[<ChannelInfoItem>...]
list_consumers[-p<VHostPath>]
Quietoutputmodeisselectedwiththe"-q"flag.Informational
messagesaresuppressedwhenquietmodeisineffect.
<node>shouldbethenameofthemasternodeoftheRabbitMQ
cluster.Itdefaultstothenodenamed"rabbit"onthelocal
host.Onahostnamed"server.example.com",themasternodewill
usuallyberabbit@server(unlessRABBITMQ_NODENAMEhasbeensetto
somenon-defaultvalueatbrokerstartuptime).Theoutputofhostname
-sisusuallythecorrectsuffixtouseafterthe"@"sign.
Thelist_queues,list_exchangesandlist_bindingscommandsacceptan
optionalvirtualhostparameterforwhichtodisplayresults.The
defaultvalueis"/".
<QueueInfoItem>mustbeamemberofthelist[name,durable,
auto_delete,arguments,pid,owner_pid,exclusive_consumer_pid,
exclusive_consumer_tag,messages_ready,messages_unacknowledged,
messages_uncommitted,messages,acks_uncommitted,consumers,
transactions,memory].Thedefaultistodisplaynameand(numberof)
messages.
<ExchangeInfoItem>mustbeamemberofthelist[name,type,durable,
auto_delete,arguments].Thedefaultistodisplaynameandtype.
Theoutputformatfor"list_bindings"isalistofrowscontaining
exchangename,queuename,routingkeyandarguments,inthatorder.
<ConnectionInfoItem>mustbeamemberofthelist[pid,address,port,
peer_address,peer_port,state,channels,user,vhost,timeout,
frame_max,client_properties,recv_oct,recv_cnt,send_oct,send_cnt,
send_pend].Thedefaultistodisplayuser,peer_address,peer_port
andstate.
<ChannelInfoItem>mustbeamemberofthelist[pid,connection,
number,user,vhost,transactional,consumer_count,
messages_unacknowledged,acks_uncommitted,prefetch_count].The
defaultistodisplaypid,user,transactional,consumer_count,
messages_unacknowledged.
Theou
相关文章推荐
- ZooKeeper Administrator's Guide
- Oracle® Database Vault Administrator's Guide 11g Release 2 (11.2)
- 《Administrator's Guide》之Managing Memory
- Database Administrator's Guide这本书讲述了数据库管理的各个方面
- Microsoft Exchange Server 2007: A Beginner's Guide (Paperback), (Network Professional's Library) Aug.2007.eBook-BBL
- Linux Network Administrator's Guide (2nd Edition)
- The Linux System Administrator's Guide
- JavaScript_A Beginner's Guide - Introduction to JavaScript - 09/19/2012
- Host 'xxx.xx.xx-xx.xx.com' is not allowed to connect to this MySQL serverConnection closed by foreig
- "Host 'admin-PC' is not allowed to connect to this MySQLserver"
- PHP $_SERVER['SCRIPT_FILENAME'] 与 __FILE__ 的区别
- JavaScript_A Beginner's Guide - Understanding Functions - 09/22/2012
- 安装 RabbitMQ Windows版
- ADB server didn't ACK 解决方法
- android搭建环境错误 daemon not running. starting it now on port 5037 ADB server didn't ACK
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- mac下面eclipse出现 "Host '192.168.0.204' is not allowed to connect to this MySQL server
- ADB server didn't ACK 解决方法
- The server timezone value 'UTC' is unrecognized or represents more than one timezone