Skip to main content

Module cluster_admin

Module cluster_admin 

Source
Expand description

Cluster administration HTTP surface (spec section 11.1, S2A-002).

The /admin/cluster/* endpoints expose the cluster crate’s bootstrap and membership workflows over the daemon’s authenticated admin channel:

GET  /admin/cluster/status        -> bootstrap::cluster_status
POST /admin/cluster/node/drain    -> bootstrap::node_drain
POST /admin/cluster/node/remove   -> bootstrap::node_remove

The node data directory is the database directory (Database::root); the cluster crate keeps its durable records under <db-dir>/cluster-meta/. A server whose database directory carries no cluster identity keeps working exactly as before: the status endpoint reports "standalone" mode and the mutating endpoints answer 409 Conflict.

The node remove confirmation token is never served over HTTP and never written to the audit log: operators obtain it out of band from the CLI (mongreldb-server node remove --data-dir <dir> prints it), per the cluster crate’s contract. Trust material is equally strict — status responses carry the key-free bootstrap::TrustSummary view only.

Functions§

cluster_status_json
The key-free cluster status JSON view shared by the CLI and GET /admin/cluster/status: identity, membership, descriptors, and this binary’s version advertisement (spec section 11.8).
standalone_status_json
The cluster status JSON view when the database directory holds no cluster identity: the server runs exactly as before, standalone.
status_report
cluster status as one JSON report: the cluster view when bootstrapped, the standalone view when no identity exists, or the underlying error (corrupt or unsupported metadata fails closed).