blob: b011af8861f2d144321a1f8ced602772ec86e2e0 [file] [log] [blame]
Filip Pytlounef5b0af2015-10-06 16:28:32 +02001=========================
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +03002Usage
Filip Pytlounef5b0af2015-10-06 16:28:32 +02003=========================
4
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +03005RabbitMQ is a complete and highly reliable enterprise messaging
6system based on the emerging AMQP standard.
Filip Pytlounef5b0af2015-10-06 16:28:32 +02007
Filip Pytlounef5b0af2015-10-06 16:28:32 +02008Sample pillars
9==============
10
11Standalone Broker
12-----------------
13
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +030014RabbitMQ as AMQP broker with admin user and vhosts:
Filip Pytlounef5b0af2015-10-06 16:28:32 +020015
16.. code-block:: yaml
17
18 rabbitmq:
19 server:
20 enabled: true
21 bind:
22 address: 0.0.0.0
23 port: 5672
24 secret_key: rabbit_master_cookie
25 admin:
26 name: adminuser
27 password: pwd
28 plugins:
29 - amqp_client
30 - rabbitmq_management
Nick Metz208245c2017-12-03 16:18:33 +010031 host:
32 '/monitor':
33 enabled: true
34 user: 'monitor'
35 password: 'password'
Filip Pytlounef5b0af2015-10-06 16:28:32 +020036
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +030037RabbitMQ as a Stomp broker:
Filip Pytlounef5b0af2015-10-06 16:28:32 +020038
39.. code-block:: yaml
40
41 rabbitmq:
42 server:
43 enabled: true
44 secret_key: rabbit_master_cookie
45 bind:
46 address: 0.0.0.0
47 port: 5672
Nick Metz208245c2017-12-03 16:18:33 +010048 host:
49 '/monitor':
50 enabled: true
51 user: 'monitor'
52 password: 'password'
Michael Polenchuk8115f0f2018-05-30 21:27:45 +040053 plugins_runas_user: rabbitmq
Filip Pytlounef5b0af2015-10-06 16:28:32 +020054 plugins:
55 - rabbitmq_stomp
56
57RabbitMQ cluster
58----------------
59
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +030060RabbitMQ as base cluster node:
Filip Pytlounef5b0af2015-10-06 16:28:32 +020061
62.. code-block:: yaml
63
64 rabbitmq:
65 server:
66 enabled: true
67 bind:
68 address: 0.0.0.0
69 port: 5672
70 secret_key: rabbit_master_cookie
71 admin:
72 name: adminuser
73 password: pwd
74 cluster:
75 enabled: true
76 role: master
77 mode: disc
78 members:
79 - name: openstack1
80 host: 10.10.10.212
81 - name: openstack2
82 host: 10.10.10.213
83
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +030084HA Queues definition:
Filip Pytlounef5b0af2015-10-06 16:28:32 +020085
86.. code-block:: yaml
87
88 rabbitmq:
89 server:
90 enabled: true
91 ...
Nick Metz208245c2017-12-03 16:18:33 +010092 host:
93 '/monitor':
94 enabled: true
95 user: 'monitor'
96 password: 'password'
97 policies:
98 - name: HA
99 pattern: '^(?!amq\.).*'
100 definition: '{"ha-mode": "all"}'
Kirill Bespalov09e52182017-05-10 14:20:30 +0300101
Kirill Bespalov09e52182017-05-10 14:20:30 +0300102Enable TLS support
103------------------
104
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300105To enable support of TLS for rabbitmq-server you need to provide
106a path to cacert, server cert and private key:
Kirill Bespalovb0cd0ae2017-05-30 17:45:13 +0300107
108.. code-block:: yaml
109
110 rabbitmq:
111 server:
112 enabled: true
113 ...
114 ssl:
115 enabled: True
116 key_file: /etc/rabbitmq/ssl/key.pem
117 cert_file: /etc/rabbitmq/ssl/cert.pem
118 ca_file: /etc/rabbitmq/ssl/ca.pem
119
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300120To manage content of these files you can either use the following
121options:
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
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300152creates all required files according to defined reclass model.
153See
154https://github.com/Mirantis/reclass-system-salt-model/tree/master/salt/minion/cert/rabbitmq
155for details. In this case you need just to enable ssl and nothing more:
Kirill Bespalov09e52182017-05-10 14:20:30 +0300156
157.. code-block:: yaml
158
159 rabbitmq:
160 server:
161 enabled: true
162 ...
163 ssl:
164 enabled: True
Kirill Bespalov09e52182017-05-10 14:20:30 +0300165
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300166Defaut port for TLS is ``5671``:
Kirill Bespalov09e52182017-05-10 14:20:30 +0300167
168.. code-block:: yaml
169
170 rabbitmq:
171 server:
172 bind:
173 ssl:
174 port: 5671
175
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200176Usage
177=====
178
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300179Check cluster status, example shows running cluster with 3 nodes:
180ctl-1, ctl-2, ctl-3
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200181
182.. code-block:: yaml
183
184 > rabbitmqctl cluster_status
Kirill Bespalov09e52182017-05-10 14:20:30 +0300185
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200186 Cluster status of node 'rabbit@ctl-1' ...
Kirill Bespalov09e52182017-05-10 14:20:30 +0300187 [{nodes,[{disc,['rabbit@ctl-1','rabbit@ctl-2','rabbit@ctl-3']}]},
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200188 {running_nodes,['rabbit@ctl-3','rabbit@ctl-2','rabbit@ctl-1']},
189 {partitions,[]}]
190 ...done.
191
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300192Setup management user:
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200193
194.. code-block:: yaml
195
196 > rabbitmqctl add_vhost vhost
197 > rabbitmqctl add_user user alive
198 > rabbitmqctl set_permissions -p vhost user ".*" ".*" ".*"
199 > rabbitmqctl set_user_tags user management
200
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300201EPD process is Erlang Port Mapper Daemon. It's a feature of the
202Erlang runtime that helps Erlang nodes to find each other. It's a
203pretty tiny thing and doesn't contain much state (other than "what
204Erlang nodes are running on this system?") so it's not a huge deal for
205it to still be running.
206
207Although it's running as user rabbitmq, it was started automatically
208by the Erlang VM when we started. We've considered adding "epmd -kill"
209to our shutdown script - but that would break any other Erlang apps
210running on the system; it's more "global" than RabbitMQ.
Filip Pytlounef5b0af2015-10-06 16:28:32 +0200211
212Read more
213=========
214
215* http://www.rabbitmq.com/admin-guide.html
216* https://github.com/saltstack/salt-contrib/blob/master/states/rabbitmq_plugins.py
217* http://docs.saltstack.com/ref/states/all/salt.states.rabbitmq_user.html
218* http://stackoverflow.com/questions/14699873/how-to-reset-user-for-rabbitmq-management
219* http://www.rabbitmq.com/memory.html
220
221Clustering
222==========
223
224* http://www.rabbitmq.com/clustering.html#auto-config
225* https://github.com/jesusaurus/hpcs-salt-state/tree/master/rabbitmq
226* http://gigisayfan.blogspot.cz/2012/06/rabbit-mq-clustering-python-fabric.html
227* http://docwiki.cisco.com/wiki/OpenStack_Havana_Release:_High-Availability_Manual_Deployment_Guide#RabbitMQ_Installation
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100228
229Documentation and Bugs
230======================
231
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300232* http://salt-formulas.readthedocs.io/
233 Learn how to install and update salt-formulas
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100234
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300235* https://github.com/salt-formulas/salt-formula-rabbitmq/issues
236 In the unfortunate event that bugs are discovered, report the issue to the
237 appropriate issue tracker. Use the Github issue tracker for a specific salt
238 formula
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100239
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300240* https://launchpad.net/salt-formulas
241 For feature requests, bug reports, or blueprints affecting the entire
242 ecosystem, use the Launchpad salt-formulas project
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100243
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300244* https://launchpad.net/~salt-formulas-users
245 Join the salt-formulas-users team and subscribe to mailing list if required
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100246
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300247* https://github.com/salt-formulas/salt-formula-rabbitmq
248 Develop the salt-formulas projects in the master branch and then submit pull
249 requests against a specific formula
Filip Pytloun55a7ef02017-02-02 13:02:03 +0100250
OlgaGusarenkoe27a2ea2018-07-31 00:59:36 +0300251* #salt-formulas @ irc.freenode.net
252 Use this IRC channel in case of any questions or feedback which is always
253 welcome