summaryrefslogtreecommitdiff
path: root/docs/rabbitmqctl.1.pod
blob: 6d4aadeb8dcdeccaa87a825a04ebd9172b7009bc (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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
=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

=over 

=item 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.

=item B<-q>

Quiet output mode is selected with the B<-q> flag. Informational
messages are suppressed when quiet mode is in effect.

=back

=head1 COMMANDS

=head2 APPLICATION AND CLUSTER MANAGEMENT

=over

=item stop

Stop the Erlang node on which RabbitMQ broker is running.

=item 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>.

=item 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>.

=item 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.

=item reset

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.

=item force_reset

The same as I<reset> 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.

=item 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.

=item cluster I<clusternode> ...

Instruct the node to become member of a cluster with the specified
nodes determined by I<clusternode> option(s). See
L<http://www.rabbitmq.com/clustering.html> for more information about
clustering.

=back

=head2 USER MANAGEMENT

=over

=item add_user I<username> I<password>

Create a user named I<username> with (initial) password I<password>.

=item delete_user I<username>

Delete the user named I<username>.

=item change_password I<username> I<newpassword>

Change the password for the user named I<username> to I<newpassword>.

=item list_users

List all users, one per line.

=back

=head2 ACCESS CONTROL

=over

=item add_vhost I<vhostpath>

Create a new virtual host called I<vhostpath>.

=item delete_vhost I<vhostpath>

Delete a virtual host I<vhostpath>.  This command deletes also all its
exchanges, queues and user mappings.  

=item list_vhosts

List all virtual hosts, one per line.

=item set_permissions [-p I<vhostpath>] I<username> I<regexp> I<regexp> I<regexp>

Set the permissions for the user named I<username> in the virtual host
I<vhostpath>, granting I<configure>, I<write> and I<read> access to
resources with names matching the first, second and third I<regexp>,
respectively.

=item clear_permissions [-p I<vhostpath>] I<username>

Remove the permissions for the user named I<username> in the virtual
host I<vhostpath>.

=item list_permissions [-p I<vhostpath>]

List all the users and their permissions in the virtual host
I<vhostpath>.  Each output line contains the username and their
I<configure>, I<write> and I<read> access regexps, separated by tab
characters.

=item list_user_permissions I<username> 

List the permissions of the user named I<username> across all virtual
hosts.

=back

=head2 SERVER STATUS

=over

=item list_queues [-p I<vhostpath>] [I<queueinfoitem> ...]

List queue information by virtual host. Each line printed
describes a queue, with the requested I<queueinfoitem> values
separated by tab characters.  If no I<queueinfoitem>s are
specified then I<name> and I<messages> are assumed.

=back

=head3 Queue information items

=over

=item name

name of the queue

=item durable

whether the queue survives server restarts

=item auto_delete

whether the queue will be deleted when no longer used

=item arguments

queue arguments

=item node

node on which the process associated with the queue resides

=item messages_ready

number of messages ready to be delivered to clients

=item messages_unacknowledged

number of messages delivered to clients but not yet acknowledged

=item messages_uncommitted

number of messages published in as yet uncommitted transactions

=item messages

sum of ready, unacknowledged and uncommitted messages

=item acks_uncommitted

number of acknowledgements received in as yet uncommitted transactions

=item consumers

number of consumers

=item transactions

number of transactions

=item memory

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

=back

=over

=item list_exchanges [-p I<vhostpath>] [I<exchangeinfoitem> ...]

List queue information by virtual host. Each line printed describes an
exchange, with the requested I<exchangeinfoitem> values separated by
tab characters.  If no I<exchangeinfoitem>s are specified then I<name>
and I<type> are assumed.

=back

=head3 Exchange information items

=over

=item name 

name of the exchange

=item type

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

=item durable

whether the exchange survives server restarts

=item auto_delete

whether the exchange is deleted when no longer used

=item arguments

exchange arguments

=back

=over

=item list_bindings [-p I<vhostpath>]

List bindings by virtual host. Each line printed describes a binding,
with the exchange name, routing key, queue name and arguments,
separated by tab characters.

=item list_connections [I<connectioninfoitem> ...]

List queue information by virtual host. Each line printed describes an
connection, with the requested I<connectioninfoitem> values separated
by tab characters.  If no I<connectioninfoitem>s are specified then
I<user>, I<peer_address> and I<peer_port> are assumed.

=back

=head3 Connection information items

=over

=item node

node on which the process associated with the connection resides

=item address

server IP number

=item port

server port

=item peer_address

peer address

=item peer_port

peer port

=item state

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

=item channels

number of channels using the connection

=item user

username associated with the connection

=item vhost

virtual host

=item timeout

connection timeout

=item frame_max

maximum frame size (bytes)

=item recv_oct

octets received

=item recv_cnt

packets received

=item send_oct

octets sent

=item send_cnt

packets sent

=item 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.

=head1 OUTPUT ESCAPING

Various items that may appear in the output of rabbitmqctl can contain
arbitrary octets.  If a octet corresponds to a non-printing ASCII
character (values 0 to 31, and 127), it will be escaped in the output,
using a sequence consisting of a backslash character followed by three
octal digits giving the octet's value (i.e., as used in string
literals in the C programming language).  An octet corresponding to
the backslash character (i.e. with value 92) will be escaped using a
sequence of two backslash characters.  Octets with a value of 128 or
above are not escaped, in order to preserve strings encoded with
UTF-8.

The items to which this escaping scheme applies are:

=over

=item *
Usernames

=item *
Virtual host names

=item *
Queue names

=item *
Exchange names

=item *
Regular expressions used for access control

=back

=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.conf(5), rabbitmq-multi(1), rabbitmq-server(1)

=head1 AUTHOR

The RabbitMQ Team <info@rabbitmq.com>

=head1 REFERENCES

RabbitMQ Web Site: L<http://www.rabbitmq.com>