HOW TO: Install NATS Message Broker
In this post I want to share my approach to installing NATS Message Broker and configure cluster. You can find more information in the NATS documentation http://nats.io/documentation/
STEP 1: Get NATS
Download NATS using go
Create folder for bin
Create folder for logs
Create folder for config
STEP 2: Create /etc/nats/nats.config for each node
For example if you have 3 node with following addresses:
1.2.1 nats.config srv1
1.2.2 nats.config srv2
1.2.3 nats.config srv3
STEP 3: Create systemd unit “nats.service”:
nats.service:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
[Unit]
Description=NATS
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/nats/gnatsd -c /etc/nats/nats.config
Restart=always
User=root
Group=root
[Install]
WantedBy=multi-user.target
|
Activate service and start
Comments
Post a Comment