Execute the below command to download the nats-server binary.
Move the nats-server binary to /usr/local/bin.
sudo mv nats-server /usr/local/bin/ |
Make the binary executable.
sudo chmod +x /usr/local/bin/nats-server |
Generate two pairs of NKeys using the nk tool. One pair is for sys user and other for normal user. For a given pair, the key starting with S is the seed key and the one starting with U is the public key. In the nats-server.conf below, you need to paste in the public key of sys user and normal user. Note down the seed key and public key, which will be used in the later parts of installation. Follow this link to install nk tool and generate nkeys https://docs.nats.io/using-nats/nats-tools/nk
Create a nats-server.conf file in /etc directory and make necessary changes.
Sample nats-server.conf
host: 0.0.0.0 |
6. Create nats-server.service file in /etc/systemd/system and make necessary configuration changes.
Sample nats-server.service
|
[Unit]
|
7. Enable and start the service.
sudo systemctl enable nats-server.service |
8. Check the status of the service and verify if nats is shown as running.
sudo systemctl status nats-server.service |