Skip to content

run a dedicated nats by default #437

Open

Description

@butonic

compose runs the NATS embedded in the opencloud binary. I'd run a dedicated NATS container by default:

  • it survives opencloud restarts: events, the registry and the caches stay available, and with default the storage-users filemetadata cache to nats-js-kv opencloud#4064 the filemetadata cache stays hot
  • memory is attributed correctly: embedded, JetStream buffers and KV buckets count against opencloud, so a growing heap can be a leak or just a large cache. In a dedicated process we can tell them apart and limit each separately.
  • restoring from a backup: stop opencloud, restore the space, flush its cache keys, start opencloud. With the embedded NATS the flush can only happen while opencloud is already running and serving stale metadata.
  • CLI commands and a nats-box work while opencloud is down, which helps when debugging
  • compose looks like the charts, so we debug one setup instead of two

Needed:

  • a nats service with JetStream and a volume for its store
  • OC_EXCLUDE_RUN_SERVICES=nats for opencloud
  • point OC_EVENTS_ENDPOINT, OC_CACHE_STORE_NODES, OC_PERSISTENT_STORE_NODES and MICRO_REGISTRY_ADDRESS to it
  • auth for NATS, it is no longer localhost only
  • a migration note: existing installs keep their JetStream data in $OC_BASE_DATA_PATH/nats, the dedicated NATS starts empty unless we move it

Taking this further: if all supported deployments (compose, charts, ansible) run a dedicated NATS, we could keep the embedded one only for dev and the quickstart, and eventually drop it. That removes nats-server from the opencloud binary, and nats-server security fixes no longer need an opencloud release. Worth its own discussion.

related: opencloud-eu/opencloud#4064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions