summaryrefslogtreecommitdiff
path: root/docs/rabbitmqctl.1.pod
blob: 2b1d0fafdccb9d2fc512234b251e74d9736bc625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
=head1 NAME

rabbitmqctl - command line tool for managing a RabbitMQ broker

=head1 SYNOPSIS

rabbitmqctl [-n I<node>] I<<command>> [command options]

=head1 DESCRIPTION

RabbitMQ is an implementation of AMQP, the emerging standard for high
performance enterprise messaging. The RabbitMQ server is a robust and
scalable implementation of an AMQP broker.

rabbitmqctl is a command line tool for managing a RabbitMQ broker.
It performs all actions by connecting to one of the broker's nodes.


=head1 OPTIONS

B<-n> I<node>
    default node is C<rabbit@server>, where server is the local host.
    On a host named C<server.example.com>, the node name of the
    RabbitMQ Erlang node will usually be rabbit@server (unless
    RABBITMQ_NODENAME has been set to some non-default value at broker
    startup time).  The output of hostname -s is usually the correct
    suffix to use after the "@" sign. See rabbitmq-server(1) for
    details of configuring the RabbitMQ broker.
   
B<-q>
    quiet output mode is selected with the B<-q> flag. Informational 
    messages are suppressed when quiet mode is in effect.

=head1 COMMANDS

=head2 APPLICATION AND CLUSTER MANAGEMENT

stop
    stop the Erlang node on which RabbitMQ broker is running.

stop_app
    stop the RabbitMQ application, leaving the Erlang node running.
    This command is typically run prior to performing other management
    actions that require the RabbitMQ application to be stopped,
    e.g. I<reset>.
    
start_app
    start the RabbitMQ application.
    This command is typically run prior to performing other management
    actions that require the RabbitMQ application to be stopped,
    e.g. I<reset>.
    
status
    display various information about the RabbitMQ broker, such as
    whether the RabbitMQ application on the current node, its version
    number, what nodes are part of the broker, which of these are
    running.
    
force
    return a RabbitMQ node to its virgin state.
    Removes the node from any cluster it belongs to, removes all data
    from the management database, such as configured users, vhosts and
    deletes all persistent messages.
    
force_reset
    the same as I<force> command, but resets the node unconditionally,
    regardless of the current management database state and cluster
    configuration.
    It should only be used as a last resort if the database or cluster
    configuration has been corrupted.
    
rotate_logs [suffix]
    instruct the RabbitMQ node to rotate the log files. The RabbitMQ
    broker will attempt to append the current contents of the log file
    to the file with the name composed of the original name and the
    suffix. It will create a new file if such a file does not already
    exist. When no I<suffix> is specified, the empty log file is
    simply created at the original location; no rotation takes place.
    When an error occurs while appending the contents of the old log
    file, the operation behaves in the same way as if no I<suffix> was
    specified.
    This command might be helpful when you are e.g. writing your own
    logrotate script and you do not want to restart the RabbitMQ node.
    
cluster I<clusternode> ...
    instruct the node to become member of a cluster with the specified
    nodes determined by I<clusternode> option(s).
    See http://www.rabbitmq.com/clustering.html for more information
    about clustering.
    
=head2 USER MANAGEMENT
    
add_user I<username> I<password>
    create a user named I<username> with (initial) password I<password>.
    
change_password I<username> I<newpassword>
    change the password for the user named I<username> to I<newpassword>.

list_users
    list all users.
    
=head2 ACCESS CONTROL

add_vhost I<vhostpath>
    create a new virtual host called I<vhostpath>.
    
delete_vhost I<vhostpath>
    delete a virtual host I<vhostpath>.
    That command deletes also all its exchanges, queues and user
    mappings.
    
list_vhosts
    list all virtual hosts.
    
map_user_vhost I<username> I<vhostpath>
    grant the user named I<username> access to the virtual host called
    I<vhostpath>.
    
unmap_user_vhost I<username> I<vhostpath>
    deny the user named I<username> access to the virtual host called
    I<vhostpath>.

list_user_vhost I<username> 
    list all the virtual hosts to which the user named I<username> has
    been granted access.
    
=head2 SERVER STATUS

list_queues [-p I<vhostpath>] [I<queueinfoitem> ...]
    list queue information by virtual host. If no I<queueinfoitem>s
    are specified then then name and number of messages is displayed
    for each queue.

=head3 Queue information items

=over 4

name 
    URL-encoded name of the queue

durable 
    whether the queue survives server restarts

auto_delete
    whether the queue will be deleted when no longer used

arguments
    queue arguments

node
    node on which the process associated with the queue resides

messages_ready
    number of messages ready to be delivered to clients

messages_unacknowledged
    number of messages delivered to clients but not yet
    acknowledged

messages_uncommitted
    number of messages published in as yet uncommitted transactions

messages
    sum of ready, unacknowledged and uncommitted messages

acks_uncommitted
    number of acknowledgements received in as yet uncommitted
    transactions

consumers
    number of consumers

transactions
    number of transactions

memory
    bytes of memory consumed by the Erlang process for the queue,
    including stack, heap and internal structures

=back

list_exchanges [-p I<vhostpath>] [I<exchangeinfoitem> ...]
    list exchange information by virtual host. If no
    I<exchangeinfoitem>s are specified then name and type is displayed
    for each exchange.

=head3 Exchange information items

=over 4

name 
    URL-encoded name of the exchange

type
    exchange type (B<direct>, B<topic> or B<fanout>)

durable
    whether the exchange survives server restarts

auto_delete
    whether the exchange is deleted when no longer used

arguments
    exchange arguments

=back

list_bindings [-p I<vhostpath>]
    list bindings by virtual host. Each line contains exchange name,
    routing key and queue name (all URL encoded) and arguments.

list_connections [I<connectioninfoitem> ...]
    list connection information. If no I<connectioninfoitem>s are
    specified then the user, peer address and peer port are displayed.

=head3 Connection information items

=over 4

node
    node on which the process associated with the connection resides

address
    server IP number

port
    server port

peer_address
    peer address

peer_port
    peer port
    
state
    connection state (B<pre-init>, B<starting>, B<tuning>, B<opening>,
    B<running>, B<closing>, B<closed>)

channels
    number of channels using the connection

user
    username associated with the connection

vhost
    URL-encoded virtual host

timeout
    connection timeout

frame_max
    maximum frame size (bytes)

recv_oct
    octets received

recv_cnt
    packets received

send_oct
    octets sent

send_cnt
    packets sent

send_pend
    send queue size
    
=back

The list_queues, list_exchanges and list_bindings commands accept an
optional virtual host parameter for which to display results, defaulting
to I<"/">. The default can be overridden with the B<-p> flag. Result
columns for these commands and list_connections are tab-separated.

=head1 EXAMPLES

Create a user named foo with (initial) password bar at the Erlang node
rabbit@test:

    rabbitmqctl -n rabbit@test add_user foo bar
    
Grant user named foo access to the virtual host called test at the
default Erlang node:

    rabbitmqctl map_user_vhost foo test
    
Append the current logs' content to the files with ".1" suffix and reopen
them:

    rabbitmqctl rotate_logs .1

=head1 SEE ALSO

rabbitmq-multi(1), rabbitmq-server(1)

=head1 AUTHOR

The RabbitMQ Team <info@rabbitmq.com>

=head1 REFERENCES

RabbitMQ Web Site: http://www.rabbitmq.com