Skip to content

nats #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged

nats #239

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apps/docs/content/features/cdn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,17 @@ Zerops provides multiple ways to manage and purge cached content before its norm
```sh
# Purge all content for a domain
zsc cdn purge example.com

# Purge specific path
zsc cdn purge example.com /images/
# Purge all content (wildcard)
zsc cdn purge example.com "/*"
# Purge specific file
zsc cdn purge example.com "/path/to/my-file$"
```

:::important
- This command must be executed in any container within the project that has the CDN-enabled domain active
- Currently only works for [Static Mode](#static-mode) CDN
:::

- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:

```sh
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/homepage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export const databases = [
{ name: "Typesense", link: "/typesense/overview", icon: <Icons.typesense/> },
{ name: "Meilisearch", link: "/meilisearch/overview", icon: <Icons.meilisearch/> },
{ name: "Qdrant", link: "/qdrant/overview", icon: <Icons.qdrant/> },
{ name: "NATS", link: "/nats/overview", icon: <Icons.nats/> },
{ name: "KeyDB", link: "/keydb/overview", icon: <Icons.keydb/> },
{ name: "Kafka", icon: <Icons.kafka/> },
{ name: "NATS", icon: <Icons.nats/> },
]

export const storages = [
Expand Down
108 changes: 108 additions & 0 deletions apps/docs/content/nats/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: NATS
desc: Production-ready NATS messaging system on Zerops platform with automated scaling and enterprise reliability. Deploy, manage, and scale with zero infrastructure hassle.
---

import UnorderedList from '@site/src/components/UnorderedList';
import UnorderedCodeList from '@site/src/components/UnorderedCodeList';
import data from '@site/static/data.json';

Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.

## Supported Versions

Currently supported NATS version:
<UnorderedList data={data.nats.readable}/>

Import configuration version:
<UnorderedCodeList data={data.nats.import}/>

## Service Configuration

Our NATS implementation features optimized default settings designed for common use cases.

**Key configuration aspects** include:
- Standard protocol port `4222` for client connections
- HTTP monitoring interface `8222` for management
- Secure authentication with automatically generated credentials
- Optimized settings for performance and reliability

### JetStream Configuration

The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
- **Memory store**: Up to 40GB for high-performance message caching
- **File store**: Up to 250GB for persistent storage
- **Regular sync intervals**: Ensures data durability and consistency
:::note
In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
:::

This configuration provides a robust foundation for message persistence while balancing performance and reliability.

#### Disabling JetStream

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:

- During service creation through the [import configuration](/references/import)
- In the Zerops GUI under service environment variables
- Via the [Zerops API](/references/api) when creating a new service

:::tip
Disabling JetStream may reduce resource usage when persistence isn't required for your application.
:::

### Deployment Modes

:::warning
Deployment mode is selected during service creation and cannot be changed later.
:::

#### Non-HA Mode
- Suitable for development and testing
- Data persistence not guaranteed during node failures
- Lower resource requirements

#### HA Mode
- Creates a multi-node NATS cluster
- Configures routes between cluster nodes automatically
- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
- Provides improved reliability compared to non-HA deployments

### Authentication Management

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:
- The service access details in the Zerops GUI
- Environment variables in your service configuration:
- `user` - Username for authentication (default: "zerops")
- `password` - Generated secure password
- `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`

## Health Monitoring

Zerops continuously monitors your NATS service health using built-in health checks:

- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected

### Health Status

You can check the health status of your NATS service:

1. Through the Zerops GUI dashboard
2. By accessing the management interface at port `8222`

## Backup and Recovery

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.

### Backup Process

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.

For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).

## Support

For advanced configurations or custom requirements:
- Join our [Discord community](https://discord.gg/zerops)
- Contact support via [email](mailto:support@zerops.io)
15 changes: 11 additions & 4 deletions apps/docs/content/references/zsc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,20 @@ zsc cdn [command]

#### Examples
```sh
# Purge CDN cache for a specific domain
# Purge all CDN cache for a specific domain
zsc cdn purge example.com

# Purge CDN cache for a specific path on a domain
zsc cdn purge example.com /images/
# Purge all content using wildcard pattern
zsc cdn purge example.com "/*"
# Purge CDN cache for a specific file (note the $ suffix)
zsc cdn purge example.com "/path/to/my-file$"
# Purge CDN cache for a specific directory
zsc cdn purge example.com "/images/"
```

:::important
- This command must be executed in any container within the project that has the CDN-enabled domain active
- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
:::
---

### shared-storage
Expand Down
38 changes: 29 additions & 9 deletions apps/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ module.exports = {
},
className: "homepage-sidebar-item service-sidebar-item",
},
{
type: "ref",
id: "nats/overview",
label: "NATS",
customProps: {
sidebar_icon: "nats",
},
className: "homepage-sidebar-item service-sidebar-item",
},
{
type: 'ref',
id: 'keydb/overview',
Expand All @@ -424,15 +433,6 @@ module.exports = {
// sidebar_icon: "kafka",
// },
// className: "homepage-sidebar-item service-sidebar-item",
// },
// {
// type: "ref",
// id: "nats/overview",
// label: "NATS",
// customProps: {
// sidebar_icon: "nats",
// },
// className: "homepage-sidebar-item service-sidebar-item",
// },
],
},
Expand Down Expand Up @@ -2274,6 +2274,26 @@ module.exports = {
},
},
],
nats: [
{
type: 'ref',
id: 'homepage',
label: 'Back to home',
customProps: {
sidebar_is_back_link: true,
sidebar_icon: 'back-arrow',
},
},
{
type: 'doc',
id: 'nats/overview',
label: 'Zerops NATS Service',
customProps: {
sidebar_is_title: true,
sidebar_icon: 'nats',
},
},
],
// rabbitmq: [
// {
// type: "ref",
Expand Down
131 changes: 123 additions & 8 deletions apps/docs/static/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12533,11 +12533,17 @@ Zerops provides multiple ways to manage and purge cached content before its norm
```sh
# Purge all content for a domain
zsc cdn purge example.com

# Purge specific path
zsc cdn purge example.com /images/
# Purge all content (wildcard)
zsc cdn purge example.com "/*"
# Purge specific file
zsc cdn purge example.com "/path/to/my-file$"
```

:::important
- This command must be executed in any container within the project that has the CDN-enabled domain active
- Currently only works for [Static Mode](#static-mode) CDN
:::

- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:

```sh
Expand Down Expand Up @@ -22625,9 +22631,9 @@ export const databases = [
{ name: "Typesense", link: "/typesense/overview", icon: <Icons.typesense/> },
{ name: "Meilisearch", link: "/meilisearch/overview", icon: <Icons.meilisearch/> },
{ name: "Qdrant", link: "/qdrant/overview", icon: <Icons.qdrant/> },
{ name: "NATS", link: "/nats/overview", icon: <Icons.nats/> },
{ name: "KeyDB", link: "/keydb/overview", icon: <Icons.keydb/> },
{ name: "Kafka", icon: <Icons.kafka/> },
{ name: "NATS", icon: <Icons.nats/> },
]

export const storages = [
Expand Down Expand Up @@ -28155,6 +28161,108 @@ For advanced configurations or custom requirements:



Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.

## Supported Versions

Currently supported NATS version:
<UnorderedList data={data.nats.readable}/>

Import configuration version:
<UnorderedCodeList data={data.nats.import}/>

## Service Configuration

Our NATS implementation features optimized default settings designed for common use cases.

**Key configuration aspects** include:
- Standard protocol port `4222` for client connections
- HTTP monitoring interface `8222` for management
- Secure authentication with automatically generated credentials
- Optimized settings for performance and reliability

### JetStream Configuration

The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
- **Memory store**: Up to 40GB for high-performance message caching
- **File store**: Up to 250GB for persistent storage
- **Regular sync intervals**: Ensures data durability and consistency
:::note
In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
:::

This configuration provides a robust foundation for message persistence while balancing performance and reliability.

#### Disabling JetStream

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:

- During service creation through the [import configuration](/references/import)
- In the Zerops GUI under service environment variables
- Via the [Zerops API](/references/api) when creating a new service

:::tip
Disabling JetStream may reduce resource usage when persistence isn't required for your application.
:::

### Deployment Modes

:::warning
Deployment mode is selected during service creation and cannot be changed later.
:::

#### Non-HA Mode
- Suitable for development and testing
- Data persistence not guaranteed during node failures
- Lower resource requirements

#### HA Mode
- Creates a multi-node NATS cluster
- Configures routes between cluster nodes automatically
- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
- Provides improved reliability compared to non-HA deployments

### Authentication Management

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:
- The service access details in the Zerops GUI
- Environment variables in your service configuration:
- `user` - Username for authentication (default: "zerops")
- `password` - Generated secure password
- `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`

## Health Monitoring

Zerops continuously monitors your NATS service health using built-in health checks:

- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected

### Health Status

You can check the health status of your NATS service:

1. Through the Zerops GUI dashboard
2. By accessing the management interface at port `8222`

## Backup and Recovery

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.

### Backup Process

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.

For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).

## Support

For advanced configurations or custom requirements:
- Join our [Discord community](https://discord.gg/zerops)
- Contact support via [email](mailto:support@zerops.io)



<FAQ>
<FAQItem question="How do I enable SEO optimization with prerender.io?">
Zerops provides built-in prerender.io support. Simply set the `PRERENDER_TOKEN` environment variable with your prerender.io service token. See our [prerender.io documentation](/nginx/how-to/env-variables#prerenderio-support) for details.
Expand Down Expand Up @@ -46019,13 +46127,20 @@ zsc cdn [command]

#### Examples
```sh
# Purge CDN cache for a specific domain
# Purge all CDN cache for a specific domain
zsc cdn purge example.com

# Purge CDN cache for a specific path on a domain
zsc cdn purge example.com /images/
# Purge all content using wildcard pattern
zsc cdn purge example.com "/*"
# Purge CDN cache for a specific file (note the $ suffix)
zsc cdn purge example.com "/path/to/my-file$"
# Purge CDN cache for a specific directory
zsc cdn purge example.com "/images/"
```

:::important
- This command must be executed in any container within the project that has the CDN-enabled domain active
- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
:::
---

### shared-storage
Expand Down
Loading