|
| 1 | +--- |
| 2 | +title: NATS |
| 3 | +desc: Production-ready NATS messaging system on Zerops platform with automated scaling and enterprise reliability. Deploy, manage, and scale with zero infrastructure hassle. |
| 4 | +--- |
| 5 | + |
| 6 | +import UnorderedList from '@site/src/components/UnorderedList'; |
| 7 | +import UnorderedCodeList from '@site/src/components/UnorderedCodeList'; |
| 8 | +import data from '@site/static/data.json'; |
| 9 | + |
| 10 | +Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development. |
| 11 | + |
| 12 | +## Supported Versions |
| 13 | + |
| 14 | +Currently supported NATS version: |
| 15 | +<UnorderedList data={data.nats.readable}/> |
| 16 | + |
| 17 | +Import configuration version: |
| 18 | +<UnorderedCodeList data={data.nats.import}/> |
| 19 | + |
| 20 | +## Service Configuration |
| 21 | + |
| 22 | +Our NATS implementation features optimized default settings designed for common use cases. |
| 23 | + |
| 24 | +**Key configuration aspects** include: |
| 25 | +- Standard protocol port `4222` for client connections |
| 26 | +- HTTP monitoring interface `8222` for management |
| 27 | +- Internal cluster port `4244` for HA deployments |
| 28 | +- Secure authentication with automatically generated credentials |
| 29 | +- Optimized settings for performance and reliability |
| 30 | + |
| 31 | +### JetStream Configuration |
| 32 | + |
| 33 | +The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads: |
| 34 | +- **Memory store**: Up to 32GB for high-performance message caching |
| 35 | +- **File store**: Up to 100GB for persistent storage |
| 36 | +- **Regular sync intervals**: Ensures data durability and consistency |
| 37 | + |
| 38 | +This configuration provides a robust foundation for message persistence while balancing performance and reliability. |
| 39 | + |
| 40 | +#### Disabling JetStream |
| 41 | + |
| 42 | +If you don't need message persistence, you can disable JetStream by setting the `JET_STREAM_ENABLED` environment variable to `0` in your service configuration. This can be done: |
| 43 | + |
| 44 | +- During service creation through the [import configuration](/references/import) |
| 45 | +- In the Zerops GUI under service environment variables |
| 46 | +- Via the [Zerops API](/references/api) when creating a new service |
| 47 | + |
| 48 | +:::tip |
| 49 | +Disabling JetStream may reduce resource usage when persistence isn't required for your application. |
| 50 | +::: |
| 51 | + |
| 52 | +### Deployment Modes |
| 53 | + |
| 54 | +:::warning |
| 55 | +Deployment mode is selected during service creation and cannot be changed later. |
| 56 | +::: |
| 57 | + |
| 58 | +#### Non-HA Mode |
| 59 | +- Suitable for development and testing |
| 60 | +- Data persistence not guaranteed during node failures |
| 61 | +- Lower resource requirements |
| 62 | + |
| 63 | +#### HA Mode |
| 64 | +- Creates a multi-node NATS cluster |
| 65 | +- Configures routes between cluster nodes automatically |
| 66 | +- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability |
| 67 | +- Provides improved reliability compared to non-HA deployments |
| 68 | + |
| 69 | +### Authentication Management |
| 70 | + |
| 71 | +Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through: |
| 72 | +- The service access details in the Zerops GUI |
| 73 | +- Environment variables in your service configuration: |
| 74 | + - `user` - Username for authentication (default: "zerops") |
| 75 | + - `password` - Generated secure password |
| 76 | + - `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}` |
| 77 | + |
| 78 | +## Health Monitoring |
| 79 | + |
| 80 | +Zerops continuously monitors your NATS service health using built-in health checks: |
| 81 | + |
| 82 | +- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222 |
| 83 | +- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected |
| 84 | + |
| 85 | +### Health Status |
| 86 | + |
| 87 | +You can check the health status of your NATS service: |
| 88 | + |
| 89 | +1. Through the Zerops GUI dashboard |
| 90 | +2. By accessing the management interface at port `8222` |
| 91 | + |
| 92 | +## Backup and Recovery |
| 93 | + |
| 94 | +Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed. |
| 95 | + |
| 96 | +### Backup Process |
| 97 | + |
| 98 | +Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally. |
| 99 | + |
| 100 | +For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup). |
| 101 | + |
| 102 | +## Support |
| 103 | + |
| 104 | +For advanced configurations or custom requirements: |
| 105 | +- Join our [Discord community](https://discord.gg/zerops) |
| 106 | +- Contact support via [email](mailto:support@zerops.io) |
0 commit comments