Cấu hình
- Tệp cấu hình:
/etc/nats-server.conf - Dịch vụ hệ thống:
nats-server - Cổng mặc định:
4222 - Điểm giám sát:
http://localhost:8222(bảo mật qua tunnel SSH)
Thông tin xác thực
Được lưu trữ trong /etc/nats-server.conf
Truy cập NATS
Kết nối bằng nats Công cụ CLI (client):
nats sub hello -s nats://USER:PASSWORD@SERVER_IP:4222 nats pub hello "world" -s nats://USER:PASSWORD@SERVER_IP:4222
Giám sát (qua tunnel SSH)
Để đảm bảo bảo mật, endpoint giám sát chỉ được gắn với localhost.
Để truy cập từ xa, hãy thiết lập tunnel SSH:
ssh -L 8222:localhost:8222 root@SERVER_IP
Sau đó mở trình duyệt tại: http://localhost:8222
Quản lý Dịch vụ
systemctl status nats-server systemctl restart nats-server
***LINKS***[]