blob: e9957847744ef7bf66778e83f8789fbc8e0ee8e3 [file] [log] [blame]
Filip Pytlounef5b0af2015-10-06 16:28:32 +02001=========================
2RabbitMQ messaging system
3=========================
4
5RabbitMQ is a complete and highly reliable enterprise messaging system based on the emerging AMQP standard.
6
Filip Pytlounef5b0af2015-10-06 16:28:32 +02007Sample pillars
8==============
9
10Standalone Broker
11-----------------
12
13RabbitMQ as AMQP broker with admin user and vhosts
14
15.. code-block:: yaml
16
17 rabbitmq:
18 server:
19 enabled: true
Buddy Lindsey, Jrf0d58ae2018-07-16 16:36:55 -050020 memory:
21 vm_high_watermark: 0.4
Filip Pytlounef5b0af2015-10-06 16:28:32 +020022 bind:
23 address: 0.0.0.0
24 port: 5672
25 secret_key: rabbit_master_cookie
26 admin:
27 name: adminuser
28 password: pwd
29 plugins:
30 - amqp_client
31 - rabbitmq_management
Nick Metz208245c2017-12-03 16:18:33 +010032 host:
33 '/monitor':
34 enabled: true
35 user: 'monitor'
36 password: 'password'
Filip Pytlounef5b0af2015-10-06 16:28:32 +020037
38RabbitMQ as a Stomp broker
39
40.. code-block:: yaml
41
42 rabbitmq:
43 server:
44 enabled: true
45 secret_key: rabbit_master_cookie
46 bind:
47 address: 0.0.0.0
48 port: 5672
Nick Metz208245c2017-12-03 16:18:33 +010049 host:
50 '/monitor':
51 enabled: true
52 user: 'monitor'
53 password: 'password'
Michael Polenchuk8115f0f2018-05-30 21:27:45 +040054 plugins_runas_user: rabbitmq
Filip Pytlounef5b0af2015-10-06 16:28:32 +020055 plugins:
56 - rabbitmq_stomp
57
58RabbitMQ cluster
59----------------
60
61RabbitMQ as base cluster node
62
63.. code-block:: yaml
64
65 rabbitmq:
66 server:
67 enabled: true
68 bind:
69 address: 0.0.0.0
70 port: 5672
71 secret_key: rabbit_master_cookie
72 admin:
73 name: adminuser
74 password: pwd
75 cluster:
76 enabled: true
77 role: master
78 mode: disc
79 members:
80 - name: openstack1
81 host: 10.10.10.212
82 - name: openstack2
83 host: 10.10.10.213
84
85HA Queues definition
86
87.. code-block:: yaml
88
89 rabbitmq:
90 server:
91 enabled: true
92 ...
Nick Metz208245c2017-12-03 16:18:33 +010093 host:
94 '/monitor':
95 enabled: true
96 user: 'monitor'
97 password: 'password'
98 policies:
99 - name: HA
100 pattern: '^(?!amq\.).*'
101 definition: '{"ha-mode": "all"}'
Kirill Bespalov09e52182017-05-10 14:20:30 +0300102
103
104Enable TLS support
105------------------
106
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300107To enable support of TLS for rabbitmq-server you need to provide a path to cacert, server cert and private key :
108
109.. code-block:: yaml
110
111 rabbitmq:
112 server:
113 enabled: true
114 ...
115 ssl:
116 enabled: True
117 key_file: /etc/rabbitmq/ssl/key.pem
118 cert_file: /etc/rabbitmq/ssl/cert.pem
119 ca_file: /etc/rabbitmq/ssl/ca.pem
120
121To manage content of these files you can either use the following options:
Kirill Bespalov09e52182017-05-10 14:20:30 +0300122
123.. code-block:: yaml
124
125 rabbitmq:
126 server:
127 enabled: true
128 ...
129 ssl:
130 enabled: True
131
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300132 key_file: /etc/rabbitmq/ssl/key.pem
Kirill Bespalov09e52182017-05-10 14:20:30 +0300133 key: |
134 -----BEGIN RSA PRIVATE KEY-----
135 ...
136 -----END RSA PRIVATE KEY-------
137
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300138 ca_file: /etc/rabbitmq/ssl/ca.pem
139 cacert_chain: |
140 -----BEGIN CERTIFICATE-----
141 ...
142 -----END CERTIFICATE-------
143
144 cert_file: /etc/rabbitmq/ssl/cert.pem
Kirill Bespalov09e52182017-05-10 14:20:30 +0300145 cert: |
146 -----BEGIN CERTIFICATE-----
147 ...
148 -----END CERTIFICATE-------
149
150
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300151Or you can use the `salt.minion.cert` salt state which
152creates all required files according to defined reclass model [1]. In this case you need just to enable ssl and nothing more:
Kirill Bespalov09e52182017-05-10 14:20:30 +0300153
154.. code-block:: yaml
155
156 rabbitmq:
157 server:
158 enabled: true
159 ...
160 ssl:
161 enabled: True
Kirill Bespalov09e52182017-05-10 14:20:30 +0300162
163--
164
165Defaut port for TLS is **5671**:
166
167.. code-block:: yaml
168
169 rabbitmq:
170 server:
171 bind:
172 ssl:
173 port: 5671
174
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300175
1761. https://github.com/Mirantis/reclass-system-salt-model/tree/master/salt/minion/cert/rabbitmq
177
178
179
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200180Usage
181=====
182
183Check cluster status, example shows running cluster with 3 nodes: ctl-1, ctl-2, ctl-3
184
185.. code-block:: yaml
186
187 > rabbitmqctl cluster_status
Kirill Bespalov09e52182017-05-10 14:20:30 +0300188
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200189 Cluster status of node 'rabbit@ctl-1' ...
Kirill Bespalov09e52182017-05-10 14:20:30 +0300190 [{nodes,[{disc,['rabbit@ctl-1','rabbit@ctl-2','rabbit@ctl-3']}]},
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200191 {running_nodes,['rabbit@ctl-3','rabbit@ctl-2','rabbit@ctl-1']},
192 {partitions,[]}]
193 ...done.
194
195Setup management user.
196
197.. code-block:: yaml
198
199 > rabbitmqctl add_vhost vhost
200 > rabbitmqctl add_user user alive
201 > rabbitmqctl set_permissions -p vhost user ".*" ".*" ".*"
202 > rabbitmqctl set_user_tags user management
203
204EPD process is Erlang Port Mapper Daemon. It's a feature of the Erlang runtime that helps Erlang nodes to find each other. It's a pretty tiny thing and doesn't contain much state (other than "what Erlang nodes are running on this system?") so it's not a huge deal for it to still be running.
205Although it's running as user rabbitmq, it was started automatically by the Erlang VM when we started. We've considered adding "epmd -kill" to our shutdown script - but that would break any other Erlang apps running on the system; it's more "global" than RabbitMQ.
206
207Read more
208=========
209
210* http://www.rabbitmq.com/admin-guide.html
211* https://github.com/saltstack/salt-contrib/blob/master/states/rabbitmq_plugins.py
212* http://docs.saltstack.com/ref/states/all/salt.states.rabbitmq_user.html
213* http://stackoverflow.com/questions/14699873/how-to-reset-user-for-rabbitmq-management
214* http://www.rabbitmq.com/memory.html
215
216Clustering
217==========
218
219* http://www.rabbitmq.com/clustering.html#auto-config
220* https://github.com/jesusaurus/hpcs-salt-state/tree/master/rabbitmq
221* http://gigisayfan.blogspot.cz/2012/06/rabbit-mq-clustering-python-fabric.html
222* http://docwiki.cisco.com/wiki/OpenStack_Havana_Release:_High-Availability_Manual_Deployment_Guide#RabbitMQ_Installation
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100223
224Documentation and Bugs
225======================
226
227To learn how to install and update salt-formulas, consult the documentation
228available online at:
229
230 http://salt-formulas.readthedocs.io/
231
232In the unfortunate event that bugs are discovered, they should be reported to
233the appropriate issue tracker. Use Github issue tracker for specific salt
234formula:
235
236 https://github.com/salt-formulas/salt-formula-rabbitmq/issues
237
238For feature requests, bug reports or blueprints affecting entire ecosystem,
239use Launchpad salt-formulas project:
240
241 https://launchpad.net/salt-formulas
242
243You can also join salt-formulas-users team and subscribe to mailing list:
244
245 https://launchpad.net/~salt-formulas-users
246
247Developers wishing to work on the salt-formulas projects should always base
248their work on master branch and submit pull request against specific formula.
249
250 https://github.com/salt-formulas/salt-formula-rabbitmq
251
252Any questions or feedback is always welcome so feel free to join our IRC
253channel:
254
255 #salt-formulas @ irc.freenode.net