Configuration
- Config file:
/etc/nats-server.conf - System service:
nats-server - Default port:
4222 - Monitoring endpoint:
http://localhost:8222(secured via SSH tunnel)
Credentials
Stored in /etc/nats-server.conf
Accessing NATS
Connection using nats CLI tool (client):
nats sub hello -s nats://USER:PASSWORD@SERVER_IP:4222 nats pub hello "world" -s nats://USER:PASSWORD@SERVER_IP:4222
Monitoring (via SSH tunnel)
For security, the monitoring endpoint is only bound to localhost.
To access it remotely, set up an SSH tunnel:
ssh -L 8222:localhost:8222 root@SERVER_IP
Then open in your browser: http://localhost:8222
Service Management
systemctl status nats-server systemctl restart nats-server
***LINKS***[]