配置
- 配置文件:
/etc/nats-server.conf - 系统服务:
nats-server - 默认端口:
4222 - 监控端点:
http://localhost:8222(通过SSH隧道实现安全连接)
凭证
存储在 /etc/nats-server.conf
访问NATS
使用连接 nats 命令行工具(客户端):
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@服务器IP
然后在浏览器中打开: http://localhost:8222
服务管理
systemctl status nats-server systemctl restart nats-server
***链接***[]