Configuration
- Config file:
/etc/nats-server.conf - System service:
nats-server - Default port:
4222 - Monitoring endpoint:
http://localhost:8222(通过 SSH 隧道加密)
Credentials
Stored in /etc/nats-server.conf
Accessing NATS
Connection using nats CLI 工具(客户端):
nats sub hello -s nats://USER:PASSWORD@SERVER_IP:4222 nats pub hello "world" -s nats://USER:PASSWORD@SERVER_IP:4222
监控(通过 SSH 隧道)
出于安全考虑,监控端点仅绑定到 localhost.
如需远程访问,请配置 SSH 隧道:
ssh -L 8222:localhost:8222 root@SERVER_IP
然后在浏览器中打开: http://localhost:8222
Service Management
systemctl status nats-server systemctl restart nats-server
***LINKS***[]