# Morph documentation Every page of the documentation, in reading order. Each page starts with its address. --- # Morph documentation Morph is object storage that runs on your own machines. Applications use it through an S3 API or a REST API. Each bucket carries a storage policy that says how its objects are protected, by replicas or by erasure coding, and on which nodes or sites they are kept. These pages document Morph 0.30.1. ## Where to start | You want to | Go to | |---|---| | Try Morph on one machine | [Quickstart: a single node](tutorials/quickstart-single-node.md) | | Stand up a small cluster | [Deploy a four-node cluster](tutorials/minimal-production-cluster.md) | | Use it from an S3 client | [Store your first object with S3](tutorials/first-steps-with-s3.md) | | Know what S3 features work | [S3 compatibility](reference/s3-compatibility.md) | | Understand the design | [Architecture](explanation/architecture.md) | | Watch a write, a read, three failures and an expansion step by step | [Architecture explorer](/architecture-explorer) | ## How the documentation is organized The pages are of four kinds, and each kind answers a different need. | Kind | Use it when | Start at | |---|---|---| | Tutorials | you are new and want a working result to learn from | [Quickstart](tutorials/quickstart-single-node.md) | | How-to guides | you have a task: deploy, operate, secure, monitor, integrate | [Prepare hosts](how-to/deploy/prepare-hosts.md) | | Reference | you need a fact: an API call, a setting, a metric, a limit | [REST API](reference/rest-api/index.md) | | Explanation | you want to know how it works and why | [Architecture](explanation/architecture.md) | Release notes, upgrade paths and deprecations are under [Releases](releases/release-notes.md). ## For an evaluation | Question | Page | |---|---| | How is data placed and protected? | [Data placement](explanation/data-placement.md), [Erasure coding](explanation/erasure-coding.md), [Replication and consistency](explanation/replication-and-consistency.md) | | What happens when a drive, a node or a site fails? | [Failure domains and self-healing](explanation/failure-domains-and-self-healing.md), [Resilience tests](reference/resilience-tests/index.md) | | Which S3 operations are supported? | [S3 compatibility](reference/s3-compatibility.md) | | How do I size and lay out a cluster? | [Size a cluster](how-to/deploy/size-a-cluster.md), [Deploy across sites](how-to/deploy/deploy-across-sites.md) | | What are the day-two procedures? | [Upgrade](how-to/operate/upgrade.md), [Add storage nodes](how-to/operate/add-storage-nodes.md), [Replace a failed drive](how-to/operate/replace-a-failed-drive.md), [Back up and restore](how-to/operate/back-up-and-restore.md) | | How is access controlled and data encrypted? | [Security model](explanation/security-model.md), [Encrypt data](how-to/secure/encrypt-data.md), [Harden a deployment](how-to/secure/harden-a-deployment.md) | | What can I monitor? | [Metrics](reference/metrics.md), [Set up alerts](how-to/observe/set-up-alerts.md) | | What determines throughput and latency? | [Performance](explanation/performance.md) | | What are the limits of the design? | [Design trade-offs and limitations](explanation/design-trade-offs.md), [Limits](reference/limits.md) | ## For machines The documentation is plain Markdown. An index for language models is at [llms.txt](pathname:///llms.txt), the full text in one file at [llms-full.txt](pathname:///llms-full.txt), and the REST API as an [OpenAPI specification](pathname:///files/morph-api.yaml). --- # Quickstart: a single node In this tutorial you start one Morph node on one machine, complete its installation, register the first administrator, and store and retrieve an object. At the end you remove the node again. Reading and typing take about 15 minutes. The node itself needs about 5 minutes to start after you complete the installation. A single node is for learning and testing. It keeps one replica of each object and has no redundancy. ## Before you start You need: - A Linux or macOS machine with Docker. - The Morph image on that machine. `docker image inspect morphbits/morph:latest` prints the image metadata when it is present. - `curl`, `jq`, `cksum` and `base64`. - TCP ports 9100, 8080, 30333, 20333, 5100 and 9080 free on the machine. Set the variables that the commands on this page use. Choose your own password. ```shell export MORPH_IMAGE=morphbits/morph:latest export MORPH_URL=http://localhost:9100 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` ## 1. Start the Morph container Start the container in the background and publish its ports. ```shell docker run -d --name morphcluster \ -p 9100:9100 -p 8080:8080 -p 30333:30333 \ -p 20333:20333 -p 5100:5100 -p 9080:9080 \ "$MORPH_IMAGE" ``` The container starts in installation mode: only the installer runs, on port 9100. Ask it for its start page. ```shell curl -s -o /dev/null -w '%{http_code}\n' "$MORPH_URL/" ``` The command prints `307`: the installer redirects to its setup page. If the connection is refused, wait a few seconds and repeat the command. ## 2. Complete the installation Tell the installer how this node is reachable. The request makes the node a cluster-type node, which runs the inner ring, a storage node, the console and the S3 gateway in one container (see [Architecture](../explanation/architecture.md)). ```shell curl -s -o /dev/null -w '%{http_code}\n' -X POST "$MORPH_URL/api/v1/start-node" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{ "sn_attributes": [ "node:1" ], "sn_addresses": [ "grpc://localhost:8080" ], "external_address": "localhost", "installer_port": 9100, "ir_port": 20333, "installers_addresses": [ "localhost:9100" ] }' ``` The command prints `204`. The installer now generates the configuration and starts the services. Check the container log for the line that marks the end of the start. ```shell docker logs morphcluster 2>&1 | grep "MORPH CONTAINER STARTED" ``` Repeat the command until it prints a line that contains `✅ MORPH CONTAINER STARTED`. This takes about 5 minutes. ## 3. Register the first administrator The first user of a new node must be an administrator. This one request needs no authentication. ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"name\": \"first-admin\", \"role\": \"admin\", \"password\": \"$ADMIN_PASSWORD\" }" ``` The response is: ```http HTTP/1.1 201 Created ... Registration completed. ``` A response `401 Unauthorized` with the text `Bearer token is required.` means that the first administrator is already registered. ## 4. Log in Log in and keep the token from the response. Every further request carries it in the `Authorization` header. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{\"login\": \"first-admin\", \"password\": \"$ADMIN_PASSWORD\"}" | jq -r .token) echo "$TOKEN" ``` The command prints the token, a long string of letters and digits. ## 5. Check that the storage node is in the network map A bucket can be created only when the network map holds enough storage nodes for its storage policy. Count the storage nodes in the network map. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq '.nodes | length' ``` The command prints `1`. If it prints `0`, the storage node has not entered the network map yet. Repeat the command until it prints `1`. ## 6. Create a bucket Create the bucket `my-bucket`. `REP-1` is a built-in storage policy that keeps one replica of each object (see [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md)). The basic ACL below lets the owner do everything and lets others read. ```shell curl -s -o /dev/null -w '%{http_code}\n' -X POST "$MORPH_URL/api/v1/buckets" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-1", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": true, "head": true, "put": false, "delete": false, "search": true } } }' ``` The command prints `201`. List your buckets to see the new one. ```shell curl -s "$MORPH_URL/api/v1/buckets?user=first-admin" \ -H "Authorization: Bearer $TOKEN" | jq .buckets ``` The output contains `my-bucket`. ## 7. Upload an object Create a small file. ```shell echo "test string" > my-object.txt ``` Upload it as `my-object`. The request body is the file content. The object name travels in the `x-morph-path` header, encoded in Base64. ```shell export OID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "x-morph-path: $(printf '%s' my-object | base64)" \ --data-binary @my-object.txt | jq -r .oid) echo "$OID" ``` The command prints the object ID, for example `DUPHr5F9TR7eQBj632Cbm89RwRnh2T5yUkGax92PJ1Ua`. Object names are not unique in a bucket, so the object ID is what addresses this exact object. ## 8. Download the object and compare checksums Download the object by its ID into a new file. ```shell curl -s -o downloaded.txt "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" ``` Compare the checksums of the original and the downloaded file. ```shell cksum my-object.txt downloaded.txt ``` The command prints one line per file. The first two numbers, the checksum and the size in bytes, are the same on both lines. ## 9. Open the web console Open `http://localhost:9100` in a browser and log in as `first-admin` with your password. The console shows `my-bucket` and the object in it. The same address serves the interactive API documentation at `http://localhost:9100/api/docs`. ## 10. Stop and remove the container Stop the container, then remove it. ```shell docker stop morphcluster docker rm morphcluster ``` Check that it is gone. ```shell docker ps -a --filter name=morphcluster ``` The command prints only the header line. This container had no volumes, so removing it also removes the bucket and the object. ## What you have learned - A Morph node is one Docker container. It starts in installation mode and becomes a working node after `POST /api/v1/start-node`. - The first registered user is the administrator. Requests authenticate with the token from `POST /api/v1/login`. - A bucket is created with a storage policy and a basic ACL. - An upload returns an object ID, and the object ID addresses the object for download. ## Next steps - [Deploy a four-node cluster](minimal-production-cluster.md) to get redundancy. - [Store your first object with S3](first-steps-with-s3.md) to use the S3 endpoint on port 9080. - [Store your first object with the REST API](first-steps-with-the-rest-api.md) for storage policies, object lifetimes and deletion. - [Configure drives and shards](../how-to/deploy/configure-drives.md) to keep data on host drives instead of inside the container. - [Ports and protocols](../reference/ports-and-protocols.md) for the meaning of each published port. --- # Deploy a four-node cluster In this tutorial you install four cluster-type Morph nodes that form one cluster. Each node runs an inner ring node and a storage node, so the cluster has four inner ring nodes and four storage nodes. You then create a bucket that keeps three replicas of each object, stop one node, and read the object again. You run all four Morph containers on one machine, each on its own set of ports. This teaches the installation procedure. It is not a production layout: one machine is one failure domain. The section [On four separate hosts](#on-four-separate-hosts) shows what changes when each node has its own host. ## Before you start You need: - A Linux machine with Docker and the Morph image (`docker image inspect morphbits/morph:latest` prints the image metadata). - `curl`, `jq`, `cksum` and `base64`. - The IP address of the machine on your network, for example `192.168.50.10`. The containers reach each other through this address. `localhost` does not work here, because inside a container it means the container itself. - The TCP ports in the table of step 1 free on the machine. - The [quickstart](quickstart-single-node.md) done once, so that the requests are familiar. Set the variables that the commands on this page use. Replace the address with the address of your machine and choose your own password. ```shell export MORPH_IMAGE=morphbits/morph:latest export HOST_IP=192.168.50.10 export MORPH_URL=http://localhost:9100 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` ## 1. Start four Morph containers Each container uses the same ports inside. On the host, each container gets its own ports. | Container | Console and installer | Storage node gRPC | Chain RPC | Inner ring consensus | S3 | |---|---|---|---|---|---| | `morphcluster` | 9100 | 8080 | 30333 | 20333 | 9080 | | `morphcluster2` | 9200 | 8180 | 31333 | 21333 | 9180 | | `morphcluster3` | 9300 | 8280 | 32333 | 22333 | 9280 | | `morphcluster4` | 9400 | 8380 | 33333 | 23333 | 9380 | Start the four containers in the background. ```shell docker run -d -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 9080:9080 --name morphcluster "$MORPH_IMAGE" docker run -d -p 9200:9100 -p 8180:8080 -p 31333:30333 -p 21333:20333 -p 9180:9080 --name morphcluster2 "$MORPH_IMAGE" docker run -d -p 9300:9100 -p 8280:8080 -p 32333:30333 -p 22333:20333 -p 9280:9080 --name morphcluster3 "$MORPH_IMAGE" docker run -d -p 9400:9100 -p 8380:8080 -p 33333:30333 -p 23333:20333 -p 9380:9080 --name morphcluster4 "$MORPH_IMAGE" ``` Check that all four are running. ```shell docker ps --filter name=morphcluster --format '{{.Names}}' ``` The command prints the four container names. Check that every installer is ready to receive the installation request. ```shell for port in 9100 9200 9300 9400; do curl -s -o /dev/null -w "port $port: %{http_code}\n" "http://localhost:$port/" done ``` Each line must show `307`: the installer redirects to its setup page. If any port returns a different status or refuses the connection, wait a few seconds and repeat the command. Continue only when all four return `307`. ## 2. Start the installation on every node Every node receives one `POST /api/v1/start-node` request. The request tells the node its own addresses and the installer addresses of all nodes of the cluster. | Field | Meaning | Value for `morphcluster` | |---|---|---| | `sn_attributes` | Attributes of the storage node, as `key:value`. Storage policies select nodes by them. | `["node:1"]` | | `sn_addresses` | Addresses that the storage node announces to the cluster. | `["grpc://192.168.50.10:8080"]` | | `external_address` | Address under which the other nodes reach this node. | `192.168.50.10` | | `installer_port` | Published port of this node's installer. This release does not evaluate the field; the other nodes find the installer through `installers_addresses`. | `9100` | | `ir_port` | Port under which the other nodes reach this node's inner ring consensus. | `20333` | | `installers_addresses` | Installer addresses of all nodes, this node included. The list is the same in every request. | the four addresses below | Put the list of installers into a variable, because every request carries the same list. ```shell INSTALLERS="[\"$HOST_IP:9100\",\"$HOST_IP:9200\",\"$HOST_IP:9300\",\"$HOST_IP:9400\"]" echo "$INSTALLERS" ``` The command prints the list with your address in it. Define a helper that sends the request to one node. Its arguments are the node number, the installer port, the storage node port and the inner ring consensus port of that node. ```shell start_node() { curl -s -o /dev/null -w "node $1: %{http_code}\n" \ -X POST "http://localhost:$2/api/v1/start-node" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"sn_attributes\": [\"node:$1\"], \"sn_addresses\": [\"grpc://$HOST_IP:$3\"], \"external_address\": \"$HOST_IP\", \"installer_port\": $2, \"ir_port\": $4, \"installers_addresses\": $INSTALLERS }" } ``` Send the request to each of the four nodes. ```shell start_node 1 9100 8080 20333 start_node 2 9200 8180 21333 start_node 3 9300 8280 22333 start_node 4 9400 8380 23333 ``` Each command prints the node number and the HTTP status `204`. The installers now exchange their inner ring keys and addresses. A node continues only after it has heard from every installer in the list, so the installation proceeds once all four nodes have received their request. ## 3. Wait until every node has started Look for the line that marks the end of the start in each container log. ```shell for c in morphcluster morphcluster2 morphcluster3 morphcluster4; do docker logs "$c" 2>&1 | grep "MORPH CONTAINER STARTED" done ``` Repeat the command until it prints four lines that contain `✅ MORPH CONTAINER STARTED`. ## 4. Register the first administrator and log in Register the first administrator on the first node. Users are recorded on the FS chain, so one registration serves the whole cluster. ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"name\": \"first-admin\", \"role\": \"admin\", \"password\": \"$ADMIN_PASSWORD\" }" ``` The response starts with `HTTP/1.1 201 Created` and ends with `Registration completed.` Log in and keep the token. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{\"login\": \"first-admin\", \"password\": \"$ADMIN_PASSWORD\"}" | jq -r .token) echo "$TOKEN" ``` The command prints the token. Log in on the second node with the same account to see that it knows the user. ```shell curl -s -o /dev/null -w '%{http_code}\n' -X POST "http://localhost:9200/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{\"login\": \"first-admin\", \"password\": \"$ADMIN_PASSWORD\"}" ``` The command prints `200`. ## 5. Check the cluster Count the storage nodes in the network map. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq '.nodes | length' ``` The command prints `4`. If it prints a smaller number, not every storage node has entered the network map yet. Repeat the command until it prints `4`. List the addresses that the storage nodes announce. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq -r '.nodes[].endpoints[]' ``` The command prints the four `sn_addresses` values that you sent in step 2. List the built-in storage policies. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-policies" \ -H "Authorization: Bearer $TOKEN" | jq -r '.policies[].name' ``` The output contains `REP-1` and `REP-3`. ## 6. Create a bucket with three replicas Create the bucket `my-bucket` with the storage policy `REP-3`. This policy keeps three replicas of each object, each on a different storage node (see [Data placement](../explanation/data-placement.md)). ```shell curl -s -o /dev/null -w '%{http_code}\n' -X POST "$MORPH_URL/api/v1/buckets" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-3", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": true, "head": true, "put": false, "delete": false, "search": true } } }' ``` The command prints `201`. A `409` with the text `Inapplicable policy.` means that the network map does not hold enough storage nodes for the policy yet: go back to step 5. Read the bucket back and look at its storage policy. ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" | jq '.placementPolicy.replicas' ``` The output shows one rule with `"count": 3`. ## 7. Upload an object Create a small file and upload it as `my-object`. ```shell echo "test string" > my-object.txt export OID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "x-morph-path: $(printf '%s' my-object | base64)" \ --data-binary @my-object.txt | jq -r .oid) echo "$OID" ``` The command prints the object ID. Download the object and compare it with the original. ```shell curl -s -o downloaded.txt "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" cksum my-object.txt downloaded.txt ``` The checksum and the size are the same on both lines. ## 8. Stop one node and read the object again Stop the fourth node. ```shell docker stop morphcluster4 docker ps --filter name=morphcluster --format '{{.Names}}' ``` The second command prints three container names. Download the object again through the first node. ```shell curl -s -o downloaded-again.txt "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" cksum my-object.txt downloaded-again.txt ``` The checksum and the size are again the same on both lines. The object has three replicas on three of the four storage nodes, so at least two replicas are on nodes that still run, and a read needs one. The inner ring also keeps working: with four inner ring nodes, three are enough to produce blocks on the FS chain. With only two of four, the chain stops, and with it bucket creation and access-rule changes (see [Inner ring and FS chain](../explanation/inner-ring-and-fs-chain.md)). This tutorial stops here. What the cluster does about a node that stays away, and what you do about it, is the subject of [Handle a node failure](../how-to/operate/handle-a-node-failure.md). ## 9. Remove the cluster Remove the four containers. ```shell docker rm -f morphcluster morphcluster2 morphcluster3 morphcluster4 docker ps -a --filter name=morphcluster ``` The second command prints only the header line. The containers had no volumes, so the buckets and objects are removed with them. ## On four separate hosts On four hosts the procedure is the same. Three things change. **Ports.** Each host runs one Morph container, so every container publishes the default ports and no remapping is needed: ```shell docker run -d -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 9080:9080 --name morphcluster "$MORPH_IMAGE" ``` **Addresses.** Each node announces the address of its own host. For hosts `192.168.50.11` to `192.168.50.14`, the request to the first host carries: | Field | Value on host `192.168.50.11` | |---|---| | `sn_addresses` | `["grpc://192.168.50.11:8080"]` | | `external_address` | `192.168.50.11` | | `installer_port` | `9100` | | `ir_port` | `20333` | The other three requests differ only in the host address. `external_address` can be an IP address or a DNS name. **The list of installers.** `installers_addresses` lists the four hosts with the installer port, and is still the same in every request: ```json ["192.168.50.11:9100", "192.168.50.12:9100", "192.168.50.13:9100", "192.168.50.14:9100"] ``` Each request goes to the installer of the host it describes, for example `http://192.168.50.11:9100/api/v1/start-node`. The hosts must reach each other on the published ports. The `docker run` command above leaves out the metadata chain ports 20334 and 21334, which only buckets with a metadata consistency setting use. For a deployment that publishes them, keeps data on host drives and uses TLS, follow [Install a cluster](../how-to/deploy/install-a-cluster.md). ## What you have learned - A cluster is formed by giving every node the same list of installer addresses in `POST /api/v1/start-node`. - Each node announces its own storage node address, external address and ports. - A user registered on one node exists on all nodes. - With the `REP-3` storage policy, an object stays readable when one of four nodes is stopped. - The number of inner ring nodes is fixed for the life of the cluster. Four inner ring nodes need three to make progress. ## Next steps - [Prepare hosts](../how-to/deploy/prepare-hosts.md) and [Install a cluster](../how-to/deploy/install-a-cluster.md) for a deployment on separate hosts. - [Size a cluster](../how-to/deploy/size-a-cluster.md) to decide on the number of inner ring and storage nodes. - [Add storage nodes](../how-to/operate/add-storage-nodes.md) to grow the cluster with storage-type nodes. - [Failure domains and self-healing](../explanation/failure-domains-and-self-healing.md) for what happens after a node fails. - [Installer API](../reference/installer-api.md) for every field of the installation requests. --- # Store your first object with S3 In this tutorial you obtain S3 credentials from Morph, configure the AWS CLI for the S3 endpoint of your node, and then create a bucket, upload an object, list it, download it and delete it. ## Before you start You need: - A running single Morph node with the first administrator `first-admin` registered and the storage node in the network map: steps 1 to 5 of the [quickstart](quickstart-single-node.md), on a fresh node. The quickstart publishes the S3 endpoint on port 9080. - The AWS CLI (`aws`), `curl`, `jq` and `cksum`. Set the variables that the commands on this page use. Use the password that you chose for `first-admin`. ```shell export MORPH_URL=http://localhost:9100 export S3_URL=http://localhost:9080 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` ## 1. Log in to the console API Morph issues S3 credentials through the console API, so log in first. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{\"login\": \"first-admin\", \"password\": \"$ADMIN_PASSWORD\"}" | jq -r .token) echo "$TOKEN" ``` The command prints the token. ## 2. Create S3 credentials Ask the console for S3 credentials for your user. The only required field is a name for the credentials. Without further fields the credentials may create and delete buckets and read and write objects, and they are valid for 30 days (see [Manage S3 credentials](../how-to/secure/manage-s3-credentials.md)). ```shell S3_CREDENTIALS=$(curl -s -X POST "$MORPH_URL/api/v1/users/first-admin/s3-tokens" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{"tokenName": "tutorial"}') export S3_ACCESS_KEY=$(echo "$S3_CREDENTIALS" | jq -r .access_key_id) export S3_SECRET_KEY=$(echo "$S3_CREDENTIALS" | jq -r .secret_access_key) echo "$S3_ACCESS_KEY" ``` The command prints the access key ID. The response holds two fields, `access_key_id` and `secret_access_key`. Keep both: they are the two halves of the S3 credentials. List the S3 credentials of your user. ```shell curl -s "$MORPH_URL/api/v1/users/first-admin/s3-tokens" \ -H "Authorization: Bearer $TOKEN" | jq -r '.tokens[].name' ``` The output contains the name `tutorial`. ## 3. Configure the AWS CLI Store the credentials and the settings in an AWS CLI profile named `morph`. Every S3 command below selects it with `--profile morph`, so credentials already exported in the shell do not override the profile's credentials. ```shell aws configure set aws_access_key_id "$S3_ACCESS_KEY" --profile morph aws configure set aws_secret_access_key "$S3_SECRET_KEY" --profile morph aws configure set region us-east-1 --profile morph aws configure set s3.addressing_style path --profile morph ``` The four settings are: | Setting | Value | Why | |---|---|---| | Access key ID and secret access key | from step 2 | They identify your Morph user to the S3 gateway. | | Region | `us-east-1` | The AWS CLI needs a region name to sign requests. The gateway does not compare it with a configured value. | | Addressing style | `path` | The S3 gateway of a Morph node has no domain configured for virtual-hosted-style access, so the bucket name goes into the path: `http://localhost:9080/my-bucket/my-object`. | | Endpoint | `--endpoint-url "$S3_URL"` on each command | It sends the request to your node instead of to AWS. | The AWS CLI signs requests with AWS Signature Version 4, which is what the gateway verifies. No signature setting is needed. List your buckets to check the configuration. ```shell aws --profile morph s3api list-buckets --endpoint-url "$S3_URL" --query 'Buckets[].Name' ``` The command succeeds and prints no bucket names, because you have no buckets yet. An error about the signature or the access key means that step 2 or the profile is wrong. ## 4. Create a bucket Create the bucket `my-bucket`. A bucket created without a location constraint gets the default storage policy of the cluster, which on a single node is `REP-1`: one replica (see [How S3 maps onto Morph](../explanation/s3-on-morph.md)). ```shell aws --profile morph s3api create-bucket --bucket my-bucket --endpoint-url "$S3_URL" ``` List your buckets again. ```shell aws --profile morph s3api list-buckets --endpoint-url "$S3_URL" --query 'Buckets[].Name' ``` The output now contains `my-bucket`. If `create-bucket` reports `BucketAlreadyOwnedByYou`, the AWS CLI retried the request and the first attempt had already created the bucket. The listing shows that the bucket exists. ## 5. Upload an object Create a small file and upload it under the key `my-object`. ```shell echo "test string" > my-object.txt aws --profile morph s3api put-object --bucket my-bucket --key my-object --body my-object.txt \ --endpoint-url "$S3_URL" ``` The command prints a JSON document with the `ETag` of the stored object. ## 6. List the objects List the keys in the bucket. ```shell aws --profile morph s3api list-objects-v2 --bucket my-bucket --endpoint-url "$S3_URL" \ --query 'Contents[].Key' ``` The output contains the key `my-object`. ## 7. Download the object Download the object into a new file and compare it with the original. ```shell aws --profile morph s3api get-object --bucket my-bucket --key my-object downloaded.txt \ --endpoint-url "$S3_URL" cksum my-object.txt downloaded.txt ``` `get-object` prints the metadata of the object. `cksum` prints one line per file: the checksum and the size in bytes are the same on both lines. ## 8. Delete the object and the bucket Delete the object. ```shell aws --profile morph s3api delete-object --bucket my-bucket --key my-object --endpoint-url "$S3_URL" ``` Ask for the object's metadata to see that it is gone. ```shell aws --profile morph s3api head-object --bucket my-bucket --key my-object --endpoint-url "$S3_URL" ``` The command fails with a 404 error. If it still prints the metadata, repeat it after a few seconds. Delete the bucket. ```shell aws --profile morph s3api delete-bucket --bucket my-bucket --endpoint-url "$S3_URL" ``` Ask for the bucket to see that it is gone. ```shell aws --profile morph s3api head-bucket --bucket my-bucket --endpoint-url "$S3_URL" ``` The command fails with a 404 error. If it still succeeds, repeat it after a few seconds. ## 9. Revoke the credentials Find the ID of the credentials named `tutorial` and revoke them. ```shell S3_TOKEN_ID=$(curl -s "$MORPH_URL/api/v1/users/first-admin/s3-tokens" \ -H "Authorization: Bearer $TOKEN" | jq -r '.tokens[] | select(.name == "tutorial") | .id') curl -s -o /dev/null -w '%{http_code}\n' \ -X DELETE "$MORPH_URL/api/v1/users/first-admin/s3-tokens/$S3_TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `204`. ## What you have learned - S3 credentials come from the console API: `POST /api/v1/users/{user}/s3-tokens` returns an access key ID and a secret access key. - The AWS CLI needs the credentials, a region name, path-style addressing and the endpoint URL of the node's S3 gateway on port 9080. - Buckets and objects are created, listed, read and deleted with the usual `aws s3api` commands. - S3 credentials are revoked through the console API. ## Next steps - [Use the AWS CLI](../how-to/integrate/aws-cli.md) for more commands and settings. - [Use the AWS SDKs](../how-to/integrate/aws-sdks.md) to connect an application. - [Manage S3 credentials](../how-to/secure/manage-s3-credentials.md) to limit what credentials may do and how long they live. - [S3 compatibility](../reference/s3-compatibility.md) for the list of supported operations. - [Store your first object with the REST API](first-steps-with-the-rest-api.md) to do the same through the console API. --- # Store your first object with the REST API In this tutorial you use `curl` against the console REST API of a Morph node. You get a token, define a storage policy, create a bucket with that policy and a basic ACL, upload an object with a lifetime, list it, read its metadata, download it, and delete the object, the bucket and the policy again. ## Before you start You need: - A running single Morph node with the first administrator `first-admin` registered and the storage node in the network map: steps 1 to 5 of the [quickstart](quickstart-single-node.md), on a fresh node. - `curl`, `jq`, `base64` and `cksum`. Set the variables that the commands on this page use. Use the password that you chose for `first-admin`. ```shell export MORPH_URL=http://localhost:9100 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` All paths of the API start with `/api/v1`. The node serves the interactive API documentation at `http://localhost:9100/api/docs`. ## 1. Get a token Log in with your user name and password. The response holds a token and your role. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{\"login\": \"first-admin\", \"password\": \"$ADMIN_PASSWORD\"}" | jq -r .token) echo "$TOKEN" ``` The command prints the token. Every further request sends it in the header `Authorization: Bearer $TOKEN`. ## 2. Define a storage policy A bucket refers to its storage policy by name. Define a policy of your own, named `one-replica`, that keeps one replica of each object on one storage node. The fields are described in [Storage policy language](../reference/storage-policy-language.md). ```shell curl -s -o /dev/null -w '%{http_code}\n' \ -X POST "$MORPH_URL/api/v1/users/first-admin/storage-policies" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "one-replica", "policy": { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [], "ecRules": [] } }' ``` The command prints `201`. Read the policy back. ```shell curl -s "$MORPH_URL/api/v1/users/first-admin/storage-policies/one-replica" \ -H "Authorization: Bearer $TOKEN" | jq .policy ``` The output shows the policy with one replica rule of count 1 and placement factor 1. ## 3. Create a bucket Create the bucket `my-bucket` with the policy `one-replica` and a basic ACL. The basic ACL has one group of permissions for the owner and one for everyone else. Here the owner may do everything, and others may read and list but not write or delete (see [Control access to a bucket](../how-to/buckets-and-objects/control-access.md)). ```shell curl -s -o /dev/null -w '%{http_code}\n' -X POST "$MORPH_URL/api/v1/buckets" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "my-bucket", "placementPolicyName": "one-replica", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": true, "head": true, "put": false, "delete": false, "search": true } } }' ``` The command prints `201`. Read the bucket back. ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" | jq '{name, owner, basicACL, placementPolicy}' ``` The output shows the name `my-bucket`, the owner `first-admin`, the basic ACL and the storage policy that you sent. ## 4. Upload an object with a lifetime Create a small file. ```shell echo "test string" > my-object.txt ``` Upload it. The request body is the file content. Two headers describe the object: - `x-morph-path` is the object name, encoded in Base64. - `x-morph-lifetime` is the lifetime in hours. After it, Morph removes the object (see [Expire objects](../how-to/buckets-and-objects/expire-objects.md)). ```shell export OID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "x-morph-path: $(printf '%s' my-object | base64)" \ -H "x-morph-lifetime: 24" \ --data-binary @my-object.txt | jq -r .oid) echo "$OID" ``` The command prints the object ID from the response, for example `DUPHr5F9TR7eQBj632Cbm89RwRnh2T5yUkGax92PJ1Ua`. Several objects in a bucket can have the same name, so the following steps address the object by its ID. ## 5. List the objects List the objects in the bucket. ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" | jq .objects ``` The output is a list with one entry. Its `oid` is your object ID, its `path` is `my-object`, its `size` is 12, and its `expirationDate` is the time at which the lifetime ends. ## 6. Read the object's metadata Send a `HEAD` request for the object. `curl -I` does that and prints the response headers. ```shell curl -s -I "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" ``` The response has the status `200` and carries the metadata in headers: `Content-Length`, `Content-Type`, `Last-Modified`, `X-Object-Id` and `X-Attributes`. ## 7. Download the object Download the object into a new file and compare it with the original. ```shell curl -s -o downloaded.txt "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" cksum my-object.txt downloaded.txt ``` `cksum` prints one line per file. The checksum and the size in bytes are the same on both lines. ## 8. Delete the object Delete the object by its ID. ```shell curl -s -o /dev/null -w '%{http_code}\n' \ -X DELETE "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `204`. Ask for the object again. ```shell curl -s -o /dev/null -w '%{http_code}\n' \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `404`. If it prints `200`, repeat the command after a few seconds. ## 9. Delete the bucket Delete the bucket. ```shell curl -s -o /dev/null -w '%{http_code}\n' \ -X DELETE "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `204`. Ask for the bucket again. ```shell curl -s -o /dev/null -w '%{http_code}\n' "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `404`. If it prints `200`, repeat the command after a few seconds. ## 10. Delete the storage policy Delete the storage policy that you defined in step 2. ```shell curl -s -o /dev/null -w '%{http_code}\n' \ -X DELETE "$MORPH_URL/api/v1/users/first-admin/storage-policies/one-replica" \ -H "Authorization: Bearer $TOKEN" ``` The command prints `204`. ## What you have learned - `POST /api/v1/login` returns the token that authenticates all other requests. - A storage policy is defined under a name, and a bucket names its policy when it is created. - The basic ACL of a bucket sets the permissions of the owner and of others. - An upload sends the content as the request body and the name and lifetime as headers, and returns an object ID. - `GET`, `HEAD` and `DELETE` on the object ID download, describe and remove the object. ## Next steps - [REST API reference](../reference/rest-api/index.md) for every endpoint and field. - [Create a bucket](../how-to/buckets-and-objects/create-a-bucket.md) and [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md) for the options that this tutorial left out. - [Control access to a bucket](../how-to/buckets-and-objects/control-access.md) for extended ACLs. - [Search objects](../how-to/buckets-and-objects/search-objects.md) to find objects by their attributes. - [Manage API tokens](../how-to/secure/manage-api-tokens.md) to give an application a token of its own. - [Errors and status codes](../reference/errors.md) for what the API returns when a request fails. --- # Prepare hosts This guide prepares one machine so that a Morph node can be installed on it. Repeat it on every machine of the cluster. Morph is deployed as one Morph container per host. The image `morphbits/morph` contains all processes of a node, and the entrypoint starts the ones that the node's installation type needs. There is no Kubernetes packaging: no Helm chart, no operator, no manifests. ## Before you start - Decide the number and the type of nodes. See [Size a cluster](size-a-cluster.md). - Give every host an IP address or a DNS name that all other hosts can reach. You enter these addresses during the installation, and the nodes store them in the network map and in their configuration. If you use DNS names, every host must resolve the names of all others. - Have the drives installed that the node will use for data. See [Configure drives and shards](configure-drives.md) for the layout. ## Steps 1. Install Docker on the host. Morph runs as a Docker container and needs a working Docker daemon. 2. Make the image `morphbits/morph` available on the host, in the release you deploy. The release tag has the form `0.30.1`. 3. Create a host directory for the node's state, for example `/mnt/local_state`. You mount it into the container at `/morph/local_state`. Morph writes into this directory everything it generates at the first start and everything it must keep across restarts: the configuration files of all processes, the wallets with the node's keys, the marker of the finished installation, the state files of the inner ring and the storage node, and on a cluster-type node the FS chain database. The files are small compared with object data. A node that loses this directory has lost its keys. 4. Create a file system on every data drive and mount it on the host, one mount point per drive, for example `/mnt/sdb` and `/mnt/sdc`. Mount the SSD for metabases and write-caches the same way, for example on `/mnt/meta`. You mount each of these directories into the container at the path that the installer configuration names for it. The default paths inside the container are `/data/` for object data, `/data/meta` for metabases and `/data/writecache/` for write-caches. :::warning A path that is not mounted from the host lives inside the container. Its content is deleted when the container is removed with `docker rm`. ::: 5. Open the ports between the hosts and to the clients. The table lists the ports of the container; you publish them on the host when you start the container. | Port | Purpose | On which nodes | Open for | |---|---|---|---| | 9100 | Console: REST API and web UI. During installation: installer. | all | Clients and administrators. The other inner ring hosts during installation. | | 9080 | S3 | all | S3 clients, or the load balancer | | 8080 | Storage node gRPC | cluster-type, storage-type | All other hosts of the cluster | | 20333 | FS chain consensus | cluster-type | The other cluster-type hosts | | 30333 | FS chain RPC | cluster-type | All other hosts of the cluster | | 20334 | Metadata chain peer-to-peer of the inner ring. The other inner ring nodes and every storage node connect to it. | cluster-type | All other hosts of the cluster | | 21334 | Metadata chain peer-to-peer of the storage node | cluster-type, storage-type | All other hosts of the cluster | | 5100 | Prometheus metrics | all | The monitoring system | Leave every other port closed. The control services of the storage node and the inner ring are meant for use from inside the container. The full list is in [ports and protocols](../../reference/ports-and-protocols.md). 6. Restrict port 9100 until the node is installed. The installer on this port takes no credentials. Allow only your administration host and the other inner ring hosts until the installation has finished. ## Check the result | Check | Expected | |---|---| | Docker | The Docker daemon runs and the image `morphbits/morph` is present in the release you deploy. | | State directory | `/mnt/local_state` exists, is empty, and is on a file system that survives a reboot. | | Drives | Each data drive and the SSD are mounted at their own mount point. | | Network | From every other host, the ports of step 5 are not blocked by a firewall. A connection is refused until the container runs; it must not time out. | The next step is [Configure drives and shards](configure-drives.md), then [Install a cluster](install-a-cluster.md). ## Related - [Ports and protocols](../../reference/ports-and-protocols.md) - [Environment variables](../../reference/configuration/environment-variables.md) - [Architecture](../../explanation/architecture.md) --- # Size a cluster This guide leads you to the node counts, the drive layout, the usable capacity and the meta SSD size of a Morph cluster. The placement and capacity rules come from the functional specifics of different approaches to data redundancy. The per-object metabase figures in step 5 are empirical planning rules of thumb, not hard limits. This guide gives no CPU, memory or throughput figures at the moment. ## Before you start Have these numbers ready: - The capacity your data needs, before redundancy. - The expected number of objects, and whether many exceed 64 MiB. - How many nodes may be unavailable at the same time while reads continue, and while writes continue. - The number of sites. Terms used here are explained in [data placement](../../explanation/data-placement.md) and [erasure coding](../../explanation/erasure-coding.md). ## Steps ### 1. Choose the inner ring size The inner ring nodes run the FS chain, which records buckets, access rules, users and the network map. Choose 4 or 7 nodes. A single inner ring node is for tests. :::warning The number of inner ring nodes is fixed for the life of the network. You cannot add or remove inner ring nodes later. ::: The inner ring needs a quorum of n − (n − 1)/3 nodes, with the division rounded down. | Inner ring nodes | Quorum | Nodes that may be down | |---|---|---| | 1 | 1 | 0 | | 4 | 3 | 1 | | 7 | 5 | 2 | Below quorum the FS chain produces no blocks. Buckets cannot be created, access rules and users cannot be changed, storage nodes cannot join or be removed, and the epoch does not advance. Chain data can still be read. Every inner ring node is a cluster-type Morph node. It also runs a storage node, a console and an S3 gateway, so the inner ring nodes count as storage nodes in the next steps. ### 2. Choose the storage policy and derive the minimum number of storage nodes A storage policy keeps each object either as replicas or as erasure-coded parts. Every replica and every part of an object is on a different storage node. | Policy | Nodes that hold one object | Minimum storage nodes | Reads need | Writes need | |---|---|---|---|---| | `REP n` | n | n | 1 of the n holders | n nodes of the bucket available | | `EC d/p` | d + p | d + p | d of the d + p holders | d + p nodes of the bucket available | A write is acknowledged when the full number of replicas, or all d + p parts, are stored. A bucket with an initial placement policy can acknowledge replicated writes earlier; see [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). When a node fails during a write, another node of the bucket takes its place. The table holds while the failed nodes are still listed in the network map. A storage node that stays down for more than three epochs is removed from the map. If the map then lists fewer storage nodes than one object is placed on (n, or d + p), every object operation on the bucket fails, reads included, until enough nodes are in the map again. The replicas and parts on the remaining nodes are kept. The nodes of a bucket are chosen from the network map when the policy is applied. Their number is (nodes that hold one object) × (placement factor), or all matching nodes if there are fewer. A policy with a selector uses the count of the selector in place of (nodes that hold one object). The default placement factor is 3. Two rules follow: > To keep writing while f nodes are down, the bucket needs at least > (nodes that hold one object) + f storage nodes, and a placement factor above 1 or a > selector that selects that many. The same number keeps the bucket readable after > the f nodes have been removed from the network map. > One bucket uses the capacity of at most > (nodes that hold one object) × (placement factor) nodes. With `REP 3` and the default > factor that is 9 nodes. In a larger cluster, raise the placement factor or spread the > data over several buckets. Examples: - `REP 3` on 3 nodes: reads survive two failed nodes. Writes fail while any node is down. Once a failed node has been removed from the network map, reads fail too. - `REP 3` on 4 nodes: writes continue with one node down. - `EC 3/1` on 4 nodes: reads survive one failed node. Writes fail while any node is down. Once the failed node has been removed from the network map, reads fail too. - `EC 4/2` on 8 nodes: reads survive two failed holders, and writes continue with two nodes down. The policy that Morph applies when a bucket is created without one is `REP 3` in a cluster with 4 or 7 inner ring nodes, and `REP 1` in a single-node installation. `REP 3` needs at least 3 storage nodes, `REP 1` one. To choose between replicas and erasure coding, see [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). The limits of a policy are in [limits](../../reference/limits.md). ### 3. Calculate the capacity Raw capacity is the sum of all data drives: > raw = storage nodes × data drives per node × drive size The storage policy turns raw capacity into usable capacity: | Policy | Usable capacity | Share of raw | |---|---|---| | `REP n` | raw ÷ n | 1/n | | `EC d/p` | raw × d ÷ (d + p) | d/(d + p) | Worked examples for a cluster with 800 TB raw (8 nodes with 100 TB each): | Policy | Calculation | Usable | |---|---|---| | `REP 2` | 800 ÷ 2 | 400 TB | | `REP 3` | 800 ÷ 3 | about 266 TB | | `EC 3/1` | 800 × 3 ÷ 4 | 600 TB | | `EC 4/2` | 800 × 4 ÷ 6 | about 533 TB | | `EC 6/2` | 800 × 6 ÷ 8 | 600 TB | To size for a target, turn the formula around: 300 TB of data under `EC 4/2` need 300 × 6 ÷ 4 = 450 TB raw. Three corrections to this arithmetic: - **It is an upper bound.** Object headers, tombstones, locks and the link objects of large uploads also take space on data drives. This overhead is considered negligible in most real scenarios. Metabases live on the meta SSD and are sized in step 5. - **Policies are per bucket.** With several policies in use, calculate each group of buckets on its own and add the raw capacities. - **Leave room for repair.** When a node is lost, the policer rebuilds its replicas and parts on the remaining nodes of each bucket. They need free space of the size of the lost node's data, or redundancy stays reduced until the node is replaced. Storage nodes can be added later. See [Add storage nodes](../operate/add-storage-nodes.md). ### 4. Lay out the drives of a node - Use one shard per data drive. A failed data drive then affects one shard. The steps that restore redundancy afterwards are in [Replace a failed drive](../operate/replace-a-failed-drive.md). - Put the metabase and the write-cache of every shard on an SSD. This is the deployment the storage node expects. The SSD then carries the index of every shard that uses it. - Redundancy is counted per node. Two replicas, or two parts, of one object are never on the same node, whatever the number of drives. More drives per node add capacity. They do not add redundancy. The steps are in [Configure drives and shards](configure-drives.md). ### 5. Size the meta SSD Each shard keeps its metabase (a bbolt database) and optional write-cache on the meta SSD. Under even distribution across the nodes of a bucket, the number of stored objects indexed on one node is: > objects per node = stored objects × nodes that hold one object ÷ nodes of the bucket Here `nodes that hold one object` is n for `REP n` and d + p for `EC d/p`. As in step 2, `nodes of the bucket` is `(nodes that hold one object) × (placement factor)` (or the selector count in place of `nodes that hold one object` when the policy uses a selector), or all matching nodes if the cluster has fewer. The meta SSD space a node needs before headroom is: > meta SSD per node ≈ (objects per node × bytes per object) + (shards per node × write-cache size) The write-cache term is 0 if write-caches are disabled. Use these planning figures for `bytes per object`: | Policy | Bytes per stored object | Why | |---|---|---| | `REP n` | about 5 KiB | Typical S3 objects with short keys take about 3.5 KiB in a clean metabase. 5 KiB leaves margin for longer keys, versioning, tags, custom attributes and bbolt free-page overhead. | | `EC d/p` | about 8 KiB | Each erasure-coded part indexes both the part object and the full header of its parent object, nearly doubling the number of bbolt keys per stored entry. | These figures are empirical planning rules of thumb from production measurements and metabase sizing tests against the bundled storage node. At small counts (thousands of objects per shard), disk usage per object appears higher because bbolt grows database files in chunks up to 16 MiB. Per-object usage settles once a shard holds on the order of 100,000 objects or more. Worked examples for 100 million typical S3 objects up to 64 MiB across 8 storage nodes, with 4 shards per node and the shipped `1GB` (1 GiB) write-cache per shard (4 GiB total write-cache per node): | Policy | Holders | Stored objects per node | Metabases | Write-caches | Total before headroom | |---|---|---|---|---|---| | `REP 3` | 3 | 37.5 million | about 179 GiB | 4 GiB | about 183 GiB | | `EC 4/2` | 6 | 75 million | about 572 GiB | 4 GiB | about 576 GiB | Erasure coding reduces data-drive capacity compared to replication, but increases meta SSD usage in two ways: each object is stored on d + p holders instead of n, and every holder indexes both the part and its parent header. Three corrections to this arithmetic: - **Count stored objects, not only S3 keys.** Uploads over 64 MiB split into 64 MiB pieces plus a link object. Versioned buckets keep previous versions and delete markers. Uncommitted multipart parts add entries. Tombstones, locks and link objects are indexed on every node and every shard of the bucket, so they do not divide across nodes like regular objects (see [data model](../../explanation/data-model.md)). Long keys, tags and many custom attributes also increase the index size per object (see [metadata](../../explanation/metadata.md)). - **Leave room for repair, churn and database growth.** When a node fails, the remaining nodes of each bucket index the replicas and parts that the policer rebuilds. bbolt files also keep freed pages at their high-water mark for reuse and do not shrink automatically after deletes. - **Chain-backed metadata (`sn.metadata`).** If any bucket uses the experimental `metadataConsistency` mode, the storage node keeps that metadata database in `sn.metadata` on the meta SSD as well. The planning figures above do not cover it. ### 6. Compare with a reference layout Each layout states what it tolerates. The statements follow from the rules of steps 1 and 2. #### Single site, 4 nodes | Item | Value | |---|---| | Nodes | 4 cluster-type nodes | | Inner ring | 4, quorum 3 | | Storage nodes | 4 | | Storage policy | `REP 3` (the default) | | Usable capacity | raw ÷ 3 | | Event | Effect | |---|---| | 1 node down | Inner ring keeps quorum. Reads and writes continue. | | 2 nodes down | Inner ring is below quorum, with the effects listed in step 1. Every object still has at least one replica. Writes to `REP 3` buckets fail. | With `EC 3/1` instead, usable capacity is raw × 3/4. Objects stay readable with 1 node down, and writes need all 4 nodes. If the node stays down until it is removed from the network map, the objects cannot be read until a fourth storage node is in the map. This is the smallest production layout. The steps are in the tutorial [Deploy a four-node cluster](../../tutorials/minimal-production-cluster.md). #### Single site, 8 nodes, erasure coding | Item | Value | |---|---| | Nodes | 4 cluster-type nodes and 4 storage-type nodes | | Inner ring | 4, quorum 3 | | Storage nodes | 8 | | Storage policy | `EC 4/2`, placement factor 2 or higher | | Usable capacity | raw × 4/6 | | Event | Effect | |---|---| | 1 node down | Inner ring keeps quorum. Every object keeps at least 5 of its 6 parts. 7 nodes are left for writes. | | 2 nodes down, at most 1 of them cluster-type | Inner ring keeps quorum. Every object keeps at least 4 parts, the number a read needs. 6 nodes are left for the 6 parts of a write. | | 2 cluster-type nodes down | Inner ring is below quorum, with the effects listed in step 1. For object data the row above applies. | | 3 nodes down | Objects with 3 parts on the failed nodes cannot be read until a node returns. Writes fail. Once the 3 nodes have been removed from the network map, no object of the bucket can be read until 6 storage nodes are in the map. | With a placement factor of 2 or higher the bucket uses all 8 nodes: 6 × 2 = 12 is more than 8. With a placement factor of 1 the bucket would use 6 nodes and writes would need all of them. #### Three sites and a fourth location | Item | Value | |---|---| | Nodes | 7 cluster-type nodes: 2 in each of three sites, 1 in a fourth location | | Inner ring | 7, quorum 5 | | Storage nodes | 7 | | Storage policy | `REP 3` (the default) | | Usable capacity | raw ÷ 3 | | Event | Effect | |---|---| | 1 site lost (2 nodes) | Inner ring keeps quorum with 5 of 7. No site holds 3 nodes, so every object keeps at least one replica. 5 storage nodes remain for the 3 replicas of a write. | | The fourth location lost (1 node) | Inner ring keeps quorum with 6 of 7. Every object keeps at least 2 replicas. 6 storage nodes remain for writes. | | 1 site and the fourth location lost (3 nodes) | Inner ring is below quorum. An object whose three replicas were on these nodes cannot be read. | The fourth location exists for the quorum. Three sites alone cannot keep it through the loss of any one site: 4 nodes split 2+1+1 fall to 2 when the larger site is lost, and 7 nodes split 3+2+2 fall to 4. The quorums are 3 and 5. The node in the fourth location is a cluster-type node like the others. Under `REP 3` without selectors it holds objects and needs drives. For policies that place replicas by site, see [Deploy across sites](deploy-across-sites.md). ## Check the result You have a sizing when you can fill in this table: | Decision | Your value | |---|---| | Inner ring nodes | 4 or 7 | | Storage nodes, including the inner ring nodes | at least (nodes that hold one object) + (nodes that may be down during writes) | | Storage policy of the main buckets | `REP n` or `EC d/p`, and the placement factor | | Data drives per node and drive size | gives raw capacity | | Usable capacity | raw ÷ n, or raw × d ÷ (d + p), larger than your data with room for repair | | SSD per node | (objects per node × 5 KiB for `REP`, or × 8 KiB for `EC`) + (shards × write-cache size), with room for repair and growth | ## Related - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Metadata](../../explanation/metadata.md) - [Storage policy language](../../reference/storage-policy-language.md) --- # Configure drives and shards This guide sets up the storage layout of a Morph node: one shard per data drive, with the shard's metabase and write-cache on an SSD. A shard is one drive's object store, its index (the metabase) and an optional write-cache. The layout is described in the installer configuration file, which the installer reads once, at the first start of the node. ## Before you start - The host is prepared as in [Prepare hosts](prepare-hosts.md): each data drive and the SSD are mounted on the host, and the state directory exists. - The node has not been started yet. After the installation the installer configuration file is not read again. To change shards on a running node, see [Replace a failed drive](../operate/replace-a-failed-drive.md). - This guide applies to cluster-type and storage-type nodes. A gateway-type node has no storage node. The examples use two data drives mounted on the host at `/mnt/sdb` and `/mnt/sdc`, an SSD mounted at `/mnt/meta`, and the state directory `/mnt/local_state`. ## Steps 1. Create the file `custom-installer.config.yaml` with one entry under `sn.shards` per data drive. ```yaml sn: metadata: /data/meta shards: - data: /data/sdb metadata: /data/meta/0/metabase.db writecache: path: /data/meta/writecache/0 size: 1GB - data: /data/sdc metadata: /data/meta/1/metabase.db writecache: path: /data/meta/writecache/1 size: 1GB ``` All paths are paths inside the container. | Key | What to enter | |---|---| | `sn.metadata` | A directory on the SSD. Always set it; the code has no default for it. | | `data` | The directory where the data drive is mounted in the container. | | `metadata` | The metabase file of the shard, on the SSD. One file per shard. | | `writecache.path` | The write-cache directory of the shard, on the SSD. It must be different for every shard and different from `data`. | | `writecache.size` | The maximum disk space of the write-cache. A shard has a write-cache only when both `path` and `size` are set. | The installer rejects a file with a key it does not know. All keys and defaults are in the [installer configuration reference](../../reference/configuration/installer.md). 2. Decide about combined writing. Combined writing puts several small objects into one file, which suits rotational drives. Leave `combined_writing` out to let the installer decide for each shard: it turns combined writing off when the drive behind `data` is not rotational, and leaves it on when the drive is rotational or when it cannot tell. To decide yourself, add the key to the shard: ```yaml - data: /data/sdb combined_writing: enabled: false ``` 3. Start the container with the file and the drives mounted. Each `-v` option maps a host path to the container path used in the file. The configuration file goes to `/morph/config/installer.config.yaml`. ```shell docker run -d --restart unless-stopped --name morphcluster \ -p 9100:9100 -p 8080:8080 -p 9080:9080 -p 5100:5100 \ -p 20333:20333 -p 30333:30333 -p 20334:20334 -p 21334:21334 \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/local_state:/morph/local_state \ -v /mnt/sdb:/data/sdb \ -v /mnt/sdc:/data/sdc \ -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` `--restart unless-stopped` starts the container again after a reboot of the host. Make sure that the host mounts the drives at boot, for example through `/etc/fstab`: the container must not start on the empty mount points. The port list is the one for a cluster-type node. A storage-type node needs no `20333`, `30333` and `20334`. 4. Continue with [Install a cluster](install-a-cluster.md). The installer writes the storage node configuration when you send the installation request. ## Run the container with a read-only root file system Morph can run with Docker's `--read-only` option. The container then writes only to the paths you mount. 1. Set every path in the installer configuration file explicitly, as in step 1. With a read-only root file system no default path is usable. 2. Mount every path named in the file, the configuration file itself, and the state directory at `/morph/local_state`. 3. Add `--read-only` to the command of step 3: ```shell docker run -d --restart unless-stopped --read-only --name morphcluster \ -p 9100:9100 -p 8080:8080 -p 9080:9080 -p 5100:5100 \ -p 20333:20333 -p 30333:30333 -p 20334:20334 -p 21334:21334 \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/local_state:/morph/local_state \ -v /mnt/sdb:/data/sdb \ -v /mnt/sdc:/data/sdc \ -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` ## Check the result After the installation request, the generated storage node configuration is in the state directory. Print it on the host: ```shell cat /mnt/local_state/config/config-sn.yaml ``` Under `storage.shards` there is one entry per shard of your file: - `blobstor.path` is the shard's `data` path. - `metabase.path` is the shard's `metadata` path. - A `writecache` block is present when you set both `path` and `size`. - `combined_count_limit: 1` is present under `blobstor` when combined writing is off for the shard. If the installer could not tell whether a drive is rotational, the container log has a warning with the text `could not detect whether shard storage is rotational` and the path of the shard. ## Related - [Installer configuration](../../reference/configuration/installer.md) - [Storage node settings](../../reference/configuration/storage-node.md) - [Size a cluster](size-a-cluster.md) - [Replace a failed drive](../operate/replace-a-failed-drive.md) --- # Install a cluster This guide installs a Morph cluster on prepared hosts: first one cluster-type node for every inner ring member, then storage-type nodes. A cluster-type node runs the inner ring, a storage node, the console and the S3 gateway. A storage-type node runs a storage node, the console and the S3 gateway. For a guided first installation, use the tutorial [Deploy a four-node cluster](../../tutorials/minimal-production-cluster.md). ## Before you start - Every host is prepared as in [Prepare hosts](prepare-hosts.md). - You have an installer configuration file for the drives of each node, as in [Configure drives and shards](configure-drives.md). - You have `curl` and `jq` on your administration host. - You have made the decisions below. ### Decisions you cannot change later The installer runs once per node, at the first start. It generates the keys and the configuration files of the node and does not run again. | Decision | Where you make it | Why it is final | |---|---|---| | Number of inner ring nodes: 4 or 7 | The number of entries in `installers_addresses` | The number of inner ring nodes is fixed for the life of the network. See [Size a cluster](size-a-cluster.md). | | Which hosts are inner ring members | The hosts you list in `installers_addresses` | Each node generates its inner ring key at the first start. The installers exchange the keys, and every member writes the keys of all members into its chain configuration. | | Installation type of a node | The request you send: `start-node` makes a cluster-type node, `new-sn` a storage-type node | The type is recorded in the state directory, and the installer is skipped from then on. | | Shard layout | The installer configuration file | The file is read only by the installer. The generated storage node configuration is managed by Morph, and manual post-install edits are not supported. | | Announced addresses, node attributes, TLS for storage node gRPC | The fields of the request | They are written into the generated configuration. The installer offers no way to change them afterwards. | | Wallet passwords | Environment variables of the container | The wallets are created and encrypted at the first start. See [environment variables](../../reference/configuration/environment-variables.md). | ### Variables The commands use these variables. Set them to the addresses of your hosts. ```shell export NODE1=10.0.0.11 export NODE2=10.0.0.12 export NODE3=10.0.0.13 export NODE4=10.0.0.14 export MORPH_URL=http://$NODE1:9100 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` The steps install 4 inner ring nodes. For 7, add `NODE5` to `NODE7` everywhere. ## Steps ### 1. Start the container on every inner ring host Run this on each of the hosts. Add one `-v` option per drive, as in [Configure drives and shards](configure-drives.md). ```shell docker run -d --restart unless-stopped --name morphcluster \ -p 9100:9100 -p 8080:8080 -p 9080:9080 -p 5100:5100 \ -p 20333:20333 -p 30333:30333 -p 20334:20334 -p 21334:21334 \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/local_state:/morph/local_state \ -v /mnt/sdb:/data/sdb \ -v /mnt/sdc:/data/sdc \ -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` `--restart unless-stopped` makes Docker start the container again after a reboot of the host and after the container exits by itself. Without it the node stays down after a reboot until someone starts it. A container that you stop with `docker stop` stays stopped. The policy needs the Docker service to start at boot (`systemctl enable docker`), and the drives to be mounted at boot, for example through `/etc/fstab`. The container starts the installer, which listens on port 9100 and waits. Follow the log to see it: ```shell docker logs -f morphcluster ``` The installer is ready when the log shows `installer is serving on` with port 9100. ### 2. Send the start-node request to every inner ring node Build the list of all installers once. It is the same for every node and includes the node that receives the request. ```shell INSTALLERS="\"$NODE1:9100\",\"$NODE2:9100\",\"$NODE3:9100\",\"$NODE4:9100\"" ``` Send the request to the first node: ```shell curl -i -X POST http://$NODE1:9100/api/v1/start-node \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"sn_attributes\": [\"node:1\"], \"sn_addresses\": [\"grpc://$NODE1:8080\"], \"external_address\": \"$NODE1\", \"installer_port\": 9100, \"ir_port\": 20333, \"installers_addresses\": [$INSTALLERS] }" ``` The node answers `204 No Content`. Send the same request to each of the other nodes. Replace `$NODE1` in the URL, in `sn_addresses` and in `external_address` with the address of the node, and give each node its own attributes. Do not change `installers_addresses`. | Field | Type | Meaning | |---|---|---| | `sn_attributes` | list of strings | Attributes of this node's storage node, each as `key:value`. Storage policies select nodes by these attributes. See [Deploy across sites](deploy-across-sites.md). | | `sn_addresses` | list of strings, at least one | The addresses under which other nodes reach this node's storage node. They are published in the network map. Use `grpc://host:port` for plaintext or `grpcs://host:port` for TLS. An address without a scheme counts as plaintext. All addresses of one node must have the same scheme. See [Enable TLS](enable-tls.md). | | `external_address` | string | The IP address or DNS name under which the other inner ring nodes reach this node. | | `ir_port` | integer | The published port of this node's FS chain consensus listener, 20333 unless you published it on another host port. Together with `external_address` it forms the address that the other inner ring nodes connect to. | | `installer_port` | integer | The published port of this node's installer. This release does not evaluate the field. | | `installers_addresses` | list of strings, at least one | The installers of all inner ring nodes as `host:port`, this node included. The number of entries is the number of inner ring nodes. | What happens after the request: 1. The installer asks every address in `installers_addresses` for that node's inner ring key and consensus address. It repeats the request every second until the node has received its own `start-node` request. 2. It confirms to every other installer that it has their data, and waits until all of them have confirmed in return. 3. It writes the configuration files and exits. The entrypoint starts the inner ring, the storage node, the console and the S3 gateway. A node therefore waits until all nodes in the list have been started and called. A second `start-node` request to the same node is answered with `409 Conflict`. :::warning A wrong entry in `installers_addresses` cannot be corrected with a second request. Check the list before you send the first one. ::: ### 3. Wait until every node is ready Follow the log on each host: ```shell docker logs -f morphcluster ``` The node is ready when the log shows: ```text ✅ MORPH CONTAINER STARTED ``` ### 4. Create the first administrator Register the first user on one node. The first registration needs no token and must have the role `admin`. ```shell curl -i -X POST $MORPH_URL/api/v1/users \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"name\": \"first-admin\", \"role\": \"admin\", \"password\": \"$ADMIN_PASSWORD\" }" ``` The answer is: ```text HTTP/1.1 201 Created ... Registration completed. ``` An answer of `401 Unauthorized` with `Bearer token is required.` means that the first user already exists. Log in and keep the token for the next steps: ```shell TOKEN=$(curl -s -X POST $MORPH_URL/api/v1/login \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$ADMIN_PASSWORD\"}" | jq -r .token) ``` ### 5. Add storage-type nodes Repeat this step for every storage-type node. The example adds the host in `NODE5`. ```shell export NODE5=10.0.0.15 export SN_URL=http://$NODE5:9100 ``` 1. Start the container on the new host. A storage-type node needs no inner ring ports. ```shell docker run -d --restart unless-stopped --name morphsnnode \ -p 9100:9100 -p 8080:8080 -p 9080:9080 -p 5100:5100 -p 21334:21334 \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/local_state:/morph/local_state \ -v /mnt/sdb:/data/sdb \ -v /mnt/sdc:/data/sdc \ -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` 2. Read the account address of the new storage node and the public key of its gateway wallet from its installer. ```shell SN_ADDRESS=$(curl -s $SN_URL/api/v1/sn-address | jq -r .address) GATEWAY_PUBLIC_KEY=$(curl -s $SN_URL/api/v1/gateway-address | jq -r .publicKey) ``` 3. Admit both on a cluster-type node. Each request answers `204 No Content`. ```shell curl -i -X POST $MORPH_URL/api/v1/cluster/storage-nodes \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"address\":\"$SN_ADDRESS\"}" curl -i -X POST $MORPH_URL/api/v1/cluster/gateways \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"publicKey\":\"$GATEWAY_PUBLIC_KEY\"}" ``` 4. Send the installation request to the new node. ```shell curl -i -X POST $SN_URL/api/v1/new-sn \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"attributes\": [\"node:5\"], \"addresses\": [\"grpc://$NODE5:8080\"], \"side_chain_ws_addresses\": [ \"http://$NODE1:30333\", \"http://$NODE2:30333\", \"http://$NODE3:30333\", \"http://$NODE4:30333\" ] }" ``` The node answers `200 OK` with an empty body. | Field | Meaning | |---|---| | `attributes` | Attributes of the storage node, as `sn_attributes` above. | | `addresses` | Announced addresses of the storage node, as `sn_addresses` above. | | `side_chain_ws_addresses` | The FS chain RPC endpoints of inner ring nodes, as `http://host:port` or `host:port`. At least one. List several so that the node can reach the chain when one inner ring node is down. | 5. Wait until the node is ready. The storage node enters the network map at the start of the next epoch, and the entrypoint starts the console and the S3 gateway only after that. With the default epoch of 3600 seconds this can take up to an hour. Until then the log repeats `local SN is not in Netmap` every 10 seconds. Then it shows `local SN in Netmap` and `✅ MORPH CONTAINER STARTED`. On a cluster that you have just installed the wait is shorter. During the first 8 minutes after their first start, the cluster-type nodes advance the epoch themselves, 2 minutes after a new storage node has announced itself. A storage-type node that you install within the first 5 minutes is ready 2 to 3 minutes after its request. 6. Log in again and issue new S3 credentials before you send clients to the new node. A token from `/api/v1/login` and an S3 credential work only on the nodes whose gateway key was registered when they were issued. The new node rejects the ones that are older than step 3. See [Manage S3 credentials](../secure/manage-s3-credentials.md). The same procedure adds nodes to a running cluster later. See [Add storage nodes](../operate/add-storage-nodes.md). ## Check the result List the storage nodes of the current network map. The list contains every cluster-type and storage-type node that has entered the map. ```shell curl -s $MORPH_URL/api/v1/cluster/storage-nodes \ -H "Authorization: Bearer $TOKEN" ``` Check the health metrics of a node. The entrypoint uses the same three values to decide that the processes are ready. A storage-type node has no `neofs_ir_state_health`. ```shell curl -s http://$NODE1:5100/metrics | grep state_health ``` The output contains: ```text neofs_ir_state_health 2 neofs_node_state_health 2 neofs_s3_gw_state_health 2 ``` Open the console at `http://:9100` in a browser and log in as `first-admin`. ## Related - [Installer API](../../reference/installer-api.md) - [Installer configuration](../../reference/configuration/installer.md) - [Ports and protocols](../../reference/ports-and-protocols.md) - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Manage users and roles](../secure/manage-users-and-roles.md) - [Check cluster health](../observe/check-cluster-health.md) --- # Enable TLS This guide turns on TLS for the gRPC API between storage nodes and shows how to cover the listeners that the installer leaves in plaintext. ## What the installer supports | Listener | Port | TLS through the installer | How to encrypt it | |---|---|---|---| | Storage node gRPC | 8080 | Yes, chosen by the address scheme at installation | This guide | | S3 | 9080 | No. The installer writes the S3 listener with TLS disabled and has no option for it. | Terminate TLS on a [load balancer](put-a-load-balancer-in-front.md) | | Console: REST API and web UI | 9100 | No. The console configuration has no TLS setting. | Terminate TLS on a [load balancer](put-a-load-balancer-in-front.md) | | FS chain RPC | 30333 | No | Keep it on a network that only the nodes can reach | | FS chain consensus | 20333 | No | Keep it on a network that only the nodes can reach | During installation the installers of the inner ring nodes also talk to each other over plain HTTP on port 9100. ## Before you start - The node is not installed yet. The scheme is fixed by the installation request, and the installer does not run a second time. - You know the installation request of the node type: `start-node` for a cluster-type node, `new-sn` for a storage-type node. See [Install a cluster](install-a-cluster.md). - You need no certificate. The storage node creates a self-signed certificate from its node key. The examples use `10.0.0.11` and `10.0.0.15` as node addresses. Replace them with yours. ## Steps 1. Write every address of the storage node with the scheme `grpcs://`. In a `start-node` request this is the field `sn_addresses`: ```json "sn_addresses": ["grpcs://10.0.0.11:8080"] ``` In a `new-sn` request it is the field `addresses`: ```json "addresses": ["grpcs://10.0.0.15:8080"] ``` All addresses of one node must use the same scheme. The installer rejects a mixed list with `400 Bad Request` and the message `all Storage Node addresses must use the same grpc:// or grpcs:// scheme`. An address without a scheme counts as `grpc://`. 2. Send the installation request as described in [Install a cluster](install-a-cluster.md). Nothing else changes. 3. Do not plan gateway-type nodes for this cluster. A gateway-type node cannot connect to a storage node that was installed with `grpcs://`: its console and S3 gateway check the certificate against the address, and the certificate that the storage node generates does not name it. The node then does not finish its start, and its log shows `tls: failed to verify certificate`. See [Limits](#limits). ### What the installer does - It enables TLS on the public gRPC listener of the storage node, `0.0.0.0:8080`, and configures no certificate file. The storage node then generates a self-signed certificate from the node key in its wallet. It uses the certificate for the listener and for its outgoing connections to other storage nodes. - It adds a second, plaintext gRPC listener on `127.0.0.1:8084`. - It points the console and the S3 gateway of the same node at `127.0.0.1:8084`. They keep talking to their local storage node without TLS, inside the container. The node announces its `grpcs://` addresses in the network map, and other nodes connect to it with TLS. ## Check the result Print the generated storage node configuration on the host of the node: ```shell cat /mnt/local_state/config/config-sn.yaml ``` The `grpc` section has two listeners: ```yaml grpc: # Public Storage Node API. - endpoint: 0.0.0.0:8080 tls: enabled: true # Private API for Morph and S3 Gateway in this container. - endpoint: 127.0.0.1:8084 tls: enabled: false ``` The `node.addresses` list in the same file shows the `grpcs://` addresses you entered. ## Limits - Gateway-type nodes do not work with storage nodes installed this way. The storage node's certificate is self-signed and is issued for `0.0.0.0`, the storage nodes accept it from each other, and the console and the S3 gateway of a gateway-type node do not. Install the storage nodes with `grpc://` if the cluster needs gateway-type nodes, and protect the traffic with a private network or an encrypted tunnel. - Use replicated storage policies (`REP`) in a cluster installed this way. In this release a read of an erasure-coded object fails when the storage node that receives the request has to fetch the object from another storage node over `grpcs://`. - The installer does not configure a certificate from a certificate authority. Although the underlying storage node has a `certificate` setting for a certificate issued for the node key, Morph manages the generated storage node configuration and manual edits to it are not supported; see [storage node settings](../../reference/configuration/storage-node.md). - The installation requests for storage-type and gateway-type nodes accept `https://` addresses for the FS chain RPC. The inner ring itself serves the RPC without TLS, so such an address works only through a TLS proxy that you place in front of port 30333. - TLS on the storage node API does not encrypt stored data. See [Encrypt data](../secure/encrypt-data.md). ## Related - [Ports and protocols](../../reference/ports-and-protocols.md) - [Put a load balancer in front](put-a-load-balancer-in-front.md) - [Harden a deployment](../secure/harden-a-deployment.md) - [Security model](../../explanation/security-model.md) --- # Add a gateway-only node This guide installs a gateway-type node: a Morph container that runs the console and the S3 gateway, has no storage node and no inner ring, and serves requests from an existing cluster. :::note The gateway-only installation is experimental in this release. ::: ## Before you start - A cluster is installed and ready. See [Install a cluster](install-a-cluster.md). - You have an administrator account on the cluster. - The new host is prepared as in [Prepare hosts](prepare-hosts.md). It needs no data drives. It must reach the storage node gRPC port (8080) of the storage nodes you name and the FS chain RPC port (30333) of the inner ring nodes you name. - You have `curl` and `jq` on your administration host. Set the variables. `MORPH_URL` is the console of a cluster-type node, `GATEWAY_HOST` the new host, `STORAGE_NODE` a storage node of the cluster and `CHAIN_NODE` an inner ring node. ```shell export MORPH_URL=http://10.0.0.11:9100 export GATEWAY_HOST=10.0.0.21 export GATEWAY_URL=http://$GATEWAY_HOST:9100 export STORAGE_NODE=10.0.0.11 export CHAIN_NODE=10.0.0.11 export ADMIN_PASSWORD='CreateYourOwnPassword' ``` ## Steps 1. Start the container on the new host. A gateway-type node publishes the console, the S3 port and the metrics port. ```shell docker run -d --restart unless-stopped \ --name morphgateway \ -p 9100:9100 \ -p 9080:9080 \ -p 5100:5100 \ -v /mnt/local_state:/morph/local_state \ morphbits/morph:0.30.1 ``` 2. Read the address and the public key of the node's gateway wallet from its installer. The console and the S3 gateway of the node share this wallet. ```shell GATEWAY_INFO=$(curl -s $GATEWAY_URL/api/v1/gateway-address) GATEWAY_ADDR=$(echo "$GATEWAY_INFO" | jq -r .address) GATEWAY_PUBLIC_KEY=$(echo "$GATEWAY_INFO" | jq -r .publicKey) echo "$GATEWAY_ADDR" echo "$GATEWAY_PUBLIC_KEY" ``` Keep the address. You need it to remove the gateway later. 3. Log in to the cluster as an administrator. ```shell TOKEN=$(curl -s -X POST $MORPH_URL/api/v1/login \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$ADMIN_PASSWORD\"}" | jq -r .token) ``` 4. Register the gateway key on the cluster. This grants the gateway's account access to the network. Send the request to a cluster-type node. ```shell curl -i -X POST $MORPH_URL/api/v1/cluster/gateways \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"publicKey\":\"$GATEWAY_PUBLIC_KEY\"}" ``` The answer is `204 No Content`. 5. Send the installation request to the new node. ```shell curl -i -X POST $GATEWAY_URL/api/v1/new-gateway \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"grpc_addresses\": [ \"grpc://$STORAGE_NODE:8080\" ], \"rpc_addresses\": [ \"http://$CHAIN_NODE:30333\" ] }" ``` The node answers `200 OK` with an empty body. | Field | Meaning | |---|---| | `grpc_addresses` | Storage nodes that the console and the S3 gateway of this node send their requests to. At least one. Each address needs a scheme: `grpc://host:port`. The installer also accepts `grpcs://host:port`, but a gateway-type node does not start against storage nodes that were installed with TLS; see [Enable TLS](enable-tls.md#limits). | | `rpc_addresses` | FS chain RPC endpoints of inner ring nodes, as `http://host:port`, `https://host:port` or `host:port`. At least one. | | `namespace` | Optional. Binds the node to one namespace; see below. | The S3 gateway gives all storage nodes in `grpc_addresses` the same priority and weight. List several storage nodes so that the S3 gateway has an alternative when one of them is down. The installer answers `400 Bad Request` with a message when an address is malformed or a list is empty. 6. Wait until the node is ready. ```shell docker logs -f morphgateway ``` The expected message is: ```text ✅ MORPH CONTAINER STARTED ``` 7. Log in again and issue new S3 credentials for the clients of this node. A token from `/api/v1/login` and an S3 credential work only on the nodes whose gateway key was registered when they were issued. The new node rejects the ones that are older than step 4. See [Manage S3 credentials](../secure/manage-s3-credentials.md). ### Bind the gateway to one namespace A gateway-type node can serve a single namespace. Do this in place of step 5. 1. Create the namespace on the cluster, if it does not exist yet. ```shell NAMESPACE=team-a curl -i -X POST $MORPH_URL/api/v1/cluster/namespaces \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"name\":\"$NAMESPACE\",\"description\":\"gateway-only namespace\"}" ``` 2. Pass the namespace in the installation request. ```shell curl -i -X POST $GATEWAY_URL/api/v1/new-gateway \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"grpc_addresses\": [ \"grpc://$STORAGE_NODE:8080\" ], \"rpc_addresses\": [ \"http://$CHAIN_NODE:30333\" ], \"namespace\": \"$NAMESPACE\" }" ``` The installer checks on the first address in `rpc_addresses` that the namespace exists, and answers `400 Bad Request` if it does not. After the node has started, its REST API and its S3 gateway use this namespace for every request. Clients must not send the `X-Morph-Namespace` header to this node: it answers such a request with `400 Bad Request`. The namespace management endpoints are disabled on it and answer `403 Forbidden`. ## Check the result Log in on the new node with the administrator account of the cluster. The users of the cluster are valid on the gateway node. ```shell curl -s -X POST $GATEWAY_URL/api/v1/login \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$ADMIN_PASSWORD\"}" | jq -r .role ``` The output is `admin`. On a node that is bound to a namespace, log in with a user of that namespace instead. The node looks up every login in its namespace. The login of the cluster administrator fails there with `403 Forbidden` and the text `Login failed.` Check the health metric of the S3 gateway on the new node: ```shell curl -s http://$GATEWAY_HOST:5100/metrics | grep neofs_s3_gw_state_health ``` The output contains `neofs_s3_gw_state_health 2`. ## Limits - A gateway-type node has no inner ring authority. Send cluster administration requests, such as decommissioning a node, to a cluster-type node. - The installation type is final. The installer does not run again on a node that has been installed. ## Remove a gateway node Decommission the gateway's account on a cluster-type node. `GATEWAY_ADDR` is the address from step 2. ```shell curl -i -X DELETE $MORPH_URL/api/v1/cluster/gateways/"$GATEWAY_ADDR" \ -H "Authorization: Bearer $TOKEN" ``` The answer is `204 No Content`. Then stop the container on the gateway host. More on removing nodes is in [Decommission a node](../operate/decommission-a-node.md). ## Related - [Use namespaces](../buckets-and-objects/use-namespaces.md) - [Put a load balancer in front](put-a-load-balancer-in-front.md) - [Installer API](../../reference/installer-api.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) --- # Put a load balancer in front This guide configures an external load balancer that gives clients one address for the S3 API of a Morph cluster and terminates TLS for it. Morph contains no load balancer. Every node serves S3 on port 9080 and the console on port 9100, and clients that are given the address of one node use only that node. A load balancer in front of the nodes spreads the requests and removes a failed node from the path. Use any HTTP or TCP load balancer that meets the requirements below. ## Before you start - A cluster is installed. See [Install a cluster](install-a-cluster.md). - You have a load balancer that can reach port 9080 of every node, and port 5100 if it is to use the metrics-based health check. - You have a TLS certificate for the name that clients will use, if the load balancer is to serve HTTPS. Morph's S3 and console listeners are plain HTTP; see [Enable TLS](enable-tls.md). ## What you can rely on | Fact | Consequence for the load balancer | |---|---| | The S3 gateway keeps no state of its own. Buckets, objects and S3 credentials are stored in the cluster. | Any node's S3 gateway can serve any S3 request. No session affinity is needed. | | An S3 credential works only on the nodes whose gateway key was registered when the credential was issued. | A node that joined the cluster later answers `AccessDenied` for older credentials. Issue new credentials before you add such a node to the pool. See [Manage S3 credentials](../secure/manage-s3-credentials.md). | | By default each S3 gateway sends its requests to the storage node of its own Morph node. | On a cluster-type or storage-type node, the storage node and the S3 gateway fail together. When the storage node of such a node is down, take the whole node out of the pool. A gateway-type node has no storage node. It uses the storage nodes it was given at installation and stays in the pool while one of them answers. | | The S3 gateway is installed without a list of domains for virtual-hosted-style requests. | Clients address buckets in path style: `https:////`. | | The S3 gateway verifies the signature of a request over the headers that the client signed, and clients sign the `Host` header. | Pass requests through unchanged, with the `Host` header the client sent. | | The generated S3 gateway configuration limits each gateway to 100 client requests at a time, with a deadline of 30 seconds after which the gateway answers `RequestTimeout`. | Spread load across all nodes. Do not concentrate it on a few. | | The entrypoint of a node probes its processes every 10 seconds. By default, after 3 consecutive failed probes of one process it stops the whole container. It stops the container at once when a process exits. | A node with a failed process disappears completely, on all ports. A plain TCP check detects it. With `--restart unless-stopped` Docker starts the container again, and the node returns by itself. | ## Steps 1. Create a backend pool with the S3 endpoint of every cluster-type and storage-type node, and of every gateway-type node if you have them: `:9080`, plain HTTP. 2. Add a health check for each pool member. Morph's S3 gateway and console have no dedicated health endpoint. Use one of these checks: | Check | Request | Healthy when | What it covers | |---|---|---|---| | TCP | Connect to `:9080` | The connection opens | The S3 gateway process listens. Because the entrypoint stops the container when a process stays unhealthy, this also covers the other processes with a delay. | | Metrics | `GET http://:5100/metrics` | The body contains the lines `neofs_s3_gw_state_health 2` and, on nodes with a storage node, `neofs_node_state_health 2` | The health states that the S3 gateway and the storage node report. This is the check the entrypoint itself uses. | The metrics response contains the metrics of all processes of the node. On the nodes of a new cluster it has 125 to 230 KiB, and the health lines are not at its start. Use this check only if your load balancer can search a response body of that size. HAProxy, for example, searches only the first 16 KiB and reports healthy nodes as failed, unless you raise `tune.bufsize`. The TCP check needs a load balancer that runs outside the Docker host of the node. For a container on the same Docker host, Docker accepts a connection to a published port as soon as the Morph container runs, also while the S3 gateway is not listening yet. 3. Create the listener that clients connect to, for example HTTPS on port 443 with your certificate, and forward it to the pool. Forward the request path, the query string and all headers unchanged. 4. Allow long requests. Uploads and downloads of large objects are single HTTP requests that last as long as the transfer. Set the load balancer's idle and request timeouts and its request body limit so that they do not cut off your largest transfers. 5. Give clients the address of the load balancer as S3 endpoint, with path-style addressing. See [Use the AWS CLI](../integrate/aws-cli.md). 6. Optional: add a second listener and pool for the console, `:9100`, plain HTTP. The entrypoint's own probe for the console is `HEAD /` on port 9100 with any status below 400 counting as healthy; use the same request as health check. ## Requirements at a glance | Item | S3 | Console | |---|---|---| | Backend port on each node | 9080 | 9100 | | Backend protocol | HTTP | HTTP | | TLS | Terminated on the load balancer | Terminated on the load balancer | | Health check | TCP on 9080, or `neofs_s3_gw_state_health 2` in `GET :5100/metrics` | `HEAD /` on 9100, status below 400 | | Session affinity | Not needed | Not needed for the REST API | | Headers | Unchanged, `Host` included | Unchanged | | Bucket addressing | Path style | Does not apply | ## Check the result 1. Send an S3 request through the load balancer, for example list your buckets as in [Use the AWS CLI](../integrate/aws-cli.md) with the load balancer as endpoint. The request succeeds with the same credentials that work against a single node. 2. Stop the Morph container on one node and repeat the request several times. After the health check has removed the node, no request is sent to it any more. Requests succeed for buckets whose storage policy tolerates the loss of one node. ```shell docker stop morphcluster ``` 3. Start the container again and wait for `✅ MORPH CONTAINER STARTED` in its log before you count the node as back. ```shell docker start morphcluster docker logs -f morphcluster ``` ## Before maintenance on a node Remove the node from the pool before you stop its container or put its storage node into maintenance mode, and add it back when the node is ready again. See [Use maintenance mode](../operate/use-maintenance-mode.md). The health checks of step 2 do not do this for you. A node in maintenance keeps port 9080 open and keeps reporting `neofs_node_state_health 2`, while its S3 gateway answers requests with status `500`. Reads through the other nodes can fail during the maintenance, too. A node that holds no replica of an object fetches it from the nodes that do, in the order of the object's placement. When the first of them is the node in maintenance, the read ends with status `500`. The same read succeeds through a node that holds a replica. ## Related - [Ports and protocols](../../reference/ports-and-protocols.md) - [S3 gateway settings](../../reference/configuration/s3-gateway.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) - [Check cluster health](../observe/check-cluster-health.md) --- # Deploy across sites This guide sets up one Morph network that spans several sites and keeps working when one site is lost. Morph has no replication between separate clusters. A multi-site deployment is one network with one inner ring, and the storage policy of each bucket decides which sites hold its data. How policies select nodes is explained in [data placement](../../explanation/data-placement.md). ## Before you start - You have sized the cluster. See [Size a cluster](size-a-cluster.md). - You have at least four locations for inner ring nodes. Step 1 shows why three are not enough. Step 5 covers what the fourth location stores. - Every node can reach every other node across the sites on the ports listed in [Prepare hosts](prepare-hosts.md). - The cluster is not installed yet. The node attributes and the inner ring members are set by the installation requests and are not changed by the installer afterwards. ## Steps ### 1. Place the inner ring nodes The inner ring needs a quorum of 3 of 4 or 5 of 7 nodes. Below quorum no bucket can be created, no access rule or user can be changed, the epoch does not advance, and failed nodes are not removed from the network map. The inner ring survives the loss of a site only if the site holds no more nodes than the inner ring can miss: 1 of 4, or 2 of 7. | Inner ring nodes | Distribution | Largest site lost | Nodes left | Quorum kept | |---|---|---|---|---| | 4 | 2 + 2 | 2 | 2 | no | | 4 | 2 + 1 + 1 | 2 | 2 | no | | 4 | 1 + 1 + 1 + 1 | 1 | 3 | yes | | 7 | 4 + 3 | 4 | 3 | no | | 7 | 3 + 2 + 2 | 3 | 4 | no | | 7 | 2 + 2 + 2 + 1 | 2 | 5 | yes | Use 2 + 2 + 2 + 1 for three sites: two inner ring nodes in each site, and one in a fourth location that is independent of the three. With two sites, one of them always holds more inner ring nodes than the inner ring can miss. Every inner ring node is a cluster-type node and runs a storage node too. Decide in step 4 whether the node in the fourth location holds data. ### 2. Choose the site attribute Storage policies tell sites apart by a node attribute. Choose one key, for example `site`, and one value per location: `site:a`, `site:b`, `site:c`, `site:d`. - Give the attribute to every storage node, including the node in the fourth location. A selector that groups by `site` puts all nodes without the attribute into one group of their own, which then counts as a site. - Spell the values identically on all nodes of a site. Values are compared as text. - You can add further attributes, for example `rack:a1`, in the same list. ### 3. Install the nodes with the attribute Follow [Install a cluster](install-a-cluster.md). Put the attribute into the installation request of each node. For a cluster-type node, in the `start-node` request: ```json "sn_attributes": ["site:a", "rack:a1"] ``` For a storage-type node, in the `new-sn` request: ```json "attributes": ["site:a", "rack:a2"] ``` List all inner ring nodes of all sites in `installers_addresses`. When you add a storage-type node, list inner ring nodes of several sites in `side_chain_ws_addresses`, so that the node can reach the FS chain after the loss of a site. ### 4. Write the storage policies A bucket gets its storage policy when it is created. Choose one of the forms below for each bucket. The examples are for three sites `a`, `b`, `c` and three replicas. The policy syntax is in the [storage policy language](../../reference/storage-policy-language.md); how to apply a policy is in [Create a bucket](../buckets-and-objects/create-a-bucket.md). #### Form 1: no selector, small sites ```text REP 3 ``` | Property | Value | |---|---| | Guarantee | The three replicas of an object are on three different nodes. If no site has three or more storage nodes, no site can hold all replicas, and every object survives the loss of one site. | | Not guaranteed | One replica in each site. Two of the three replicas can be in the same site. | | While a site is down | Reads continue. Writes continue as long as three storage nodes of the bucket are available. | | Works for | Layouts such as 2 + 2 + 2 + 1. It gives no site guarantee as soon as one site has three or more storage nodes. | The same reasoning holds for an erasure-coded policy `EC d/p`: if no site has more than p storage nodes, the loss of a site takes away at most p parts of an object, and the object stays readable. Writes continue only if d + p storage nodes remain. On 2 + 2 + 2 + 1, `EC 3/2` meets both conditions: a site loss leaves 5 nodes for 5 parts. A bucket needs as many storage nodes in the network map as one object is placed on: 3 for `REP 3`, d + p for `EC d/p`. With fewer nodes in the map, every object operation on the bucket fails, reads included. On 2 + 2 + 2 + 1, an `EC 3/2` bucket is at that limit after the lost site has left the network map: one more node that leaves the map stops the bucket until 5 storage nodes are in the map again. #### Form 2: one replica in each of three distinct sites, placement factor 1 ```text REP 3 IN X CBF 1 SELECT 3 IN DISTINCT site FROM * AS X ``` | Property | Value | |---|---| | Guarantee | Every object has one replica in each of three different sites. | | Limit: capacity | The bucket uses exactly three nodes, one per site. Its capacity is that of one node per site. | | Limit: no reserves | While one of the three nodes is unavailable, writes to the bucket fail. They work again when the node returns, or when it has been removed from the network map and another node of a site takes its place. | | After a site has left the network map | The policy needs three different values of `site` in the network map. If a fourth value exists, such as `site:d` of the fourth location, the bucket continues there and its data is rebuilt on that node. If only two values are left, every object operation on the bucket fails, reads and listings included. | Do not raise the placement factor to get reserves. With a placement factor above 1, `SELECT 3 IN DISTINCT site` still takes its nodes from three sites, but the three nodes that hold one object are chosen from all of them without regard to the site, and two replicas can end up in the same site. #### Form 3: one rule per site ```text REP 1 IN A REP 1 IN B REP 1 IN C CBF 2 SELECT 1 FROM FA AS A SELECT 1 FROM FB AS B SELECT 1 FROM FC AS C FILTER site EQ a AS FA FILTER site EQ b AS FB FILTER site EQ c AS FC ``` | Property | Value | |---|---| | Guarantee | Every object has one replica in site `a`, one in `b` and one in `c`. | | Reserves | Each rule has up to two nodes of its site to choose from, so one failed node in a site does not stop writes. | | While a site is down | Reads continue from the other sites. Writes fail, because the rule of the lost site cannot store its replica. | | After the site has left the network map | The filter of that site matches no node. Every object operation on the bucket fails, reads and listings included, until a node with that `site` value is in the network map again. | :::warning A policy that names a site depends on that site being in the network map. A storage node that has been silent for more than three epochs is removed from the map; with the default epoch of one hour that is three to four hours after the failure. From then on, buckets with a policy of form 3 cannot be read, although their data is intact in the other sites. Plan for this before you choose form 3, and read [Recover from a site failure](../operate/recover-from-a-site-failure.md). ::: #### Choosing | You need | Use | |---|---| | Survival of one site, writes that continue during the outage, small sites | Form 1 | | A replica in every site, and operation that continues by itself after a site is gone | Form 2, with a fourth `site` value in the network | | A replica in every named site and reserves inside each site, and you accept that the bucket stops when a named site leaves the network map | Form 3 | ### 5. Decide what the fourth location stores The inner ring node in the fourth location runs a storage node and is in the network map. - Under form 1 it is a storage node like any other and holds replicas. - Under form 2 it is a site like the others. With four `site` values in the network, each bucket uses three of them, selected per bucket. The fourth location therefore holds a replica for part of the buckets from the start, and it takes the place of a site that has left the network map. Give it capacity for both. - Under form 3 it holds nothing, because no filter matches `site:d`. ## Check the result 1. List the storage nodes of the network map with their attributes. `MORPH_URL` is the console of a cluster-type node and `TOKEN` an administrator token, as in [Install a cluster](install-a-cluster.md). ```shell curl -s $MORPH_URL/api/v1/cluster/storage-nodes \ -H "Authorization: Bearer $TOKEN" | jq '.nodes[] | {endpoints, attributes}' ``` Every node shows its `site` attribute, and every site shows the number of nodes you planned. 2. Create a test bucket with your policy and store an object in it. If the current network map cannot satisfy the policy, the console API refuses to create the bucket with `409` and the text `Inapplicable policy.` 3. Count the inner ring nodes per site against the table in step 1. ## Related - [Data placement](../../explanation/data-placement.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md) - [Recover from a site failure](../operate/recover-from-a-site-failure.md) --- # Upgrade a cluster This guide upgrades a running Morph cluster to a new image, one node at a time, while the cluster keeps serving clients. An upgrade replaces the Morph container. All state of a node lives outside the image: in `/morph/local_state` and in the data and metadata paths of the storage node. The new container finds this state, migrates the configuration files where the new release needs it, and starts the bundled processes. Morph has no upgrade command and no downgrade procedure. The changelogs describe forward migrations only. Read [Roll back](#roll-back) before you start. ## Before you start - Read the [release notes](../../releases/release-notes.md) and the [upgrade paths](../../releases/upgrade-paths.md) for every release between your version and the target. - Do not skip a release whose bundled storage node removes a migration that your installation still needs. The table in [upgrade paths](../../releases/upgrade-paths.md) names the starting versions each release accepts. For example, 0.28.0 can be reached from 0.25.0 to 0.27.0, and the notes for 0.29.0 say to run the node version of 0.28.0 first on an older installation. - Make sure that `/morph/local_state`, every shard data path, the metadata path and the write-cache paths are host directories mounted into the container. A node whose state lives inside the container loses its keys and its data when the container is removed. See [Install a cluster](../deploy/install-a-cluster.md). - Keep the exact `docker run` command of every node: published ports, volumes and environment variables. The new container needs the same ones. - Check that the cluster is healthy: every storage node is in the network map, every inner ring node reports ready, and no repair is in progress. See [Check cluster health](../observe/check-cluster-health.md). - Plan for the inner ring quorum. A cluster with 4 inner ring nodes needs 3 of them, a cluster with 7 needs 5. Upgrade one cluster-type node at a time so that the FS chain keeps producing blocks. Set the variables used below on the node you upgrade: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container on this node export MORPH_IMAGE=morphbits/morph:0.30.1 # image to upgrade to export STATE_DIR=/mnt/local_state # host directory mounted at /morph/local_state export METRICS_URL=http://localhost:5100 # metrics collector of this node export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator ``` ## Order of nodes 1. Gateway-type nodes, in any order. 2. Storage-type nodes, one at a time. 3. Cluster-type nodes, one at a time. Finish all checks on a node before you stop the next one. The order keeps the inner ring on the old release until the rest of the cluster has shown that the new release starts. The order can be reversed; the only hard constraint is the inner ring quorum. ## Upgrade one node 1. Stop the Morph container. The entrypoint sends `SIGTERM` to every bundled process and waits up to `MORPH_SHUTDOWN_TIMEOUT` seconds (30 by default) for each of them. Give Docker a longer timeout than that, so that the processes can close their databases. ```shell docker stop --time 60 "$MORPH_CONTAINER" ``` 2. Back up the node state while the container is stopped. The copy is what you need to go back to the old image. ```shell cp -a "$STATE_DIR" "$STATE_DIR.pre-upgrade" ``` The copy includes the generated configuration files, the wallets, the storage node's state file `neofs-storage-state` and, on a cluster-type node, the chain database `fschain.bolt`. See [Back up and restore](back-up-and-restore.md) for what each file is. 3. Remove the old container. The state on the host stays. ```shell docker rm "$MORPH_CONTAINER" ``` 4. Start a container from the new image with the same ports, volumes and environment variables as before. The example shows the options of a cluster-type node with two drives; use the command of your own node. ```shell docker run -d --restart unless-stopped --name "$MORPH_CONTAINER" \ -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 5100:5100 -p 9080:9080 \ -p 20334:20334 -p 21334:21334 \ -v "$STATE_DIR":/morph/local_state \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/sdb:/data/sdb -v /mnt/sdc:/data/sdc -v /mnt/meta:/data/meta \ "$MORPH_IMAGE" ``` 5. Follow the log until the container reports that it has started. ```shell docker logs -f "$MORPH_CONTAINER" ``` The line to wait for is: ```text ✅ MORPH CONTAINER STARTED ``` 6. Check the node as described in [Check the result](#check-the-result), then go to the next node. ## What the entrypoint does on start The entrypoint reads `/morph/local_state/config/installation.txt` to learn the installation type. The file exists on an installed node, so the installer does not run again and the installer configuration file is not read again. Before it starts a process, the entrypoint migrates that process's configuration file if the file is older than the release: | File in `/morph/local_state/config` | Process | Migrations in this release line | |---|---|---| | `config.yaml` | console | 0.25.0: `neofs.sessionTTL` becomes a duration in hours. 0.29.0: single endpoints become lists. 0.30.1: the `license` key is removed. | | `config-ir.yaml` | inner ring (cluster-type nodes) | 0.26.0: `experimental.chain_meta_data` becomes a section. 0.27.0: the `hardforks` section is added and `fschain.consensus.max_time_per_block` is set to `20s`. | | `config-sn.yaml` | storage node (cluster-type and storage-type nodes) | 0.26.0: metadata service ports are added. 0.27.0: the `object` section and `metadata.rpc_addresses` are removed, and `metadata.p2p_addresses` is set to `0.0.0.0:21334`. | Each migration keeps the previous file next to the new one as `.pre--migration` and logs two lines: ```text config migration complete old config preserved ``` The processes then start in this order: inner ring, storage node, console, S3 gateway. The entrypoint waits for each one to report ready before it starts the next. A storage-type node also waits until its storage node is in the network map. On a cluster-type node three more things can happen: - The console deploys or updates Morph's own contracts on the FS chain. An update is sent as a request that the inner ring majority has to sign. - The entrypoint sets `fschain.consensus.max_time_per_block` in `config-ir.yaml` to `20s` if the file has another value, keeps the previous file as `config-ir.yaml.pre-reconfig` and restarts the inner ring process once. The installer writes `2s`, so this also happens on the first start after an installation. The log line is `IR config was updated for production block time, restarting IR`. - When a release introduces a chain hardfork on an existing cluster, the console requests the schedule through the cluster configuration contract. The entrypoint of each cluster-type node checks the contract once per minute, writes the activation height into `config-ir.yaml`, keeps the previous file as `config-ir.yaml.pre-hardfork`, and restarts only the inner ring process. See [Hardforks](../../explanation/inner-ring-and-fs-chain.md#hardforks). The storage node migrates its own data formats when it starts. A new metadata format is applied to each shard's metabase on the first start, which takes time on shards with many objects. ## Check the result Run these checks on every node before you upgrade the next one. 1. The three health metrics report the value 2, which means ready. A storage-type node has no `neofs_ir_state_health`; a gateway-type node has only `neofs_s3_gw_state_health`. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_(ir|node|s3_gw)_state_health ' ``` ```text neofs_ir_state_health 2 neofs_node_state_health 2 neofs_s3_gw_state_health 2 ``` 2. The storage node is in the network map. The list contains the node's address. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` 3. The log has no `health probe failed` warnings after the start line. ```shell docker logs "$MORPH_CONTAINER" 2>&1 | grep 'health probe failed' ``` 4. On a cluster-type node, the chain height grows. Run the command twice, a few seconds apart. ```shell curl -s "$METRICS_URL/metrics" | grep '^neogo_block_height ' ``` 5. Repair triggered by the restart has finished. The storage node sets this metric to 1 when a full pass over its objects found no missing replica or part. It starts at 0 after every restart. ```shell curl -s "$METRICS_URL/metrics" | grep '^neofs_node_state_policer_consistency_state ' ``` While the node was down, other nodes may have rebuilt some of its objects. They remove the surplus copies in the background after the node is back. To avoid the rebuild, put the node into [maintenance mode](use-maintenance-mode.md) first and wait until the network map shows the state. 6. On a cluster-type node, check the container log for chain hardfork messages. ```shell docker logs "$MORPH_CONTAINER" 2>&1 | grep -v 'getapplicationlog' | grep -i 'hardfork' ``` When a release schedules a hardfork on an existing cluster, the console logs `scheduling hardfork` and then `hardfork is scheduled`. Scheduling needs the signatures of the inner ring majority, so do not wait for the schedule on the first upgraded nodes before moving to the next one; finish upgrading all cluster-type nodes before the activation height. Other upgraded cluster-type nodes log `hardfork is scheduled, waiting for local configuration` until their entrypoint applies the schedule. Once the schedule is on the chain, the entrypoint of each upgraded node logs: ```text scheduled hardfork was written to IR config IR config was updated from hardfork schedule, restarting IR ``` followed by `IR process restarted` in the full container log. When nothing is pending, the console logs `no stable hardfork to schedule`, or after a restart the entrypoint logs `latest scheduled hardfork is already configured in IR config`. If the log shows a failure line: | Log line | Meaning | What to do | |---|---|---| | `could not schedule hardfork` (console) | The schedule request failed. The console tries again every minute. | Check the inner ring quorum. The request needs blocks and the signatures of the inner ring majority, so this can appear until enough cluster-type nodes run the new release. | | `hardfork schedule check failed` (entrypoint) | The entrypoint could not read the schedule from the chain or could not change `config-ir.yaml`. It tries again every minute. | Check that the chain RPC of the node answers and that `/morph/local_state` is writable. | | `failed to restart IR after hardfork schedule` (entrypoint), followed by the container stopping | The inner ring process did not come back with the new configuration. | Start the container again. The height is already in `config-ir.yaml`; the previous file is `config-ir.yaml.pre-hardfork`. If the inner ring does not start, [collect diagnostics](../troubleshoot/collect-diagnostics.md). | ## Roll back A rollback means stopping the container, restoring the copy of `/morph/local_state` taken in step 2, and starting a container from the old image. It has limits: - **Storage node state file.** The storage node of Morph 0.30.1 converts the session records in `neofs-storage-state` on its first start. Older storage nodes cannot read the converted file. Restore the copy taken before the upgrade; do not start the old image on the converted file. - **Configuration files.** The old image does not undo configuration migrations. The restored copy has the old files. Without the copy, the `.pre--migration` files are the previous versions. - **Metadata formats.** The changelogs describe the automatic migration of shard metabases to a newer format and no way back. The metabases are not in `/morph/local_state`, so the copy from step 2 does not contain them. A storage node does not start on a metabase of a newer format than its own; it reports `invalid version, resynchronization is required`. - **The FS chain.** Contracts that the new release updated stay updated, and blocks produced after the upgrade stay on the chain. Restoring `fschain.bolt` on one inner ring node does not undo them; the node synchronizes with the other inner ring nodes again. - **Compressed objects.** The storage node of Morph 0.30.1 does not read objects that an older storage node stored compressed. The generated storage node configuration of this release line does not enable compression. Roll back one node while the others still run the old release. Once all nodes run the new release, treat the upgrade as final. ## Related - [Upgrade paths](../../releases/upgrade-paths.md) - [Component versions](../../releases/component-versions.md) - [Back up and restore](back-up-and-restore.md) - [Use maintenance mode](use-maintenance-mode.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) --- # Add storage nodes This guide adds a storage-type Morph node to a running cluster. Clients keep reading and writing during the whole procedure. A storage-type node runs a storage node, a console and an S3 gateway. It runs no inner ring: the number of inner ring nodes is fixed when the cluster is installed. To see how data moves after an expansion, open the [architecture explorer](/architecture-explorer?scenario=expand). ## Before you start - A running cluster and the session token of a global administrator. See [Manage users and roles](../secure/manage-users-and-roles.md). - A prepared host with its drives described in the installer configuration. See [Prepare hosts](../deploy/prepare-hosts.md) and [Configure drives and shards](../deploy/configure-drives.md). - Network access from the new host to the chain RPC port (30333) of the inner ring nodes and to the storage node port (8080) of the other nodes, and from the other nodes to the new host. See [Ports and protocols](../../reference/ports-and-protocols.md). - A license that allows one more node and its capacity, or a cluster that is still inside its demo period. See [Manage licenses](manage-licenses.md). - The node attributes for the new node. Storage policies select nodes by attribute, so a new node receives data only from buckets whose policy matches it. See [Deploy across sites](../deploy/deploy-across-sites.md). Set the variables used below: ```shell export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator export NEW_NODE_URL=http://192.0.2.21:9100 # port 9100 of the new node export NEW_NODE_GRPC=grpc://192.0.2.21:8080 # address other nodes use to reach the new storage node export CHAIN_RPC_1=http://192.0.2.11:30333 # chain RPC of an inner ring node export CHAIN_RPC_2=http://192.0.2.12:30333 # chain RPC of a second inner ring node export METRICS_URL=http://192.0.2.21:5100 # metrics collector of the new node export NODE_ATTR_1=site:a # first attribute of the new node, as key:value export NODE_ATTR_2=rack:a4 # second attribute of the new node ``` ## Steps 1. Start the Morph container on the new host with the same image version as the cluster. Mount `/morph/local_state`, the installer configuration and the drives as described in [Install a cluster](../deploy/install-a-cluster.md). A storage-type node needs the ports 9100, 8080, 9080, 5100 and 21334. Port 21334 is the storage node's listener on the metadata chain. ```shell docker run -d --restart unless-stopped --name morphsnnode \ -p 9100:9100 -p 8080:8080 -p 9080:9080 -p 5100:5100 -p 21334:21334 \ -v /mnt/local_state:/morph/local_state \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/sdb:/data/sdb -v /mnt/sdc:/data/sdc -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` The container creates the node's keys and waits for the installation request. 2. Read the account address of the new storage node. ```shell curl -s "$NEW_NODE_URL/api/v1/sn-address" ``` ```json { "address": "Nfy6sGqFAHS5JhbaRFBvkYm4ieBAymJAt5" } ``` ```shell export SN_ADDRESS=Nfy6sGqFAHS5JhbaRFBvkYm4ieBAymJAt5 ``` 3. Grant the address on the cluster. Send the request to a cluster-type node. The console checks the license and transfers the GAS that the node needs to send its transactions to the FS chain. ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"address\": \"$SN_ADDRESS\"}" ``` The response is `204 No Content`. A `400` with `Failed to add node.` means the license does not allow the node. A `409` means the address was decommissioned before and cannot be granted again. 4. Register the gateway key of the new node. The node runs a console and an S3 gateway that share one gateway account. The cluster has to grant this account before the node starts, or the console and the S3 gateway fail to start and the container never reports `✅ MORPH CONTAINER STARTED`. Read the account address and public key from the new node. ```shell curl -s "$NEW_NODE_URL/api/v1/gateway-address" ``` ```json { "address": "NWWnEru5GggqkmY7izWG5mu1Wqh1eG5Lzf", "publicKey": "030163fe87a5da27f00d9959766c91eb0b26c39ba84d19fa9ffcad104a720cfe5e" } ``` ```shell export GATEWAY_KEY=030163fe87a5da27f00d9959766c91eb0b26c39ba84d19fa9ffcad104a720cfe5e ``` Grant the key on a cluster-type node. ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/gateways" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d "{\"publicKey\": \"$GATEWAY_KEY\"}" ``` The response is `204 No Content`. 5. Complete the installation on the new node. `attributes` are the node attributes as `key:value`. `addresses` is the address that the node announces to the cluster; use `grpcs://` if the node serves TLS. `side_chain_ws_addresses` lists the chain RPC endpoints of the inner ring nodes; give more than one so that the node can change endpoints when an inner ring node is down. ```shell curl -X POST "$NEW_NODE_URL/api/v1/new-sn" \ -H "Content-Type: application/json;charset=UTF-8" \ -d "{ \"attributes\": [\"$NODE_ATTR_1\", \"$NODE_ATTR_2\"], \"addresses\": [\"$NEW_NODE_GRPC\"], \"side_chain_ws_addresses\": [\"$CHAIN_RPC_1\", \"$CHAIN_RPC_2\"] }" ``` Grant the address and register the gateway key (steps 3 and 4) before this step. The storage node cannot register on the FS chain without GAS. 6. Wait for the node to enter the network map. The storage node starts, asks the inner ring to join and is a candidate until the next epoch. With the default epoch of 3600 seconds this takes up to one hour. The container logs `local SN is not in Netmap` every 10 seconds while it waits. The console and the S3 gateway of the new node start only after that. ```shell docker logs -f morphsnnode ``` The lines to wait for are: ```text ✅ local SN in Netmap ✅ MORPH CONTAINER STARTED ``` 7. Add the S3 endpoint of the new node (port 9080) to your load balancer. See [Put a load balancer in front](../deploy/put-a-load-balancer-in-front.md). Repeat the steps for every new node. Nodes that are granted and started within the same epoch enter the network map together, which moves existing data once and not once per node. ## Check the result List the storage nodes of the current network map. The new node appears with its address, endpoints and attributes. Candidates are not listed. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` Check that the storage node on the new host is ready: ```shell curl -s "$METRICS_URL/metrics" | grep '^neofs_node_state_health ' ``` ```text neofs_node_state_health 2 ``` ## What happens to existing data From the epoch in which the node is in the network map: - **New objects** of every bucket whose storage policy matches the new node are placed over the larger node set at once. The new node receives its share of new writes. - **Existing objects** stay where they are at first and stay readable. Where the new node now ranks ahead of a current holder, a read asks the new node first, gets `not found` and continues with the next node. Such reads take extra hops; they do not fail. - **Buckets that already use their maximum number of nodes** (the count of the rule times the placement factor) are the exception. Adding matching nodes can replace some of the bucket's nodes. An object whose holders have all been replaced is reported as `not found` until the policer of an old holder has copied it to a current one. Buckets with a single replica are the most exposed. See [Data placement](../../explanation/data-placement.md). - **The policer** of every node then moves replicas and parts into the new order. A holder copies its object to the node that now ranks for it and removes its own copy only after that. With the default settings a node checks at most 10 objects per second. The faster pace of 30 per second applies only while it repairs missing replicas or parts. - **Buckets whose policy does not select the new node** are not touched. No operator action is needed, and there is no command to start or stop the move. ## Watch the progress All values come from the metrics collector on port 5100 of each node. | Metric | Meaning | |---|---| | `neofs_node_state_policer_optimal_placement` | 0 while the node finds replicas that belong on another node. 1 after a full pass that found none. It does not follow erasure-coded parts. | | `neofs_node_state_policer_consistency_state` | 0 while the node finds objects with too few replicas or parts. 1 after a full pass that found none. | | `neofs_node_state_policer_cycle_count` | Number of full passes of the policer over the node's objects. | | `neofs_node_state_policer_object_count` | Objects handled by the policer, by `action` (`processed`, `replicated`, `deleted`, `relocated`) and `mode` (`replica`, `ec`, `physical`). | | `neofs_node_engine_payload_size` | Bytes stored per shard. It grows on the new node and shrinks on the others. | For replicated buckets the move is complete when `neofs_node_state_policer_optimal_placement` is 1 on every storage node. The gauge stays at 1 while erasure-coded parts are still moving. For erasure-coded buckets, watch `neofs_node_state_policer_object_count{action="replicated",mode="ec"}`: the move is complete when it has stopped rising on every storage node for a full pass, that is while `neofs_node_state_policer_cycle_count` went up by one. Both state metrics start at 0 when a storage node starts. Each drops to 0 as soon as the policer finds an object of its kind, in the middle of a pass, and returns to 1 only at the end of a full pass that found none. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_state_policer_(optimal_placement|consistency_state|cycle_count) ' ``` ## Related - [Data placement](../../explanation/data-placement.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Metrics](../../reference/metrics.md) - [Installer API](../../reference/installer-api.md) - [Decommission a node](decommission-a-node.md) --- # Decommission a node This guide removes a storage node or a gateway from a cluster permanently and confirms that the remaining nodes hold all data with full redundancy. Decommissioning is an operation on the FS chain. It does not copy data off the node first. The remaining nodes restore redundancy afterwards from the replicas and parts they hold. For planned work after which the node returns, use [maintenance mode](use-maintenance-mode.md). :::danger Decommissioning cannot be undone. The node's account is blocked on the FS chain and cannot be granted access again. An object whose only replica is on the node becomes unavailable when the node leaves the network map. ::: ## What decommissioning does For a storage node, the console of a cluster-type node sends these transactions, each signed by the inner ring: 1. It blocks the node's account on the FS chain. A blocked account cannot send transactions, so the node can no longer register or report its state. 2. It removes the keys that are registered for this account as console or S3 gateway keys. 3. It removes the node from the candidates for the network map. The network map itself changes at the next epoch. Until then the node is still in the map and still serves requests. The API does not force a new epoch; with the default epoch of 3600 seconds the change takes up to one hour. After the node has left the network map: - Clients and other nodes stop asking it for objects. Storage policies are applied to the map without it. - The policers of the remaining nodes find the objects that lost a replica or a part, rebuild them and store them on the nodes that now rank for them. - The storage node on the decommissioned machine keeps its data and does not delete it. The Morph container keeps running until you stop it. For a gateway, the account is blocked and its registered gateway key is removed. Nothing changes in the network map unless the same account also belongs to a storage node. ## Before you start - The session token of a global administrator and the console of a **cluster-type** node. A storage-type or gateway-type node answers decommission requests with `501`. - A working inner ring quorum. The transactions need blocks. - A healthy cluster: every other storage node is in the network map and reports `neofs_node_state_policer_consistency_state 1`. Do not decommission a node while another node is down or repair is in progress. - Enough nodes left for every storage policy. A policy that cannot select enough nodes from the network map makes every operation on its buckets fail, reads included. Check each policy against the node set without the node. See [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). - No bucket that keeps a single replica on this node. With `REP 1` the node may hold the only replica of an object, and that object becomes unavailable. - Enough free space on the remaining nodes for the data of the node. The inner ring process of a cluster-type node cannot be decommissioned. The number of inner ring nodes is fixed for the life of the cluster, and the API refuses inner ring accounts. You can decommission the storage node of a cluster-type machine, but the machine has to keep running for the inner ring. Set the variables used below: ```shell export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator export METRICS_URL=http://localhost:5100 # metrics collector of a remaining node export MORPH_CONTAINER=morphsnnode # name of the Morph container on the machine you remove ``` ## Decommission a storage node 1. Find the account address of the storage node. The list shows every node of the current network map with its address, endpoints and attributes. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` ```shell export STORAGE_NODE_ADDRESS=Nfy6sGqFAHS5JhbaRFBvkYm4ieBAymJAt5 ``` 2. Take the node's S3 endpoint out of your load balancer. 3. Note the current epoch, so that you can tell when the next one has started. ```shell curl -s "$METRICS_URL/metrics" | grep '^neofs_node_state_epoch ' ``` 4. Send the decommission request. ```shell curl -i -X DELETE "$MORPH_URL/api/v1/cluster/storage-nodes/$STORAGE_NODE_ADDRESS" \ -H "Authorization: Bearer $TOKEN" ``` The response is `202 Accepted`. A `400` means the address is not a storage node of the current network map or a candidate, or it is a protected account. If the request fails part of the way with `500`, send it again: the steps that were completed are skipped. 5. Wait for the next epoch. The epoch metric increases by one, and the node is gone from the list of storage nodes. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` 6. Wait until the remaining nodes have restored redundancy. See [Confirm that the data is redundant elsewhere](#confirm-that-the-data-is-redundant-elsewhere). Keep the machine and its drives untouched until then. 7. Decommission the gateway account of the same machine, if the machine is a storage-type node that you remove completely. See the next section. 8. Stop the Morph container on the machine. ```shell docker stop "$MORPH_CONTAINER" ``` ## Decommission a gateway Every Morph node has a gateway account, used by its console and its S3 gateway. A gateway-type node has only this account. 1. Find the gateway's account address. The list shows every registered gateway key with its address. ```shell curl -s "$MORPH_URL/api/v1/cluster/gateways" \ -H "Authorization: Bearer $TOKEN" ``` The list does not name the machine. The address of a node's gateway account is the `address` field of the account in `/morph/local_state/config/wallet-gateway.json` on that node. ```shell export GATEWAY_ADDRESS=NejLbQpojKJWec4NQRMBhzsrmCyhXfGJJe ``` 2. Take the gateway's endpoints out of your load balancer. 3. Send the decommission request. ```shell curl -i -X DELETE "$MORPH_URL/api/v1/cluster/gateways/$GATEWAY_ADDRESS" \ -H "Authorization: Bearer $TOKEN" ``` The response is `204 No Content`. A `400` means the address is not a registered gateway or is a protected account. 4. Stop the Morph container on the machine. ## Confirm that the data is redundant elsewhere Each storage node reports whether the last full pass of its policer found an object with too few replicas or parts: ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_state_policer_(consistency_state|cycle_count) ' ``` ```text neofs_node_state_policer_consistency_state 1 neofs_node_state_policer_cycle_count 42 ``` The data is fully redundant on the remaining nodes when both of these hold on **every** remaining storage node: - `neofs_node_state_policer_cycle_count` has increased by at least 2 since the node left the network map. The pass that was running at that moment had already checked part of the objects against the old map. - `neofs_node_state_policer_consistency_state` is 1. The metric goes to 0 as soon as a node finds a shortage and returns to 1 only after a complete pass without one. With the default settings a node checks 10 objects per second, and 30 per second while it keeps finding objects to repair, so a pass over a large node takes a long time. The check covers the objects of which a remaining node holds a replica or a part. It does not see an object whose only replica was on the removed node. It is safe to switch the machine off, wipe it or remove its drives when this check has passed. Keep the machine and its drives intact until then: they still hold the replicas and parts that the other nodes are rebuilding. ## Check the result - The node is not in the list of storage nodes, or the gateway key is not in the list of gateways. - Granting the same address again answers `409` with `Cannot grant access for a blocked account.` - Reads and writes on the buckets that used the node succeed. To use the machine again, install it as a new node with an empty `/morph/local_state`. It gets new keys and a new address. See [Add storage nodes](add-storage-nodes.md). ## Related - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Handle a node failure](handle-a-node-failure.md) - [REST API reference](../../reference/rest-api/index.md) --- # Replace a failed drive :::note Morph 0.30.1 has no function of its own for the mode of a shard. The console and the REST API do not offer it, and the Morph image does not contain the tool. The steps that read or change a shard use the command-line tool of the bundled NeoFS storage node directly. ::: This guide replaces a failed or failing data drive of a storage node without losing redundancy. A storage node has one shard per data drive. A shard is the object data on the drive plus an index (the metabase) and an optional write-cache, which normally live on an SSD. When a drive fails, the other nodes rebuild the lost replicas and parts. The node with the failed drive stores what is sent back to it on its other drives. :::warning Step 2 is required. A shard whose drive has failed stays in `read-write` mode, because the automatic switch (`storage.shard_ro_error_threshold`) is off by default and Morph's generated configuration does not set it. In that mode the shard's metabase still lists the lost objects. The node answers that it already has them and does not store the rebuilt replicas and parts. Redundancy is not restored until you change the shard's mode. ::: To see what the cluster does at each stage of a drive failure, open the [architecture explorer](/architecture-explorer?scenario=drive). ## Before you start - The storage node of the affected machine is running and in the network map. - The other storage nodes are healthy. With a second failure in progress, read [Handle a node failure](handle-a-node-failure.md) first. - A replacement drive. - `neofs-cli` of the bundled storage node version (0.58.1). The Morph image does not contain it. Download it from the NeoFS node release and copy it into the Morph container. `/morph/local_state` is a mounted directory, so the binary survives a restart. Set the variables used below on the affected machine: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container export NEOFS_CLI=/morph/local_state/neofs-cli # path of neofs-cli inside the container export SN_CLI_CONFIG=/morph/local_state/config/cli-config-sn.yaml # generated CLI configuration with the node's wallet export METRICS_URL=http://localhost:5100 # metrics collector of this node export EVACUATE_TIMEOUT=12h # longer than moving one drive's objects can take ``` Copy `neofs-cli` into the container and check that it runs: ```shell wget -O neofs-cli https://github.com/nspcc-dev/neofs-node/releases/download/v0.58.1/neofs-cli-linux-amd64 docker cp neofs-cli "$MORPH_CONTAINER":"$NEOFS_CLI" docker exec "$MORPH_CONTAINER" chmod +x "$NEOFS_CLI" docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" --version ``` The storage node's control service listens on `localhost:16513` inside the container and accepts requests signed with the node's own key. The generated file `cli-config-sn.yaml` names that wallet and its password, so every command below runs inside the container with `--endpoint localhost:16513 --config "$SN_CLI_CONFIG"`. ## Steps 1. Find the shard of the failed drive. List the shards as JSON. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards list --json \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` Each entry has `shard_id`, `mode`, `blobstor` (with the data path), `metabase`, `writecache` and `error_count`. The failed drive is the entry whose data path is the drive's mount point inside the container, for example `/data/0`. Its `error_count` is usually above zero. Note the shard ID, the metabase path and the write-cache path. ```shell export SHARD_ID=7a6SbiNJAjSvaCMZ8EsZ4r ``` 2. Take the shard out of service. Choose by the state of the drive. **The drive cannot be read.** Switch the shard to `degraded-read-only`. In this mode the metabase and the write-cache of the shard are out of use and writes go to the other shards, so the node stores the rebuilt replicas and parts on its remaining drives. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards set-mode \ --id "$SHARD_ID" --mode degraded-read-only \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` The command prints `Shard mode update request successfully sent.` If it fails with `can't set storage mode`, the storage node could not reopen the data path of the drive and the shard keeps its previous mode. Go on to step 4 in that case. Redundancy then returns only after the node has started with the new drive. **The drive can still be read** (it reports errors, or you replace it as a precaution). Switch the shard to `read-only` and move its objects away. Evacuation requires the read-only mode. It moves each object to another shard of the same node; an object that fits on no other shard is sent to another node of its bucket. `--no-errors` skips objects that cannot be read; the other nodes rebuild those later. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards set-mode \ --id "$SHARD_ID" --mode read-only \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards evacuate \ --id "$SHARD_ID" --no-errors --timeout "$EVACUATE_TIMEOUT" \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` The command prints the number of moved objects and `Shard has successfully been evacuated.` Then switch the shard to `degraded-read-only` with the command above, so that objects which were skipped are rebuilt. The mode is not written to the configuration. It lasts until the storage node restarts. 3. Wait until redundancy is restored. The policers of the other nodes find the missing replicas and parts and rebuild them; this node stores them on its remaining drives. Check on every storage node that holds data of the same buckets: ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_state_policer_(consistency_state|cycle_count) ' ``` Redundancy is restored when `neofs_node_state_policer_consistency_state` is 1 on each of them and `neofs_node_state_policer_cycle_count` has increased by at least 2 since step 2. With the default settings a node checks 10 objects per second, and 30 per second while it keeps finding objects to repair. You can swap the drive before this point. The next steps stop the whole node, which takes its other drives offline for the time of the swap, so waiting keeps more replicas available. 4. Stop the Morph container. ```shell docker stop --time 60 "$MORPH_CONTAINER" ``` 5. Replace the drive, create a file system on the new one and mount it at the same host path as the old drive. The container then finds it at the same data path, and the storage node configuration needs no change. 6. Remove the metabase and the write-cache of the old shard. Both describe objects of a drive that no longer exists. Use the paths from step 1, translated to the host directories that are mounted into the container. A shard without a write-cache has an empty `writecache` field in step 1; skip the second `rm` for it. ```shell export OLD_METABASE=/mnt/meta/0/metabase.db # host path of the old shard's metabase export OLD_WRITECACHE=/mnt/writecache/0 # host path of the old shard's write-cache rm "$OLD_METABASE" rm -r "$OLD_WRITECACHE" ``` 7. Start the Morph container. ```shell docker start "$MORPH_CONTAINER" docker logs -f "$MORPH_CONTAINER" ``` The storage node finds an empty data path, creates a new shard with a new ID, a new metabase and a new write-cache, and starts. Wait for: ```text ✅ MORPH CONTAINER STARTED ``` Do not start the container between steps 4 and 7 with the failed drive still in place. A shard that cannot be initialized is skipped with the log message `failed to attach shard to engine`, and the storage node starts without it; the node does not start when no shard at all can be attached. A shard that does start comes back in `read-write` mode. ## Check the result 1. The node lists a new shard for the data path, in `read-write` mode and with `error_count` 0. The old shard ID is gone. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards list --json \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` 2. The storage node is healthy and online. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control healthcheck \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` ```text Network status: ONLINE Health status: READY ``` 3. The new shard fills. The node's policer moves the objects that rank for the new drive onto it, so that the drives of the node are used evenly again. The stored bytes of the new shard grow, and the counter of relocated objects increases. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_(engine_payload_size|state_policer_object_count)' ``` 4. `neofs_node_state_policer_consistency_state` returns to 1 on this node and on the other nodes after their next full passes. ## Notes - **Different drive size.** The storage node announces the total capacity of its shards as the node attribute `Capacity`. When the new drive changes that value, the node registers again at start and the license is checked against the new capacity. See [Manage licenses](manage-licenses.md). - **Different mount path.** The installer configuration (`sn.shards`) is read only when a node is installed. Changing it does not change the shards of an installed node. This guide therefore keeps the paths. - **No reload command.** The storage node can add and remove shards when it reloads its configuration, but Morph has no command for a reload. This guide restarts the container. - **Automatic switch.** The storage node supports switching a shard to `degraded-read-only` automatically when its error count reaches `storage.shard_ro_error_threshold`, but Morph leaves that key unset (default `0`, off) and does not support manual edits to the generated storage node configuration. See [Storage node settings](../../reference/configuration/storage-node.md). ## Related - [Configure drives and shards](../deploy/configure-drives.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Command-line tools](../../reference/command-line-tools.md) - [Use maintenance mode](use-maintenance-mode.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) --- # Handle a node failure This guide takes you through the failure of one Morph node: what the cluster does by itself, what you have to check, and how to bring the node back or replace it. For a single failed drive on a running node, see [Replace a failed drive](replace-a-failed-drive.md). For the loss of a whole site, see [Recover from a site failure](recover-from-a-site-failure.md). To see what the cluster does when two nodes fail together, open the [architecture explorer](/architecture-explorer?scenario=rack). ## What the cluster does by itself | | Replicated bucket (`REP n`) | Erasure-coded bucket (`EC d/p`) | |---|---|---| | **Reads** | Served from any remaining replica. | Served from any `d` of the `d + p` parts. A node rebuilds missing data parts from parity parts during the read. | | **Writes** | Succeed while every `REP` rule can still place its full number of replicas. Other candidate nodes of the bucket take the place of the failed one. | Succeed while all `d + p` parts can be stored on distinct nodes. Other candidate nodes of the bucket take the place of the failed one. | | **Repair** | The policers of the other holders find the replica missing and copy the object to the next reachable node of the bucket. | The policers of the other holders find the part missing, rebuild it from any `d` parts and store it on the next reachable node of the bucket. | Repair starts as soon as the policers reach the affected objects. It does not wait for the network map to change. With the default settings a node checks 10 objects per second, and 30 per second while it keeps finding objects to repair. A storage node that sends no heartbeat for more than 3 epochs is removed from the network map. With the default epoch of 3600 seconds this happens 3 to 4 hours after the node stopped. Placement is then computed over the remaining nodes, and the policers move replicas and parts into the new order. The cluster does not do these things: - It does not redirect clients. The console and the S3 gateway of the failed node are down with it. Load balancers are not part of Morph. - It does not replace a failed inner ring node. The number of inner ring nodes is fixed. ## Before you start Set the variables used below. Use a node that is still running. ```shell export MORPH_URL=http://localhost:9100 # console of a running cluster-type node export TOKEN=... # session token of a global administrator export METRICS_URL=http://localhost:5100 # metrics collector of a running node export MORPH_CONTAINER=morphcluster # name of the Morph container on the failed node ``` ## During the outage 1. Take the failed node's S3 and console endpoints out of your load balancer. 2. Find out what the failed node ran. A cluster-type node takes an inner ring member with it; a storage-type node does not. 3. If the failed node is a cluster-type node, check the inner ring quorum. A cluster with 4 inner ring nodes keeps working with 3, a cluster with 7 with 5. On each remaining cluster-type node, the inner ring reports ready and the chain height keeps growing: ```shell curl -s "$METRICS_URL/metrics" | grep -E '^(neofs_ir_state_health|neogo_block_height) ' ``` If the chain has stopped, go to [The inner ring has lost its quorum](#the-inner-ring-has-lost-its-quorum). 4. Check every storage policy against the cluster **without** the failed node. This decides how much time you have. :::warning When the failed node leaves the network map, a storage policy that can no longer select enough nodes makes every operation on its buckets fail, reads included, with `not enough nodes to SELECT from`. This happens although the remaining nodes still hold enough replicas or parts. Examples: `EC 3/1` on a cluster of 4 storage nodes, `REP 3` on a cluster of 3, or a policy that selects a rack or site that now has too few nodes. For such a policy, the node has to be back, or a replacement node has to be in the network map, before the failed node has been silent for 3 epochs. ::: 5. Watch the repair on the remaining storage nodes. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_state_policer_(consistency_state|cycle_count) ' ``` `neofs_node_state_policer_consistency_state` is 0 while a node finds objects with too few replicas or parts, and returns to 1 after a full pass that found none. 6. Check the free space of the remaining nodes. Repair stores the failed node's share of the data on them. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_engine_(payload_size|capacity)' ``` 7. See when the node leaves the network map. Until then the list still contains it. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` Do not start a second disruptive action on another node (an upgrade, a drive swap, a decommission) while the repair is running. ## Bring the node back Choose the case that matches the state of the machine. ### The machine and its state are intact 1. Fix the cause and start the Morph container. ```shell docker start "$MORPH_CONTAINER" docker logs -f "$MORPH_CONTAINER" ``` 2. Wait for `✅ MORPH CONTAINER STARTED`. - If the node was still in the network map, its storage node sends its heartbeat again and serves requests at once. - If the node had been removed from the network map, its storage node registers again and enters the map at the next epoch, up to 3600 seconds later with the default epoch. A storage-type node logs `local SN is not in Netmap` until then and starts its console and S3 gateway only afterwards. 3. Put the node back into your load balancer. The node's drives still hold the data from before the outage. The policers remove the surplus replicas and parts that were created during the outage and move objects back into the order of the full network map. Objects written during the outage are copied to the node where it ranks for them. A node that registers again is checked against the license. The inner ring refuses it when no license is uploaded and the demo period is over, or when the license has no room for the node. See [Manage licenses](manage-licenses.md). ### The machine is lost, its drives and `/morph/local_state` are intact Move the drives and the `/morph/local_state` directory to a new machine and start the Morph container with the same image version, ports and volumes. The node keeps its keys and its address in the cluster. The new machine has to be reachable under the addresses that the node announced when it was installed. Then continue as in the case above. ### A storage-type node is lost with its state Install a new storage-type node. See [Add storage nodes](add-storage-nodes.md). The new node has new keys and is checked against the license like any new node. The lost node leaves the network map by itself after 3 silent epochs; no decommission request is needed, and none is possible once it has left. ### A cluster-type node is lost with its state The inner ring key of the node was in `/morph/local_state`. - With a backup of `/morph/local_state`: restore it on a new machine and start the Morph container. See [Back up and restore](back-up-and-restore.md). The object data of the node is rebuilt by the other nodes; it is not part of a backup. - Without a backup: this inner ring member is gone for good. Morph has no procedure to add or replace an inner ring member. The cluster keeps working while the quorum holds, but it tolerates one failure fewer from now on. A cluster with 4 inner ring nodes that has lost one stops producing blocks at the next inner ring failure. ## The inner ring has lost its quorum Below the quorum the FS chain produces no blocks. Until enough inner ring nodes are back: - No bucket can be created or deleted, and no access rule, user, quota or storage policy can be changed. - Epochs do not advance. No storage node enters or leaves the network map. - Chain data can still be read. Objects in existing buckets use data that is already on the chain: the bucket, its policy and the network map. The only fix is to bring inner ring nodes back until the quorum is reached again: 3 of 4, or 5 of 7. Start their Morph containers, or restore them from a backup. The chain continues by itself when enough of them run. ## Check the result - Every storage node is in the list of `GET /api/v1/cluster/storage-nodes`. - `neofs_node_state_health`, `neofs_s3_gw_state_health` and, on cluster-type nodes, `neofs_ir_state_health` report 2 on every node. - `neofs_node_state_policer_consistency_state` and `neofs_node_state_policer_optimal_placement` are 1 on every storage node. The second gauge covers replicas only; for erasure-coded buckets use the check under [Watch the progress](add-storage-nodes.md#watch-the-progress). - A test object can be written to and read from a bucket of each storage policy. ## Related - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Replication and consistency](../../explanation/replication-and-consistency.md) - [Erasure coding](../../explanation/erasure-coding.md) - [Check cluster health](../observe/check-cluster-health.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) - [Resilience tests](../../reference/resilience-tests/index.md) --- # Use maintenance mode :::note Morph 0.30.1 has no function of its own for maintenance mode. The console and the REST API do not offer it, and the Morph image does not contain the tool. This guide uses the command-line tool of the bundled NeoFS storage node directly. It was run on a node of Morph 0.30.1. ::: This guide puts a storage node into maintenance mode for planned work and brings it back online afterwards. Maintenance mode tells the cluster that the node's data is expected to be back soon. The other nodes then do not rebuild the node's replicas and parts while it is out. Use it for work that is shorter than 3 epochs, such as a reboot, a hardware change or an upgrade. To remove a node for good, see [Decommission a node](decommission-a-node.md). ## What maintenance mode does | Effect | When | |---|---| | The storage node refuses object operations (put, get, head, search, delete) with the status `node is under maintenance`. | At once, and only until the storage node process restarts. The refusal is not stored. | | The network map shows the node in the state `maintenance`. | From the next epoch, up to 3600 seconds later with the default epoch. The inner ring applies the request to the next network map. | | The policers of other nodes count the node's replicas as present and do not rebuild them. They also do not delete their own surplus copies. | While the node answers with the maintenance status, and for the whole time the network map shows the state. | | The policers of other nodes do not rebuild the node's erasure-coded parts. | Only while the node answers with the maintenance status. If the node is powered off, its parts count as missing and are rebuilt. | What it does not do: - It does not keep the node in the network map. A node in maintenance that sends no heartbeat for more than 3 epochs is removed like any other node. A running storage node keeps sending its heartbeat in maintenance mode; a stopped one does not. - It does not move data off the node. - It does not keep refusing requests across a restart. After a restart of the container the storage node serves object operations again, while the network map still shows `maintenance` and the other nodes still do not repair its data. Keep the node out of your load balancer until you have switched it back to online. - It does not redirect clients. The S3 gateway and the console in the same Morph container keep running and use the local storage node, so requests through them fail. This includes logging in to the console of that node, which stores a session in the cluster and answers with an internal error. Take the node out of your load balancer first. - It does not make data available. An object whose only reachable replica is on the node cannot be read during the maintenance. An erasure-coded object needs `d` of its parts on other nodes. - It does not hide the node from readers. A read that reaches the node while walking the holders of an object ends with the status `node is under maintenance` instead of continuing with the next holder. Clients can therefore see errors for objects that have a replica on the node, and for reads of whole erasure-coded objects that have a data part on it. A ranged read of an erasure-coded object skips the node and uses other nodes and parity. Because other nodes treat the node's data as present, redundancy is reduced without repair for the whole maintenance. Do not put more nodes into maintenance at the same time than your storage policies tolerate as failures. ## Before you start - The cluster is healthy and no repair is running. See [Check cluster health](../observe/check-cluster-health.md). - `neofs-cli` of the bundled storage node version (0.58.1) inside the Morph container. The Morph image does not contain it. Set the variables used below on the node you work on: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container export NEOFS_CLI=/morph/local_state/neofs-cli # path of neofs-cli inside the container export SN_CLI_CONFIG=/morph/local_state/config/cli-config-sn.yaml # generated CLI configuration with the node's wallet export METRICS_URL=http://localhost:5100 # metrics collector of this node export SN_API=localhost:8080 # storage node API inside the container; 127.0.0.1:8084 if the node serves TLS ``` Copy `neofs-cli` into the container if it is not there yet: ```shell wget -O neofs-cli https://github.com/nspcc-dev/neofs-node/releases/download/v0.58.1/neofs-cli-linux-amd64 docker cp neofs-cli "$MORPH_CONTAINER":"$NEOFS_CLI" docker exec "$MORPH_CONTAINER" chmod +x "$NEOFS_CLI" ``` ## Enter maintenance mode 1. Take the node's S3 and console endpoints out of your load balancer. 2. Note the current epoch. ```shell curl -s "$METRICS_URL/metrics" | grep '^neofs_node_state_epoch ' ``` 3. Switch the storage node to maintenance. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control set-status --status maintenance \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` ```text Network status update request successfully sent. ``` The node refuses object operations from this moment. 4. If your work stops the storage node or the container, wait for the next epoch first. The epoch metric increases by one, and the network map lists the node with the state `MAINTENANCE`. Print the network map as the storage node sees it: ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" netmap snapshot \ --rpc-endpoint "$SN_API" --config "$SN_CLI_CONFIG" ``` The output starts with the epoch and the version of the network map. Each node follows on a line `Node : `, with its attributes below. Find the node by its endpoint. A node that stops before the network map shows `MAINTENANCE` looks like a failed node to the others, and they start to rebuild its data. 5. Do the work. Finish before the node has been stopped for 3 epochs. ## Leave maintenance mode 1. Start the Morph container if you stopped it, and wait for `✅ MORPH CONTAINER STARTED`. ```shell docker start "$MORPH_CONTAINER" docker logs -f "$MORPH_CONTAINER" ``` 2. Switch the storage node back to online. This step is needed after a restart too. The restarted node already serves requests, but the network map keeps the state `maintenance`, and with it the other nodes keep skipping repair, until the node asks for another state. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control set-status --status online \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` The node serves object operations again at once. The network map shows `online` from the next epoch; until then `control healthcheck` still prints `Network status: MAINTENANCE`. A new request for maintenance in that time is accepted but has no effect on the node. Wait for the epoch before you enter maintenance again. 3. Put the node back into your load balancer. ## Check the result After the next epoch the network map lists the node with the state `ONLINE`, and the health check reports the same: ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" netmap snapshot \ --rpc-endpoint "$SN_API" --config "$SN_CLI_CONFIG" docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control healthcheck \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` ```text Network status: ONLINE Health status: READY ``` The policers then check the node's objects again. Objects written while the node was out are copied to it where it ranks for them. Wait until `neofs_node_state_policer_consistency_state` is 1 on every storage node before you start maintenance on the next node. ```shell curl -s "$METRICS_URL/metrics" | grep '^neofs_node_state_policer_consistency_state ' ``` ## If the node was out for more than 3 epochs The node has been removed from the network map, and the other nodes have rebuilt its data. Start the container. The storage node registers again with the state `online` and enters the network map at the next epoch. Continue as described in [Handle a node failure](handle-a-node-failure.md). ## Related - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Upgrade a cluster](upgrade.md) - [Command-line tools](../../reference/command-line-tools.md) - [Errors and status codes](../../reference/errors.md) --- # Recover from a site failure This guide takes you through the loss of a whole site in a cluster that spans several sites: what stays available, what you have to decide in the first hours, and what to do when the site returns. A Morph deployment is one cluster. There is no second cluster to fail over to and no replication between clusters. Which sites hold the data of a bucket is decided by the bucket's storage policy, so the effect of a site failure differs from bucket to bucket. To see a site failure and return step by step, open the [architecture explorer](/architecture-explorer?scenario=site). ## What stays available ### The FS chain The inner ring needs its quorum outside the lost site: 3 of 4 inner ring nodes, or 5 of 7. With the quorum, the chain keeps producing blocks and epochs keep advancing. Without it, no bucket, access rule or user can be changed and the network map is frozen until enough inner ring nodes are back. See [Handle a node failure](handle-a-node-failure.md) for the state without a quorum. ### Buckets, by storage policy | The storage policy | Reads | Writes | |---|---|---| | keeps all replicas or parts in the lost site | Unavailable until the site returns. | Unavailable until the site returns. | | keeps full replicas in several sites, at least one outside the lost site | Served from the remaining replicas. | Succeed only if every `REP` rule can still place its full number of replicas on reachable candidate nodes. Otherwise the write fails with `incomplete object PUT by placement`, although the reachable nodes stored their replicas. | | the same, and the bucket has an initial placement policy | Served from the remaining replicas. | Acknowledged once the number of replicas allowed by the initial placement policy is stored. The missing replicas follow when the site returns or when other nodes are selected. | | spreads erasure-coded parts over sites, with at least `d` parts outside the lost site | Served from the remaining parts. | Succeed only if all `d + p` parts can be stored on distinct reachable candidate nodes. | | spreads erasure-coded parts over sites, with fewer than `d` parts outside the lost site | Unavailable until the site returns. | Unavailable until the site returns. | Objects that were acknowledged under an initial placement policy shortly before the failure may exist in the lost site only. They cannot be read until the site returns. ### After 3 epochs A storage node that sends no heartbeat for more than 3 epochs is removed from the network map. With the default epoch of 3600 seconds, the nodes of the lost site leave the map 3 to 4 hours after the failure. Every storage policy is then applied to the map without them. - **A policy that leaves the choice of sites to the network** selects nodes in the remaining sites. The policers copy the objects to the new nodes, and the bucket is back to its full redundancy without operator action. This needs free space in the remaining sites and traffic between them. - **A policy that names the lost site**, or that needs more distinct sites than remain, can no longer be satisfied. Every operation on its buckets then fails, reads included, with `not enough nodes to SELECT from`. The replicas in the remaining sites still exist, but they cannot be read until the policy can be satisfied again. :::warning The second case turns a bucket that was readable during the first hours of the outage into an unavailable one. The only way out is to get enough nodes of the lost site back into the network map. Plan storage policies with this in mind. See [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md) and [Deploy across sites](../deploy/deploy-across-sites.md). ::: ## Before you start Set the variables used below. Use a node in a site that is still running. ```shell export MORPH_URL=http://localhost:9100 # console of a running cluster-type node export TOKEN=... # session token of a global administrator export METRICS_URL=http://localhost:5100 # metrics collector of a running node export MORPH_CONTAINER=morphcluster # name of the Morph container on a node of the lost site ``` ## During the outage 1. Send clients to the endpoints of the remaining sites. Load balancers and DNS are not part of Morph. Every Morph node serves S3 on port 9080 and the console on port 9100. 2. Check the inner ring quorum. On the remaining cluster-type nodes the inner ring reports ready, and the chain height and the epoch keep growing. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^(neofs_ir_state_health|neofs_ir_state_epoch|neogo_block_height) ' ``` If the chain has stopped, bringing inner ring nodes back has priority over everything else. 3. Note the epoch in which the site failed. The nodes of the site leave the network map when they have been silent for more than 3 epochs. 4. Sort your buckets by storage policy, using the table above. For each policy decide whether it can still be satisfied once the nodes of the lost site are gone from the network map. 5. For policies that cannot be satisfied without the lost site, work on getting nodes of that site back before the 3 epochs have passed. A node that sends its heartbeat again stays in the network map. 6. For policies that select other sites after the 3 epochs, check the free space of the remaining nodes and watch the repair. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^neofs_node_(engine_payload_size|engine_capacity|state_policer_consistency_state)' ``` 7. Follow the network map. The nodes of the lost site disappear from the list when they are removed. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` Do not decommission the nodes of the lost site unless the site is lost for good. Decommissioning blocks their accounts permanently. ## When the site returns 1. Start the Morph containers of the site. If the chain had stopped, start the cluster-type nodes first and wait until the chain height grows again. ```shell docker start "$MORPH_CONTAINER" docker logs -f "$MORPH_CONTAINER" ``` 2. Wait for `✅ MORPH CONTAINER STARTED` on every node. Storage nodes that had been removed from the network map register again and enter the map at the next epoch. A storage-type node starts its console and S3 gateway only after that. A node that registers again is checked against the license. The inner ring refuses it when no license is uploaded and the demo period is over, or when the license has no room for the node. See [Manage licenses](manage-licenses.md). 3. Check that all nodes are in the network map again. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` 4. Let the policers finish. Storage policies select the original nodes again. The nodes of the remaining sites send the returned nodes what they missed, objects that existed only in the returned site get their missing replicas, and the copies that were made in other sites during the outage are removed as surplus. 5. Put the endpoints of the site back into your load balancers. ## If the site does not return - Objects whose replicas or parts were all in the site, or of which fewer than `d` parts remain, are lost. - Buckets whose policy names the site stay unavailable. The console API has no operation that changes the storage policy of an existing bucket. - The inner ring members of the site are missing for good unless you restore them from a backup on new machines. See [Back up and restore](back-up-and-restore.md). Morph has no procedure to add or replace an inner ring member. - Storage nodes for the remaining sites can be added as new nodes. See [Add storage nodes](add-storage-nodes.md). ## Check the result - Every storage node is in the list of `GET /api/v1/cluster/storage-nodes`. - `neofs_ir_state_health` is 2 on every cluster-type node and `neogo_block_height` grows. - `neofs_node_state_policer_consistency_state` and `neofs_node_state_policer_optimal_placement` are 1 on every storage node. The second gauge covers replicas only; for erasure-coded buckets use the check under [Watch the progress](add-storage-nodes.md#watch-the-progress). - A test object can be written to and read from a bucket of each storage policy, through an endpoint in each site. ## Related - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Replication and consistency](../../explanation/replication-and-consistency.md) - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Design trade-offs and limitations](../../explanation/design-trade-offs.md) - [Storage policy language](../../reference/storage-policy-language.md) --- # Back up and restore This guide backs up the state that identifies a Morph node and restores a single node from it. Morph has no backup command and no backup API. A backup is a copy of a directory, taken while the Morph container is stopped. ## What a node holds All state that Morph generates is under `/morph/local_state` in the container. The object data is under the paths of the installer configuration. | State | Path in the container | On which nodes | Back it up | |---|---|---|---| | Installation marker with the installation type | `/morph/local_state/config/installation.txt` | all | yes | | Inner ring wallets | `/morph/local_state/config/wallet-ir.json`, `az.json` | cluster-type | yes | | Storage node wallet | `/morph/local_state/config/wallet-sn.json` | cluster-type, storage-type | yes | | Gateway wallet, used by the console and the S3 gateway | `/morph/local_state/config/wallet-gateway.json` | all | yes | | Generated configuration of the inner ring, the storage node, the console and the S3 gateway | `/morph/local_state/config/config-ir.yaml`, `config-sn.yaml`, `config.yaml`, `config-s3.yaml` | by installation type | yes | | Generated CLI configuration | `/morph/local_state/config/cli-config-ir.yaml`, `cli-config-sn.yaml` | by installation type | yes | | Database of the FS chain | `/morph/local_state/fschain.bolt` | cluster-type | yes | | State file of the inner ring process | `/morph/local_state/neofs-ir-state` | cluster-type | yes | | State file of the storage node | `/morph/local_state/neofs-storage-state` | cluster-type, storage-type | yes | | Installer configuration | `/morph/config/installer.config.yaml` | all | yes, with your `docker run` command | | Object data of each shard | `sn.shards[].data`, by default `/data/` | cluster-type, storage-type | no | | Metabase of each shard | `sn.shards[].metadata`, by default `/data/meta//metabase.db` | cluster-type, storage-type | no | | Write-cache of each shard | `sn.shards[].writecache.path` | cluster-type, storage-type | no | | Database of the storage node's metadata service | `sn.metadata`, `/data/meta` in the shipped installer configuration | cluster-type, storage-type | not covered by this guide | The paths under `/morph/local_state` are the defaults of the image. They can be changed with the `MORPH_PATH_*` and `MORPH_LOCAL_STATE_DIR` environment variables. See [Environment variables](../../reference/configuration/environment-variables.md). The wallets are the identity of the node. A storage node that loses `wallet-sn.json` is a different node to the cluster. A cluster-type node that loses `wallet-ir.json` has lost its seat in the inner ring, and Morph has no procedure to give that seat to another key. :::warning A backup of `/morph/local_state` contains private keys and, in the configuration files, the passwords that decrypt them. Store it like a secret. ::: ## What a backup cannot restore - **Object data.** Morph does not back up objects. Their durability comes from the replicas and erasure-coded parts on other nodes, as set by each bucket's storage policy. When a node loses its drives, the other nodes rebuild what it held. An object whose replicas or parts were all on lost drives is lost. To keep a copy of objects outside the cluster, copy them with an S3 client. - **Chain history after the backup.** The FS chain records buckets, access rules, users, storage policies, the license and the network map. A restored `fschain.bolt` contains what was recorded up to the moment of the backup. - **A node that is still running.** A restored node uses the keys of the original. Never run both. ## Before you start - `/morph/local_state` is a host directory mounted into the container. See [Install a cluster](../deploy/install-a-cluster.md). - For cluster-type nodes: the inner ring quorum holds without the node you stop. Back up one cluster-type node at a time. Set the variables used below on the node: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container export STATE_DIR=/mnt/local_state # host directory mounted at /morph/local_state export BACKUP_FILE=/backup/node-1-local_state.tar.gz # where the backup is written export METRICS_URL=http://localhost:5100 # metrics collector of this node ``` ## Back up a node 1. Stop the Morph container, so that the databases are closed. ```shell docker stop --time 60 "$MORPH_CONTAINER" ``` 2. Copy the state directory. ```shell tar -czf "$BACKUP_FILE" -C "$STATE_DIR" . ``` 3. Start the container again and wait for `✅ MORPH CONTAINER STARTED`. ```shell docker start "$MORPH_CONTAINER" docker logs -f "$MORPH_CONTAINER" ``` 4. Store the backup file, the installer configuration file and the `docker run` command of the node away from the node. Take a new backup after anything that changes the files in `/morph/local_state/config`: the installation, an [upgrade](upgrade.md) that migrates configuration files, and a [chain hardfork](../../explanation/inner-ring-and-fs-chain.md#hardforks), which changes `config-ir.yaml`. Morph does not change the wallets after the installation. A backup taken once after the installation is enough to keep the identity of the node. Later backups add a newer chain database and newer configuration files. ## Restore a single node Use this when a node has lost `/morph/local_state`, with or without its data drives. The rest of the cluster is running. 1. Make sure the original node is not running and will not start again with the old state. 2. Prepare the machine as for a new node, with the same host name or IP address as the original. The generated configuration contains the addresses that the node announces and, on cluster-type nodes, the addresses of the other inner ring nodes. 3. Restore the state directory. ```shell mkdir -p "$STATE_DIR" tar -xzf "$BACKUP_FILE" -C "$STATE_DIR" ``` 4. Mount the data drives at the same paths as before. If the drives were lost, mount empty drives at these paths, and make sure that the metadata and write-cache paths are empty too. A metabase or write-cache that describes a lost drive must not be reused. 5. Start the Morph container with the same image version, ports, volumes and environment variables as the original. The installation marker is part of the backup, so the installer does not run. ```shell docker run -d --restart unless-stopped --name "$MORPH_CONTAINER" \ -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 5100:5100 -p 9080:9080 \ -p 20334:20334 -p 21334:21334 \ -v "$STATE_DIR":/morph/local_state \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/sdb:/data/sdb -v /mnt/sdc:/data/sdc -v /mnt/meta:/data/meta \ morphbits/morph:0.30.1 ``` 6. Wait for `✅ MORPH CONTAINER STARTED`. ```shell docker logs -f "$MORPH_CONTAINER" ``` If the storage node had been removed from the network map, it registers again and enters the map at the next epoch. A node that registers again is checked against the license. See [Manage licenses](manage-licenses.md). After the start, the other nodes send the restored node the objects it should hold. No object data comes from the backup. ## Check the result ```shell curl -s "$METRICS_URL/metrics" | grep -E '^(neofs_(ir|node|s3_gw)_state_health|neogo_block_height) ' ``` - The health metrics of the node's processes report 2. - On a cluster-type node, `neogo_block_height` reaches the value of the other inner ring nodes and grows with them. - The node is in the list of `GET /api/v1/cluster/storage-nodes`. - `neofs_node_state_policer_consistency_state` returns to 1 on every storage node once the node's objects are rebuilt. ## Total loss of the inner ring If every cluster-type node loses `/morph/local_state` and no backup exists, the FS chain is gone. With it go the records of all buckets, their storage policies and access rules, the users, the registered gateway keys and the network map. The storage nodes still hold object data on their drives, but Morph has no procedure to rebuild the chain from it. The data cannot be served again. If backups exist, restore the cluster-type nodes as described above until the quorum is reached: 3 of 4, or 5 of 7. The chain then contains what was recorded up to the newest restored backup. Buckets, users and access rules created after that backup are missing. Objects in buckets that are missing cannot be reached, and a storage node removes the objects of a bucket that the chain does not know. This is the reason to keep at least the installation-time backup of every cluster-type node, in a place that does not share a failure with the cluster. ## Related - [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Handle a node failure](handle-a-node-failure.md) - [Installer configuration](../../reference/configuration/installer.md) - [Harden a deployment](../secure/harden-a-deployment.md) --- # Manage licenses This guide uploads a license to a cluster and shows how to read its limits. A license sets how many storage nodes a cluster may have and how much capacity they may announce, for a period of time. It is stored on the FS chain, so it is uploaded once and applies to the whole cluster. The inner ring checks it whenever a storage node registers for the network map. ## How the license is applied **Without a license** the cluster runs in demo mode. Storage nodes can join while the epoch number of the cluster is 168 or lower. With the default epoch of 3600 seconds that is about 7 days after the installation. After that, the demo period has expired. **The license is checked** in two places: - When an administrator grants a new storage node (`POST /api/v1/cluster/storage-nodes`). A refused grant answers `400` with `Failed to add node.` - When a storage node registers on the FS chain. The inner ring of each cluster-type node asks the license check before it approves the node. A refused node is not added to the network map, and the inner ring logs `could not verify and update information about network map candidate` with the reason. A storage node registers when it is new, when it starts and is not in the network map, and when it starts with attributes or addresses that differ from the network map. A node that is in the network map and only sends its heartbeat is not checked again. Granting a gateway is not subject to the license. **The reasons for a refusal** are: | Reason in the log | Meaning | |---|---| | `demo period expired` | No license is uploaded and the epoch number is above 168. | | `node limit reached` | The network map already contains as many storage nodes as the license allows. | | `capacity limit exceeded` | The capacity of the new node does not fit into the remaining licensed capacity. | | `node is already present, but cannot increase capacity` | A node of the network map registers with a larger capacity that does not fit into the remaining licensed capacity. | | `license stored in contract is invalid` | The license on the FS chain cannot be used by this cluster. | The capacity of a node is its node attribute `Capacity`, which the storage node sets by itself from the size of its shards. The license check adds up this attribute over all nodes of the network map. A node limit of 0 or a capacity of 0 in the license means no limit. Consequences for operations: - After the demo period, a cluster without a license cannot add storage nodes, and a storage node that has dropped out of the network map cannot return. Upload a license before the demo period ends. - Adding a drive or replacing a drive with a larger one changes the node's capacity. The node registers again at its next start and needs room in the licensed capacity. ## Before you start - The session token of a global administrator. - A license file for this cluster. A license is bound to the public keys of the cluster's inner ring nodes and is rejected by any other cluster. The file is at most 50 KiB. Set the variables used below: ```shell export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator export LICENSE_FILE=./morph.license # the license file ``` ## Get the keys for a license request The issuer of the license needs the public keys of the inner ring nodes. Read them from the cluster: ```shell curl -s "$MORPH_URL/api/v1/cluster/ir-keys" \ -H "Authorization: Bearer $TOKEN" ``` The answer is a list of keys, one per inner ring node: ```json ["02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2"] ``` ## Upload a license 1. Send the license file as the request body. ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/license" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary @"$LICENSE_FILE" ``` The response is `204 No Content`. The console has checked the license against the inner ring keys of the cluster and stored it on the FS chain. 2. Read the license back. ```shell curl -s "$MORPH_URL/api/v1/cluster/license" \ -H "Authorization: Bearer $TOKEN" ``` ```json { "nodeLimit": 10, "capacity": 4096, "validFrom": "2026-11-17T00:00:00Z", "validUntil": "2027-11-17T00:00:00Z" } ``` `capacity` is in GB. Without a license the request answers `404` with `License not found.` To replace a license, upload the new file in the same way. The new license takes the place of the old one. The API has no operation that removes a license. The license checks of the inner ring nodes read the license from the chain at most once per minute, so a new license is in effect on every node about a minute after the upload. ## Errors on upload | Status | Message | Cause | |---|---|---| | `400` | `Empty license.` | The request has no body. | | `400` | `Failed to upload license: invalid license: ...` | The file is not a license, is damaged, or does not match the inner ring keys of this cluster. | | `400` | `Failed to upload license: license is issued for a different cluster.` | The license belongs to another cluster. | | `413` | `License too large.` | The file is larger than 50 KiB. | | `401` | `Token is missing or invalid.` | No valid session token. | | `403` | `Insufficient rights.` | The user is not a global administrator. | ## Check the result - `GET /api/v1/cluster/license` returns the limits and dates of the new license. - A new storage node can be granted and enters the network map. See [Add storage nodes](add-storage-nodes.md). Replace the license before the date in `validUntil`. ## Related - [Add storage nodes](add-storage-nodes.md) - [Manage users and roles](../secure/manage-users-and-roles.md) - [REST API reference](../../reference/rest-api/index.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) --- # Run a benchmark This guide measures PUT and GET throughput and latency through the S3 API with [Warp](https://github.com/minio/warp). ## Before you start - A running cluster and a separate host for the load tool. The load host needs at least as much network capacity as the cluster can serve. - S3 credentials for a user. See [Manage S3 credentials](../secure/manage-s3-credentials.md). - Warp installed on the load host. - Shell access to every storage host, to clear the page cache between the write and the read phase. Set the values used below: ```shell export S3_HOSTS="node1:9080,node2:9080,node3:9080,node4:9080" export AWS_ACCESS_KEY_ID="..." export AWS_SECRET_ACCESS_KEY="..." export BUCKET="bench" ``` ## Steps 1. **Create the bucket with the storage policy you want to measure.** The policy and its placement factor decide how many nodes take the load, so create the bucket yourself. See [Create a bucket](../buckets-and-objects/create-a-bucket.md) and [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). 2. **Write down the configuration.** Record every item of the table under [What to record](#what-to-record) before the first run. 3. **Run the PUT tests.** One run per object size and thread count, 6 minutes each. Keep the objects for the read phase with `--noclear`. ```shell warp put --host="$S3_HOSTS" --access-key="$AWS_ACCESS_KEY_ID" --secret-key="$AWS_SECRET_ACCESS_KEY" \ --bucket="$BUCKET" --obj.size=4MiB --concurrent=32 --duration=6m --noclear \ --benchdata=put-4MiB-32 ``` Repeat for each object size and concurrency level you want to test. 4. **Clear the page cache on every storage host**, so that the reads come from the drives: ```shell sync && echo 3 | sudo tee /proc/sys/vm/drop_caches ``` 5. **Run the GET tests.** One run per object size and thread count, 2 minutes each. ```shell warp get --host="$S3_HOSTS" --access-key="$AWS_ACCESS_KEY_ID" --secret-key="$AWS_SECRET_ACCESS_KEY" \ --bucket="$BUCKET" --obj.size=4MiB --concurrent=32 --duration=2m \ --benchdata=get-4MiB-32 ``` 6. **Read the results.** ```shell warp analyze put-4MiB-32.csv.zst ``` Take the average throughput and the 90th percentile of the request duration from each run. 7. **Repeat each run** at least three times and report the spread. A single run on shared or cloud hardware is not a result. Check the options against `warp put --help` for the Warp version you use; record that version. ## Check the result - Every run ends without request errors in the Warp summary. - During the runs, the storage nodes report no shortage of redundancy. See [Check cluster health](../observe/check-cluster-health.md). - The numbers of repeated runs agree within a few percent. If they do not, find the source of the variation before comparing anything. ## What to record | Item | Example of what to write down | |---|---| | Morph release | from [Component versions](../../releases/component-versions.md) | | Hosts | model, CPU, memory, drives with type and size, network speed | | Number of nodes and their types | 4 cluster-type nodes | | Drive configuration | shards per node, where metabases and write-caches are, write-cache size, combined writing | | Storage policy of the bucket | policy text or JSON, placement factor | | Changed settings | every storage node or gateway setting that differs from the defaults | | Operating system, kernel, filesystem, mount options | | | Warp version and the full command line of every run | | | Object sizes, thread counts, durations | | | Number of runs and the spread | | Keep the table together with the numbers. Without it a reader cannot repeat the test and has no reason to trust it. ## Related - [Performance](../../explanation/performance.md) --- # Create a bucket This guide creates a bucket with the REST API, then lists, reads and deletes buckets. A bucket holds objects and carries the settings that apply to all of them: the storage policy, the basic ACL, an optional extended ACL and an optional deletion lock. Several of these settings are fixed when the bucket is created. Read [What you cannot change later](#what-you-cannot-change-later) before you create buckets for production data. ## Before you start - A running Morph node and a user account. See [Quickstart: a single node](../../tutorials/quickstart-single-node.md). - `curl` and `jq`. - A token that allows `createBucket` and `getUserPolicy`. A token from `/api/v1/login` allows both. For a narrower token see [Manage API tokens](../secure/manage-api-tokens.md). Set the variables used on this page. `MORPH_PASSWORD` is the password of the user. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. Choose a name A bucket name has 1 to 63 characters. It contains lowercase letters, digits and hyphens, and it starts and ends with a letter or a digit. The pattern is `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. A name is unique within a [namespace](use-namespaces.md). Two namespaces can each have a bucket called `my-bucket`. ### 2. Choose a storage policy A bucket refers to a storage policy by name in `placementPolicyName`. The name is resolved first among your own policies, then among the system policies. A new cluster has the system policies `REP-1` and `REP-3`. List the policies you can use: ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-policies" \ -H "Authorization: Bearer $TOKEN" | jq '.policies[] | {name, default}' curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/storage-policies" \ -H "Authorization: Bearer $TOKEN" | jq '.policies[].name' ``` The request does not take an inline policy. To use a policy of your own, save it under a name first. See [Choose a storage policy](choose-a-storage-policy.md). Morph copies the policy into the bucket when it creates the bucket. Editing or deleting the named policy later does not change existing buckets. The named policy also carries the metadata consistency setting (`strict`, `optimistic` or none). The bucket takes it from the policy; the bucket request has no field for it. ### 3. Decide the basic ACL The basic ACL says which object operations the owner and everyone else may perform. It has two groups, `owner` and `others`, each with five flags: | Flag | Allows | |---|---| | `get` | Download an object. | | `head` | Read the headers of an object with a `HEAD` request. A `GET` response includes the headers regardless of this flag. | | `put` | Upload objects. | | `delete` | Delete objects. | | `search` | List and search objects. Also needed to address an object by its path instead of its object ID in `GET`, `HEAD` and `DELETE` requests. | Two more flags apply to the bucket as a whole: | Flag | Effect | |---|---| | `final` | Disables the extended ACL and access tokens for this bucket. Optional, default `false`. | | `disableAccessTokens` | Stops access tokens from extending the permissions of this bucket. The extended ACL stays available. Always `true` in the response when `final` is `true`. Optional, default `false`. | The specification marks `final` and `delete` as required. The console accepts a request without them. A flag that you leave out is `false`. `others` covers every caller that is not the owner. This includes administrators and requests without a token. To make objects readable without authentication, set `others.get` and `others.head` to `true`. The specification also lists `readContent`, `readHeaders`, `create` and `sticky`. They are deprecated. Use the flags above. ### 4. Create the bucket Send `POST /api/v1/buckets`. This example creates a bucket that only its owner can use. The extended ACL can still be set later because `final` is `false`. ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-3", "basicACL": { "final": false, "disableAccessTokens": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": false, "head": false, "put": false, "delete": false, "search": false } } }' ``` The response has status `201` and a `Location` header with the path of the new bucket: `/api/v1/buckets/my-bucket`. `REP-3` needs at least three storage nodes in the network map. On a single-node cluster use `REP-1`. The request accepts two optional fields: | Field | Meaning | |---|---| | `lockUntil` | RFC 3339 date until which the bucket cannot be deleted. It must be in the future. See [Lock objects against deletion](lock-objects.md). `lockHours` is a deprecated alternative and cannot be combined with `lockUntil`. | | `eACL` | The initial extended ACL table. Allowed only when `final` is `false`. The token must also allow `setBucketEACL`. See [Control access to a bucket](control-access.md). | Unknown fields in the JSON body are rejected with status `400`. If the request fails, the status tells you why: | Status | Meaning | |---|---| | `400` | The JSON is malformed, the name is invalid, the basic ACL is inconsistent, `eACL` is sent with a final basic ACL, or `lockUntil` is in the past. | | `403` | The token does not allow creating buckets or reading storage policies. | | `404` | No storage policy with this name exists for you or for the cluster. | | `409` | A bucket with this name exists in your namespace, or the storage policy cannot be satisfied by the nodes in the current network map (`Inapplicable policy.`). | ### 5. List your buckets `GET /api/v1/buckets` returns the bucket names of one user in alphabetical order. The `user` query parameter is required. ```shell curl -s "$MORPH_URL/api/v1/buckets?user=$MORPH_USER&maxItems=50" \ -H "Authorization: Bearer $TOKEN" ``` The response is a JSON object with `buckets` (the names), `totalCount`, `usedSpace` and, when more names follow, `cursor`. | Query parameter | Meaning | |---|---| | `user` | The owner whose buckets are listed. Other users' buckets are visible to administrators only. | | `prefix` | Return only names that start with this string. | | `maxItems` | Page size. Default 100, maximum 100. A larger value is rejected with status `400`. | | `cursor` | The `cursor` value of the previous response. The field is absent on the last page. | `totalCount` counts all buckets of the user and ignores `prefix` and paging. `usedSpace` is the space used by the user in bytes. ### 6. Read a bucket ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" | jq ``` The response contains `name`, `owner`, `creationDate`, `basicACL`, `eACL`, `placementPolicy` (the full policy, not its name), `metadataConsistency`, `usedSpace`, `numberOfObjects` and, for a locked bucket, `lockUntil`. Only the owner and administrators can read it. ### 7. Delete a bucket ```shell curl -i -X DELETE "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` The response has status `204`. The owner deletes the bucket. In 0.30.1, the same request from an administrator who does not own the bucket fails with status `500` after 5 seconds, and the bucket stays. The token must allow `deleteBucket`. A bucket with a lock that has not passed returns status `409` and stays. :::danger Deleting a bucket deletes its objects. Morph does not require the bucket to be empty. The storage nodes mark all objects of the removed bucket for garbage collection. ::: ## Check the result Read the bucket before you delete it in step 7, and compare the settings with your request. After the deletion the request returns status `404`. ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" \ | jq '{name, owner, basicACL, placementPolicy, lockUntil}' ``` `placementPolicy.replicas[0].count` is `3` for `REP-3`. ## What you cannot change later The REST API has no operation that changes these settings of an existing bucket: | Setting | To get a different value | |---|---| | Name | Create a new bucket and copy the objects. | | Storage policy | Create a new bucket with the other policy and copy the objects. | | Metadata consistency | Same as the storage policy. | | Basic ACL, including `final` and `disableAccessTokens` | Create a new bucket. Use the extended ACL for rules that must change over time. | These can change: | Setting | How | |---|---| | Extended ACL | `PUT /api/v1/buckets/{bucket}/eacl`, owner only. See [Control access to a bucket](control-access.md). | | Deletion lock | `PUT /api/v1/buckets/{bucket}/timelock`, owner only. The date can only move later. See [Lock objects against deletion](lock-objects.md). | | Bucket quota | `PUT /api/v1/buckets/{bucket}/quota`, administrators only. See [Set storage quotas](set-quotas.md). | | Owner | A transfer that the new owner accepts. See [Transfer a bucket to another user](transfer-a-bucket.md). | ## In the web console **Buckets** > **New bucket** opens the same form: **Bucket name**, **Owner Permissions**, **Other Account Permissions**, **Additional Permissions** (**Final (disable EACL)**, **Disable access tokens**), **EACL Rules**, **Advanced settings** (**Deletion protection until**) and the storage policy. **Delete bucket** is in the menu of each bucket. ## Related - [REST API reference](../../reference/rest-api/index.md) - [Storage policy language](../../reference/storage-policy-language.md) - [Limits](../../reference/limits.md) - [Data model](../../explanation/data-model.md) --- # Choose a storage policy This guide helps you pick a storage policy for a goal, save it under a name and create a bucket with it. A bucket takes its storage policy when it is created and keeps it for life. Choose before you store data. ## Before you start - A running cluster and a user account. - `curl` and `jq`. - To save a policy for yourself: your own token. To save a system policy for all users: a token of a global administrator. - For policies that name sites or racks: the storage nodes must announce matching attributes. The operator sets them at installation. See [Deploy across sites](../deploy/deploy-across-sites.md). ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. See what exists List the system policies. A new cluster has `REP-1` (one replica) and `REP-3` (three replicas), both with placement factor 3 and without site rules. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-policies" \ -H "Authorization: Bearer $TOKEN" | jq '.policies[] | {name, default, policy}' ``` If one of them fits, skip to step 5. ### 2. Look at the nodes A policy can only select by attributes that the nodes announce. A global administrator can list the nodes of the current network map with their attributes: ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq '.nodes[] | {address, attributes}' ``` Count the nodes, and the nodes per site, before you write numbers into a policy. A policy that asks for more nodes than exist cannot be used. The examples below assume that the operator has given every node an attribute `site` with the value `a` or `b`. Replace the name and the values with your own. ### 3. Write the policy for your goal Each goal is shown as policy text and as the JSON `policy` object for the API. The [storage policy language](../../reference/storage-policy-language.md) reference explains every field and the selection algorithm. #### n replicas ```text REP 3 ``` ```json { "replicas": [{ "count": 3, "selector": "" }], "placementFactor": 3, "selectors": [], "filters": [] } ``` - Guarantees: every object is stored as 3 full replicas on 3 different nodes. An upload is acknowledged when all 3 are stored. - Does not guarantee: where those nodes are. All 3 can be in one rack or one site. - Needs: at least 3 nodes in the network map. At most 8 replicas per rule. #### Erasure coding d + p ```text EC 4/2 ``` ```json { "replicas": [], "ecRules": [{ "dataParts": 4, "parityParts": 2 }], "placementFactor": 3, "selectors": [], "filters": [] } ``` - Guarantees: every object piece is stored as 4 data parts and 2 parity parts on 6 different nodes. Any 4 parts are enough to read it, so the data survives the loss of any 2 of the 6 nodes. An upload is acknowledged when all 6 parts are stored. - Does not guarantee: where those nodes are, unless you add a selector. - Needs: at least `d + p` nodes in the network map. With fewer, the bucket cannot be created. `(d + p) × placement factor` is at most 64. - A policy has either `replicas` or `ecRules`, not both. See [Erasure coding](../../explanation/erasure-coding.md) for the trade-off against replication. #### Keep data inside one site ```text REP 3 IN X SELECT 3 FROM F AS X FILTER site EQ a AS F ``` ```json { "replicas": [{ "count": 3, "selector": "X" }], "placementFactor": 3, "selectors": [ { "name": "X", "count": 3, "clause": "DISTINCT", "attribute": "", "filter": "F" } ], "filters": [ { "name": "F", "key": "site", "op": "EQ", "value": "a", "filters": [] } ] } ``` - Guarantees: every replica is on a node whose `site` attribute is `a`. No node of another site stores data of the bucket. - Does not guarantee: availability when the site is gone. See the warning in step 4. - Needs: at least 3 nodes with `site:a` in the network map. For erasure coding inside one site, replace the rule with `EC 4/2 IN X` and the selector count with 6. #### Spread replicas over sites One rule per site is the form that holds for every object: ```text REP 1 IN A REP 1 IN B CBF 2 SELECT 1 FROM FA AS A SELECT 1 FROM FB AS B FILTER site EQ a AS FA FILTER site EQ b AS FB ``` ```json { "replicas": [ { "count": 1, "selector": "A" }, { "count": 1, "selector": "B" } ], "placementFactor": 2, "selectors": [ { "name": "A", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FA" }, { "name": "B", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FB" } ], "filters": [ { "name": "FA", "key": "site", "op": "EQ", "value": "a", "filters": [] }, { "name": "FB", "key": "site", "op": "EQ", "value": "b", "filters": [] } ] } ``` - Guarantees: every object has one replica in site `a` and one in site `b`. Each site has a second candidate node as a reserve. Use `REP 2 IN A` and `SELECT 2` for two replicas per site. - Does not guarantee: uploads while one site is out. An upload needs every rule fulfilled, so it needs a node in each site, unless you add initial placement (next goal). - Needs: nodes of both sites in the network map at all times. See the warning in step 4. The shorter form `REP 2 IN X SELECT 2 IN DISTINCT site FROM * AS X` gives one replica per site only with `CBF 1`. With a larger placement factor the two replicas of some objects land in the same site. This is the rule about distinct failure domains: | You want | Write | |---|---| | Distinct domains for every object, no reserve nodes | One rule, `SELECT n IN DISTINCT attr`, `CBF 1`. | | Distinct domains for every object, with reserve nodes | One `REP` rule and one filter per domain, any placement factor. | | Spread over domains on average, not for every object | One rule, `SELECT n IN DISTINCT attr`, placement factor above 1. | #### Acknowledge early with initial placement Initial placement lets an upload return before the full policy is fulfilled. The storage nodes deliver the rest in the background. It exists only in the JSON form. This example extends the two-site policy. An upload returns as soon as one replica is stored. The rule whose candidate nodes include the node that received the request is tried first: ```json { "replicas": [ { "count": 1, "selector": "A" }, { "count": 1, "selector": "B" } ], "placementFactor": 2, "selectors": [ { "name": "A", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FA" }, { "name": "B", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FB" } ], "filters": [ { "name": "FA", "key": "site", "op": "EQ", "value": "a", "filters": [] }, { "name": "FB", "key": "site", "op": "EQ", "value": "b", "filters": [] } ], "initialPlacement": { "maxReplicas": 1, "preferLocal": true } } ``` For a single rule `REP 3`, `"initialPlacement": { "replicaLimits": [2] }` acknowledges after 2 of the 3 replicas. - Guarantees: at the moment the upload returns, the number of replicas you set in `maxReplicas` or `replicaLimits` is stored. - Does not guarantee: the full redundancy at that moment. Until the background delivery or the policer completes the policy, the object has only the initial replicas. If the nodes that hold them fail in that window, the object is lost. With `maxReplicas: 1` that is a single node. - Cannot be combined with a metadata consistency setting on the same bucket. A named policy that has both can be saved, but creating a bucket with it fails with status `500` after 10 seconds. See [Replication and consistency](../../explanation/replication-and-consistency.md). ### 4. Pick the placement factor The placement factor (`placementFactor`, `CBF` in policy text) multiplies the number of candidate nodes of each rule. A rule for `n` nodes gets up to `n × factor` candidates. Each object uses the `n` candidates that rank first for its ID. The others are reserves for that object and primary nodes for other objects. The default is 3. | Factor | Effect | Use it when | |---|---|---| | 1 | The bucket uses exactly the nodes its selector selects: `n` per rule when the policy has no selector or the selector selects `n`. Every object is then on the same nodes, and there are no reserves: an upload fails while one of these nodes cannot store. A selector that selects more than `n` leaves reserves even at factor 1. | You need a selector's `DISTINCT` grouping to hold for every object, or the cluster has exactly as many nodes as the rule needs. | | 2 or more | The bucket spreads over up to `n × factor` nodes. A node that is down is replaced by a reserve for new uploads. | The cluster has more nodes than one rule needs. This is the normal case. | Bounds: `n × factor` is at most 64 per rule and 512 per policy. When fewer than `n × factor` nodes match, the policy uses the nodes that exist. It needs at least `n`. :::warning A policy that the network map cannot satisfy stops the whole bucket. If a filter matches fewer nodes than its selector needs, every object operation on the bucket fails with status `500` and `not enough nodes to SELECT from`, reads included. This happens when a site or rack named in the policy leaves the network map, which a storage node does after it has been silent for more than 3 epochs. Name a site in a policy only if you accept that the bucket is unavailable while that site is out of the network map. ::: ### 5. Save the policy under a name A policy name has at most 42 bytes. Save a policy for your own use: ```shell curl -i -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/storage-policies" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "two-sites", "policy": { "replicas": [ { "count": 1, "selector": "A" }, { "count": 1, "selector": "B" } ], "placementFactor": 2, "selectors": [ { "name": "A", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FA" }, { "name": "B", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FB" } ], "filters": [ { "name": "FA", "key": "site", "op": "EQ", "value": "a", "filters": [] }, { "name": "FB", "key": "site", "op": "EQ", "value": "b", "filters": [] } ] } }' ``` The response has status `201`. Status `400` with `Invalid policy format.` and a reason means the policy breaks a validation limit. Status `409` means the name is taken. Only the user can create, replace and delete their own policies. An administrator can read them. A global administrator saves a system policy, which every user can refer to, with the same body at `POST /api/v1/cluster/storage-policies`. The optional field `"default": true` marks it as the default system policy. The default policy cannot be deleted. | Task | Request | |---|---| | Replace a policy | `PUT /api/v1/users/{user}/storage-policies/{policyName}` or `PUT /api/v1/cluster/storage-policies/{policyName}` with `{"policy": ...}` | | Delete a policy | `DELETE` on the same paths | | Read one policy | `GET` on the same paths | When a user policy and a system policy have the same name, bucket creation uses the user policy. Replacing or deleting a named policy does not change buckets that were created with it. Each bucket holds its own copy. The optional field `consistency` (`strict` or `optimistic`) next to `policy` turns on metadata consistency for buckets created with the policy. The API specification marks it as experimental. ### 6. Create a bucket with the policy ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "two-sites", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": false, "head": false, "put": false, "delete": false, "search": false } } }' ``` Status `201` means the nodes of the current network map satisfy the policy. Status `409` with `Inapplicable policy.` means they do not: a filter matches too few nodes or the cluster is too small. Saving a policy does not run this check; creating a bucket does. ## Check the result Read the bucket. `placementPolicy` shows the policy that the bucket holds: ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" | jq .placementPolicy ``` The response does not show `initialPlacement`, also for a bucket whose policy has it. Upload an object and download it again. An upload that succeeds proves that the cluster can place every rule of the policy right now. See [Store your first object with the REST API](../../tutorials/first-steps-with-the-rest-api.md). ## In the web console **Policies** lists the system policies. A global administrator can add and edit them there and choose **Set as default**. The policy editor has a **Basic** tab with fields for **Number of replicas** or **Erasure coding rules**, **Placement factor** and **Initial placement**, and a **Netmap QL** tab that takes policy text. ## Related - [Storage policy language](../../reference/storage-policy-language.md) - [Data placement](../../explanation/data-placement.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) - [Size a cluster](../deploy/size-a-cluster.md) - [Limits](../../reference/limits.md) --- # Control access to a bucket This guide sets up who may read, write, delete and list the objects of a bucket, and shows how to check that a rule works. Morph has two layers of access rules for objects: - The **basic ACL** is fixed when the bucket is created. It says which operations the owner and everyone else may perform at most. - The **extended ACL** (eACL) is a table of rules that the owner can replace at any time. It narrows what the basic ACL allows, for roles or for single accounts. The extended ACL cannot allow an operation that the basic ACL forbids. Plan the basic ACL as the widest access you will ever need, and use the extended ACL to close it down to the access you need now. ## Before you start - You are the owner of the bucket, or you are about to create it. Only the owner can set the extended ACL. An administrator can read it. - Your token allows `setBucketEACL`. A token from `/api/v1/login` does. - A second user account for the test at the end. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## How a request is evaluated The storage node that handles an object request decides in this order: 1. It determines the role of the caller: `owner` when the caller is the bucket owner, `others` for every other caller. Requests without a token, and requests from administrators who do not own the bucket, are `others`. The storage nodes of the bucket and the inner ring nodes have a role of their own, `system`; rules for `others` do not apply to them. 2. It checks the basic ACL for this role and operation. If the flag is `false`, the request is denied. Nothing later can change that. 3. If the basic ACL is `final`, the request is allowed. 4. It takes the rule table: the extended ACL of the bucket, or, if the request carries an access token and the basic ACL allows access tokens, the table inside the token. The token's table replaces the bucket's table for that request. 5. It walks the table from top to bottom. The first record that matches the operation, the caller and all its filters decides: `ALLOW` or `DENY`. 6. If no record matches, the request is allowed. Two consequences: - Order matters. Put `ALLOW` records for specific accounts above the general `DENY` record for the role. - An empty table restricts nothing. The basic ACL alone applies. ## Steps ### 1. Set the basic ACL when you create the bucket Decide the widest access. For a bucket whose objects you want to open to selected users later, allow `others` the operations those users will need: ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-3", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": true, "head": true, "put": false, "delete": false, "search": true } }, "eACL": { "records": [ { "operation": "GET", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "HEAD", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "SEARCH", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] } ] } }' ``` The basic ACL would let anyone read. The initial extended ACL in the same request closes that before the first object arrives. The bucket is private, and you can open it selectively later. `others` can never upload or delete in this bucket, whatever the extended ACL says. | Basic ACL flag | Meaning | |---|---| | `owner.*`, `others.*` | `get`, `head`, `put`, `delete`, `search`: the operation is allowed for the role. | | `final` | `true` disables the extended ACL and access tokens. The basic ACL is then the only rule, for the life of the bucket. | | `disableAccessTokens` | `true` stops access tokens from replacing the extended ACL. See [Share objects with tokens](share-objects.md). | The basic ACL cannot be changed after creation. ### 2. Write the extended ACL table A table is a list of records. Each record has four fields: | Field | Values | Meaning | |---|---|---| | `operation` | `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH` | The operation the record applies to. One per record. | | `action` | `ALLOW`, `DENY` | The decision when the record matches. | | `targets` | List of `{ "role": ... }` or `{ "accounts": [...] }` | Who the record applies to. It matches if any target matches. | | `filters` | List, may be empty | Conditions on the object or request. All must match. | Targets: | Target | Matches | |---|---| | `{ "role": "USER" }` | The bucket owner. | | `{ "role": "OTHERS" }` | Every caller that is not the owner. | | `{ "accounts": ["alice", "bob"] }` | The users with these logins in the namespace of the bucket owner. A login does not have to be registered yet. | The specification also lists the role `SYSTEM`. The inner ring rejects a table that uses it: the request returns status `500` after 5 seconds, and the table stays as it was. Operations and what they cover in the REST API: | Operation | Covers | |---|---| | `GET` | Downloading an object, ranges included. | | `HEAD` | `HEAD` requests for object metadata. | | `PUT` | Uploading an object. | | `DELETE` | Deleting an object. | | `SEARCH` | Listing and searching objects, and finding an object by its path. A caller who addresses an object by path instead of object ID needs `SEARCH` in addition to the operation itself. | Filters: | Field | Values | |---|---| | `headerType` | `OBJECT` for object attributes. The specification also lists `REQUEST` and `SERVICE`. Requests made through the REST API carry no headers of these types, so a record with such a filter does not match. | | `key` | For `OBJECT`: an attribute name such as `FilePath`, or a system key such as `$Object:objectID`, `$Object:ownerID`, `$Object:creationEpoch`. Attributes are compared in `GET`, `HEAD` and `PUT` records. A `DELETE` record sees no attributes, only `$Object:objectID` and `$Object:containerID`. A `SEARCH` record with an object filter does not match. | | `matchType` | `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `value` | The value to compare with. | ### 3. Set the table `PUT /api/v1/buckets/{bucket}/eacl` replaces the whole table. This table keeps the bucket private and lets the user `alice` read and list: ```shell curl -i -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/eacl" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "eACL": { "records": [ { "operation": "GET", "action": "ALLOW", "filters": [], "targets": [{ "accounts": ["alice"] }] }, { "operation": "HEAD", "action": "ALLOW", "filters": [], "targets": [{ "accounts": ["alice"] }] }, { "operation": "SEARCH", "action": "ALLOW", "filters": [], "targets": [{ "accounts": ["alice"] }] }, { "operation": "GET", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "HEAD", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "SEARCH", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] } ] } }' ``` The response has status `204`. | Status | Meaning | |---|---| | `400` | The table is malformed: unknown operation, action, header type or match type, a target without role and accounts, or an invalid login. | | `403` | You are not the owner, or the token does not allow `setBucketEACL`. Administrators cannot set the table of another user's bucket. | | `404` | The bucket does not exist in your namespace. | | `409` | The bucket was changed at the same time. Repeat the request. | | `500` | The inner ring refused the table: it uses the role `SYSTEM`, or the basic ACL of the bucket is final. The response arrives after 5 seconds. | To restrict a rule to some objects, add a filter. This record lets `alice` download only the object with the path `reports/2026.pdf`: ```json { "operation": "GET", "action": "ALLOW", "filters": [ { "headerType": "OBJECT", "matchType": "STRING_EQUAL", "key": "FilePath", "value": "reports/2026.pdf" } ], "targets": [{ "accounts": ["alice"] }] } ``` To remove all restrictions of the extended ACL, set an empty table: `{"eACL": {"records": []}}`. The basic ACL then applies alone. In the example bucket that makes every object readable by anyone. ### 4. Read the table back ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/eacl" \ -H "Authorization: Bearer $TOKEN" | jq ``` The response shows the records in the order in which they are evaluated. `GET /api/v1/buckets/my-bucket` returns the same table in its `eACL` field together with the basic ACL. ## Check the result Test each rule as the caller it is written for. A storage node drops its cached copy of an extended ACL table when it sees the change on the FS chain, so a new table applies within seconds. The 15 seconds of the cache lifetime are the upper limit for a node that missed the notification. If a rule still does not apply after that, the rule is wrong. Upload an object as the owner and keep its ID: ```shell OID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "X-Morph-Path: $(printf '%s' my-object | base64)" \ --data-binary 'hello' | jq -r .oid) ``` Log in as the user the rule is for and as a user it is not for. `ALICE_PASSWORD` and `BOB_PASSWORD` are their passwords. ```shell ALICE_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"alice\",\"password\":\"$ALICE_PASSWORD\"}" | jq -r .token) BOB_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"bob\",\"password\":\"$BOB_PASSWORD\"}" | jq -r .token) ``` Request the object as each caller and print the status: ```shell curl -s -o /dev/null -w '%{http_code}\n' \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" -H "Authorization: Bearer $ALICE_TOKEN" curl -s -o /dev/null -w '%{http_code}\n' \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" -H "Authorization: Bearer $BOB_TOKEN" curl -s -o /dev/null -w '%{http_code}\n' \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" ``` With the table of step 3 the statuses are `200` for `alice`, `403` for `bob` and `403` without a token. A denied request has the body `User is not authorized to make this action in the bucket.` Check a write rule the same way with an upload as `alice`. It returns `403`, because `others.put` is `false` in the basic ACL. ## In the web console The bucket form has **Owner Permissions**, **Other Account Permissions** and **EACL Rules**. The bucket menu has **Edit EACL** for an existing bucket. The editor shows the rules in evaluation order. For a bucket with a final basic ACL the editor is not available. ## Related - [Share objects with tokens](share-objects.md) - [Manage users and roles](../secure/manage-users-and-roles.md) - [Security model](../../explanation/security-model.md) - [REST API reference](../../reference/rest-api/index.md) - [Errors and status codes](../../reference/errors.md) --- # Share objects with tokens This guide gives someone access to objects in your bucket without giving them your account: with a download link, with an access token bound to one user, or with an API token limited to one bucket. ## Which token for which job | You want | Use | Scope | Lifetime | Can be revoked | |---|---|---|---|---| | A link that lets anyone download an object | Bucket access token, not bound | The rules you write into the token, for downloads and `HEAD` requests | Until the `expiresAt` you set, rounded up to whole epochs. See [Lifetime and revocation](#lifetime-and-revocation). | No | | The same, but only for one Morph user | Bucket access token with `owner` | As above, and only together with that user's own token | As above | No | | An application that uploads, lists or deletes in one bucket as you | API token with `bucketName` | The object operations you enable, in that bucket, with your identity | `ttl`, default 30 days | Yes | | Everyone may read everything in the bucket | Basic ACL with `others.get` and `others.head`, no token | The whole bucket | Life of the bucket | The basic ACL is fixed. Unless it is final, an extended ACL that denies `OTHERS` closes the bucket again. | A bucket access token is a signed rule table. For a request that carries it, the storage node applies the table of the token in place of the extended ACL of the bucket. The token does not lift the basic ACL. ## Before you start - You own the bucket. Only the owner can create access tokens for it. Administrators cannot. - The bucket was created with a basic ACL that fits sharing: - `final` is `false` and `disableAccessTokens` is `false`. Both are fixed at creation. - `others.get` and `others.head` are `true`. Add `others.search` if you share by object path. The token cannot allow what the basic ACL forbids for the caller. - To keep the bucket private for requests without a token, its extended ACL denies `OTHERS`. [Control access to a bucket](control-access.md) creates such a bucket in step 1. - Your token allows `createBearerToken` and is not limited to another bucket. A token from `/api/v1/login` qualifies. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Share one object with a link ### 1. Find the object ID Use the ID that the upload returned, or look it up by path: ```shell export OID=$(curl -s "$MORPH_URL/api/v1/buckets/my-bucket/objects?prefix=my-object" \ -H "Authorization: Bearer $TOKEN" | jq -r '.objects[0].oid') ``` A link by object ID keeps pointing at exactly these bytes. Uploading a new object with the same path does not change what the link returns. ### 2. Create the access token Send `POST /api/v1/buckets/{bucket}/access-tokens` with the rule table and the expiration date. `EXPIRES_AT` is an RFC 3339 date in the future. ```shell export EXPIRES_AT=2026-12-31T23:59:59Z export ACCESS_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/access-tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"expiresAt\": \"$EXPIRES_AT\", \"records\": [ { \"operation\": \"GET\", \"action\": \"ALLOW\", \"targets\": [{ \"role\": \"OTHERS\" }], \"filters\": [{ \"headerType\": \"OBJECT\", \"matchType\": \"STRING_EQUAL\", \"key\": \"\$Object:objectID\", \"value\": \"$OID\" }] }, { \"operation\": \"HEAD\", \"action\": \"ALLOW\", \"targets\": [{ \"role\": \"OTHERS\" }], \"filters\": [{ \"headerType\": \"OBJECT\", \"matchType\": \"STRING_EQUAL\", \"key\": \"\$Object:objectID\", \"value\": \"$OID\" }] }, { \"operation\": \"GET\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"HEAD\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"PUT\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"DELETE\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"SEARCH\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] } ] }" | jq -r .token) ``` The response has status `200` and a JSON object with the field `token`, the signed token in standard base64. The records use the same format as the extended ACL and are evaluated the same way: top to bottom, first match decides. :::warning Always end the table with `DENY` records for `OTHERS`. The table of the token replaces the extended ACL of the bucket for the request. An operation that no record of the token matches is allowed if the basic ACL allows it. A token with only the two `ALLOW` records above would open every object of the bucket to its holder. ::: | Status | Meaning | |---|---| | `400` | `records` is empty, `expiresAt` is missing or not in the future, a record is malformed, the `owner` login is invalid, the basic ACL is final, or the basic ACL does not allow access tokens for an operation in the table. | | `403` | You are not the owner of the bucket, the token does not allow `createBearerToken`, or it is limited to another bucket. | | `404` | The bucket does not exist in your namespace. | ### 3. Build the link The token goes into the `accessToken` query parameter of the object URL. Standard base64 contains `+`, `/` and `=`, so it must be URL-encoded: ```shell ENCODED=$(printf '%s' "$ACCESS_TOKEN" | jq -sRr @uri) echo "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID?accessToken=$ENCODED" ``` Append `&download=true` to make browsers save the object as a file. Without it the `Content-Disposition` header of the response starts with `inline`. Only `GET` and `HEAD` requests for an object read the `accessToken` parameter. Uploads, deletions, listings and searches ignore it. For a bucket in a namespace other than the default one, a request without a Morph token must also send the header `X-Morph-Namespace`, or go to a gateway bound to that namespace. A plain link opened in a browser reaches buckets of the default namespace only. ### 4. Hand out the link Anyone who has the link can download the object until the token expires. Treat the link as a secret. ## Bind a token to one user Add `owner` with the login of a user in your namespace. The token then works only in requests that also carry that user's own Morph token: ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/access-tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"expiresAt\": \"$EXPIRES_AT\", \"owner\": \"alice\", \"records\": [ { \"operation\": \"GET\", \"action\": \"ALLOW\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"HEAD\", \"action\": \"ALLOW\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"PUT\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"DELETE\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] }, { \"operation\": \"SEARCH\", \"action\": \"DENY\", \"filters\": [], \"targets\": [{ \"role\": \"OTHERS\" }] } ] }" | jq -r .token ``` This token lets `alice` download every object of the bucket by object ID. `alice` sends her own token in the `Authorization` header and the access token in the `accessToken` parameter. The same access token is refused for every other caller, including requests without a Morph token and including you. ## Share by path or by attribute A filter can select objects by an attribute. The key `FilePath` is the object path. A caller who addresses an object by path needs `SEARCH` as well, so the table allows it: ```json [ { "operation": "GET", "action": "ALLOW", "targets": [{ "role": "OTHERS" }], "filters": [{ "headerType": "OBJECT", "matchType": "STRING_EQUAL", "key": "FilePath", "value": "reports/2026.pdf" }] }, { "operation": "HEAD", "action": "ALLOW", "targets": [{ "role": "OTHERS" }], "filters": [{ "headerType": "OBJECT", "matchType": "STRING_EQUAL", "key": "FilePath", "value": "reports/2026.pdf" }] }, { "operation": "SEARCH", "action": "ALLOW", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "GET", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "HEAD", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "PUT", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] }, { "operation": "DELETE", "action": "DENY", "filters": [], "targets": [{ "role": "OTHERS" }] } ] ``` A share by path follows the path: when a newer object with the same path is uploaded, the link returns the newer object. A share by attribute also covers matching objects that are uploaded after the token was created. ## Give an application access to one bucket For an application that works in a bucket as you, create an API token limited to that bucket and to the operations it needs: ```shell curl -s -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tokenName": "uploader for my-bucket", "ttl": "24h", "bucketName": "my-bucket", "get": false, "head": false, "put": true, "delete": false, "search": false, "createBucket": false, "deleteBucket": false, "setBucketEACL": false }' | jq -r .token ``` The application sends this token in the `Authorization` header. It acts with your identity, so the `owner` group of the basic ACL applies to it. Unlike an access token it can be listed and revoked. See [Manage API tokens](../secure/manage-api-tokens.md). ## Lifetime and revocation - `expiresAt` of an access token is converted to whole network epochs, rounded up, and the token stays valid until the last of these epochs has ended. With the default epoch of 3600 seconds, a token can stay valid up to two hours longer than the date you set. - An access token cannot be revoked, listed or changed. Morph keeps no record of it. Changing the extended ACL of the bucket has no effect on tokens that were already issued, in either direction. - To end a share before the token expires, delete the shared object. A link by object ID then returns `404`. - To rule out access tokens for a bucket from the start, create it with `"disableAccessTokens": true` in the basic ACL. The extended ACL stays usable. With `"final": true` both are off. ## Check the result Request the object without a Morph token, first without the access token and then with it: ```shell curl -s -o /dev/null -w '%{http_code}\n' \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" curl -s -o /dev/null -w '%{http_code}\n' -G \ "$MORPH_URL/api/v1/buckets/my-bucket/objects/$OID" \ --data-urlencode "accessToken=$ACCESS_TOKEN" ``` For a private bucket the first status is `403` and the second is `200`. Request another object of the bucket with the same access token: the status is `403`. ## In the web console The menu of an object has **Share**. The dialog asks for the **Link expiration** day and, with **Create link**, requests an access token for that object with `expiresAt` at 23:59:59 of that day in the browser's time zone. It then shows the **External link** with the tabs **View** and **Download** and a copy button. The token allows `GET` and `HEAD` for that object ID and denies everything else. ## Related - [Control access to a bucket](control-access.md) - [Manage API tokens](../secure/manage-api-tokens.md) - [Use namespaces](use-namespaces.md) - [Security model](../../explanation/security-model.md) - [REST API reference](../../reference/rest-api/index.md) --- # Lock objects against deletion This guide protects stored data from deletion through the REST API until a date you choose. The REST API has one lock: the **bucket lock**. It has no lock for single objects, no retention period per object and no legal hold. Read [What the bucket lock does](#what-the-bucket-lock-does) first, because the bucket lock alone does not stop anyone from deleting objects. For locks on single objects, use S3 Object Lock through the S3 gateway. See [S3 compatibility](../../reference/s3-compatibility.md). ## What the bucket lock does | | With an active bucket lock | |---|---| | Delete the bucket through the REST API | Refused with status `409` and the text `Bucket locked.` This holds for the owner and for administrators. | | Delete the bucket through S3 | Refused with status `500` and the error code `InternalError`. | | Delete the user who owns the bucket | Refused. | | Delete an object in the bucket | Allowed, if the access rules allow it. The lock does not look at objects. | | Upload and read objects | Unchanged. | | Object expiration | Unchanged. Objects with a lifetime still expire. | | Transfer the bucket to another user | Allowed. The lock stays on the bucket. | The lock is a date, `lockUntil`. The FS chain refuses to remove the bucket while the time of the chain has not passed that date. - The date can be moved later. It cannot be moved earlier and it cannot be removed. - Only the owner of the bucket can set it. Administrators can read it. - After the date the bucket can be deleted like any other. `lockUntil` stays visible in the bucket information with its past value. To keep the objects themselves from being deleted, combine the bucket lock with a basic ACL that forbids `delete`. See [Prevent object deletion](#prevent-object-deletion). ## Before you start - You own the bucket, or you are about to create it. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Lock a bucket ### 1. Lock at creation Add `lockUntil` to the bucket request. The value is an RFC 3339 date in the future. ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-3", "lockUntil": "2027-12-31T23:59:59Z", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": false, "head": false, "put": false, "delete": false, "search": false } } }' ``` `lockHours` is a deprecated alternative that counts hours from now. The two fields cannot be sent together. ### 2. Lock or extend an existing bucket Send `PUT /api/v1/buckets/{bucket}/timelock` with the new date: ```shell curl -i -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/timelock" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "lockUntil": "2028-06-30T00:00:00Z" }' ``` The response has status `204`. | Status | Meaning | |---|---| | `400` | `lockUntil` is missing, is in the past, or is earlier than the current lock of the bucket. | | `403` | You are not the owner of the bucket. | | `404` | The bucket does not exist in your namespace. | | `500` | `lockUntil` is equal to the current lock of the bucket. | :::warning A lock cannot be shortened or removed by anyone, including administrators. Until the date passes, the bucket and its owner account cannot be deleted. Check the date before you send it. ::: ### 3. Read the lock ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/timelock" \ -H "Authorization: Bearer $TOKEN" ``` The response is a JSON object with `lockUntil` in UTC. A date in the past means the bucket is not locked. `GET /api/v1/buckets/my-bucket` shows the same date in its `lockUntil` field. ## Prevent object deletion The basic ACL is checked before every object operation and cannot be changed after the bucket is created. A bucket whose basic ACL has `delete` set to `false` for `owner` and for `others` accepts no object deletion from any caller: not from the owner, not from administrators, not with an access token, not through an extended ACL rule. Create the bucket with that basic ACL and a lock. This example uses a second bucket, `my-archive`: the name `my-bucket` is taken by the locked bucket of the steps above. ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-archive", "placementPolicyName": "REP-3", "lockUntil": "2027-12-31T23:59:59Z", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": false, "search": true }, "others": { "get": false, "head": false, "put": false, "delete": false, "search": false } } }' ``` What this combination prevents, and until when: | Action | Prevented | |---|---| | Deleting an object | For the life of the bucket. | | Changing an object | Objects are never changed in place. An upload with an existing path creates a new object with a new ID; the earlier object stays. | | Deleting the bucket with all its objects | Until `lockUntil`. Extend the lock before it passes to keep the protection. | What it does not prevent: - An object that was uploaded with a lifetime expires at its date. Upload without `X-Morph-Lifetime` and `X-Morph-Lifetime-Date` to store objects without expiration. - After `lockUntil` the owner can delete the bucket. That deletes every object in it. - Loss of data through hardware failures beyond what the storage policy tolerates. This setting is permanent. A bucket created with `delete: false` can never have single objects deleted. The only way to free its space is to delete the whole bucket after the lock has passed. ## Check the result Try to delete the locked bucket: ```shell curl -s -o /dev/null -w '%{http_code}\n' -X DELETE \ "$MORPH_URL/api/v1/buckets/my-bucket" -H "Authorization: Bearer $TOKEN" ``` The status is `409`. The bucket is still listed. For the bucket with `delete: false`, upload an object and try to delete it by its ID: ```shell OID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-archive/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "X-Morph-Path: $(printf '%s' my-object | base64)" \ --data-binary 'hello' | jq -r .oid) curl -s -o /dev/null -w '%{http_code}\n' -X DELETE \ "$MORPH_URL/api/v1/buckets/my-archive/objects/$OID" -H "Authorization: Bearer $TOKEN" ``` The status is `403`. ## In the web console The bucket form has **Advanced settings** > **Deletion protection until**. For an existing bucket, **Edit deletion protection** sets a later date. A locked bucket answers a deletion attempt with "Bucket with deletion protection cannot be deleted yet." ## Related - [Create a bucket](create-a-bucket.md) - [Control access to a bucket](control-access.md) - [Expire objects](expire-objects.md) - [S3 compatibility](../../reference/s3-compatibility.md) - [REST API reference](../../reference/rest-api/index.md) --- # Expire objects This guide uploads objects that Morph removes by itself after a time you set. In the REST API, expiration is a property of a single object and is set when the object is uploaded. The API has no operation that changes the expiration of an existing object, and no rule that expires all objects of a bucket. To change the expiration, upload the object again and delete the earlier one. ## Before you start - A bucket and a token that allows `put` in it. - `curl`, `jq` and `base64`. - The clocks of all Morph nodes are synchronized. Each storage node compares the expiration time with its own clock. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. Choose how to state the lifetime | Header | Value | Result | |---|---|---| | `X-Morph-Lifetime` | Whole hours, 0 or more | The object expires that many hours after the upload. `0` means no expiration. A negative value is rejected with status `400`. | | `X-Morph-Lifetime-Date` | RFC 3339 date in the future, for example `2026-12-31T23:59:59Z` | The time until that date is rounded up to whole hours and used as the lifetime. A date in the past is rejected with status `400`. | | `X-Attributes` with the key `ExpHours` | Whole hours as a string, for example `{"ExpHours":"24"}` | Same as `X-Morph-Lifetime`. | When several are sent, `X-Morph-Lifetime-Date` wins over `X-Morph-Lifetime`, and `X-Morph-Lifetime` wins over `ExpHours`. `ExpHours` applies when `X-Morph-Lifetime` is absent or 0, so an object sent with `X-Morph-Lifetime: 0` and `ExpHours` does expire. The resolution is one hour. The shortest lifetime that can be set is one hour; 0 sets none. With `X-Morph-Lifetime-Date` the object can live up to one hour past the date you give, because of the rounding. Without any of these, the object does not expire. ### 2. Upload with a lifetime in hours ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "X-Morph-Path: $(printf '%s' my-object | base64)" \ -H "X-Morph-Lifetime: 24" \ --data-binary @my-object.txt ``` The response has status `201` and a JSON object with the object ID in `oid`. ### 3. Or upload with an expiration date ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "X-Morph-Path: $(printf '%s' my-object | base64)" \ -H "X-Morph-Lifetime-Date: 2026-12-31T23:59:59Z" \ --data-binary @my-object.txt ``` ## Check the result List the object. `expirationDate` shows when it expires. The field is absent for an object without expiration. ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/objects?prefix=my-object" \ -H "Authorization: Bearer $TOKEN" \ | jq '.objects[] | {oid, path, creationDate, expirationDate}' ``` ## What happens at expiry Morph stores the expiration as a time in seconds in the object header. 1. **The object stops being served.** When the clock of a storage node is past the expiration time, that node answers requests for the object as if it did not exist. `GET` and `HEAD` through the REST API return status `404`, and the object is no longer listed. This takes effect within seconds, not at the exact second: an object can still be read for several seconds after its `expirationDate`. 2. **The garbage collector removes it.** Each shard of each storage node runs a remover. In a Morph installation it runs every 10 seconds and handles up to 200 objects per run (`gc.remover_sleep_interval` and `gc.remover_batch_size` in the generated storage node configuration). A run collects expired objects and deletes objects that were marked earlier. 3. **The space is reclaimed** when the remover has deleted the object from the shard. After a large number of objects expire at the same time, removal takes several runs: a shard removes at most 200 objects per 10 seconds. Limits to know: - A shard that is not in read-write mode does not remove expired objects. The objects are no longer served, but their space stays in use until the shard is read-write again. - An expired object that is under an object lock is skipped until the lock has ended. Object locks are set through S3; see [S3 compatibility](../../reference/s3-compatibility.md). - A bucket lock does not stop expiration. See [Lock objects against deletion](lock-objects.md). - Expiration cannot be undone. Once an object has expired it cannot be read, even if the remover has not deleted it yet. ## In the web console The upload dialog of a bucket has **Expiration** with the choices **Unset** and **Set date**. ## Related - [Search objects](search-objects.md) - [Storage node settings](../../reference/configuration/storage-node.md) - [Data model](../../explanation/data-model.md) - [REST API reference](../../reference/rest-api/index.md) --- # Set storage quotas This guide limits how much storage space a user or a bucket can occupy. Morph has quotas at two levels, each with a soft and a hard limit: | Level | Limits the space of | Set by | |---|---|---| | User quota | All buckets the user owns, together | An administrator of the user's namespace | | Bucket quota | One bucket | An administrator of the bucket's namespace | | Default quota | Nothing by itself. It is copied into the user quota of every user created afterwards. | An administrator, per namespace | An upload must fit both the bucket quota and the user quota. The tighter one decides. The storage node applies the user quota of the account that uploads the object, and compares it with the space of the buckets that account owns. ## How quotas are counted and enforced - **Limits are in bytes. `0` means unlimited.** When both limits are set, the soft limit must be lower than the hard limit. - **Replicas count.** The quota limits the space used on the storage nodes, with all replicas. In a bucket with a `REP 3` policy, an object of 1 GiB uses 3 GiB of quota. In a bucket with `EC 4/2`, it uses 1.5 GiB. - **Hard limit:** a storage node refuses an upload that would take the used space over the limit. Objects that are already stored stay readable. - **Soft limit:** the upload is accepted. The storage node writes the warning `soft quota limit has been reached` to its log. The API returns nothing different to the client. - **Enforcement lags.** Storage nodes take the used space from the size reports that every storage node writes to the FS chain three times per epoch: every 20 minutes with the default epoch of 3600 seconds. Each storage node also caches quotas and usage for 10 minutes. A new limit, or space freed by deletions, can therefore take that long to have an effect. Uploads made shortly after a limit is crossed can still succeed. - If a storage node cannot read the quota from the FS chain, it accepts the upload. ## Before you start - A token of an administrator that allows `setUserQuota`, which covers user quotas and bucket quotas, and, for the default quota, `setDefaultStorageQuota`. A token from `/api/v1/login` of an administrator allows both. A namespace administrator can act in their own namespace only. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. Set the quota of a user This sets a soft limit of 80 GiB and a hard limit of 100 GiB for the user `alice`: ```shell curl -i -X PUT "$MORPH_URL/api/v1/users/alice/quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "softQuota": 85899345920, "hardQuota": 107374182400 }' ``` The response has status `204`. Send both fields: a field that is left out is set to `0`. | Status | Meaning | |---|---| | `400` | Malformed body, or the soft limit is not lower than the hard limit. | | `403` | The token is not an administrator's, or does not allow `setUserQuota`. | | `404` | No user with this name in the namespace. | A global administrator sets the quota of a user in another namespace by adding the header `X-Morph-Namespace` with the name of that namespace. `POST` on the same path is deprecated and does the same. ### 2. Set the default quota for new users ```shell curl -i -X PUT "$MORPH_URL/api/v1/cluster/default-quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "softQuota": 8589934592, "hardQuota": 10737418240 }' ``` The response has status `204`. - The default applies to users created after the change. Existing users keep their quota. - A login that was registered before and then deleted gets the quota it had when it was deleted, not the default. Set the quota again after you register such a login. - Each namespace has its own default. Without the header `X-Morph-Namespace` the request changes the default of your own namespace. A global administrator can name any namespace in the header. - A new namespace starts with a copy of the default quota of the default namespace at that moment. Later changes to either do not affect the other. Read the current default. Any user can read the default of their own namespace: ```shell curl -s "$MORPH_URL/api/v1/cluster/default-quota" \ -H "Authorization: Bearer $TOKEN" ``` ### 3. Set the quota of a bucket ```shell curl -i -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "softQuota": 0, "hardQuota": 53687091200 }' ``` The response has status `204`. The bucket must be in the administrator's own namespace. The owner of a bucket who is not an administrator can read its quota but cannot set it. ## Check the result Read the quota and the usage of the user: ```shell curl -s "$MORPH_URL/api/v1/users/alice" \ -H "Authorization: Bearer $TOKEN" | jq '{storageSoftQuota, storageHardQuota}' curl -s "$MORPH_URL/api/v1/users/alice/metrics" \ -H "Authorization: Bearer $TOKEN" | jq '{bucketCount, usedSpace}' ``` Read the quota and the usage of the bucket: ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/quota" \ -H "Authorization: Bearer $TOKEN" curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" | jq '{usedSpace, numberOfObjects}' ``` `usedSpace` is in bytes. ## What a client sees over quota | Interface | Over the hard limit | Over the soft limit only | |---|---|---| | REST API upload | Status `507` with the text `User doesn't have enough space.` | Status `201`, as usual. | | S3 upload | The upload is refused with status `500` and the error code `InternalError`. | Accepted. | | Downloads, listings, deletions | Unchanged. | Unchanged. | To get under the limit again, delete objects or raise the quota. Allow for the enforcement lag described above before uploads are accepted again. ## In the web console **Users** shows the **Soft quota** and **Hard quota** of each user and lets an administrator edit them, together with **Default quotas for new users**. The menu of a bucket has **Edit quotas**. ## Related - [Manage users and roles](../secure/manage-users-and-roles.md) - [Use namespaces](use-namespaces.md) - [Limits](../../reference/limits.md) - [REST API reference](../../reference/rest-api/index.md) --- # Search objects This guide finds objects in a bucket: by path prefix with the list request, and by any attribute with the search request. Objects carry attributes: key-value pairs of strings set at upload. Morph sets `FilePath`, `Content-Type` and `Timestamp` itself. Search works on these, on your own attributes and on a few system properties. It does not look into object content. ## Before you start - A bucket with objects. - A token that allows `search` in the bucket. The basic ACL and the extended ACL of the bucket must allow `SEARCH` for you. - `curl`, `jq` and `base64`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"$MORPH_USER\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. Give objects attributes at upload Send your attributes as a JSON object of strings in the `X-Attributes` header. The value can be plain JSON or the same JSON in Base64. ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ -H "X-Morph-Path: $(printf '%s' reports/2026/q1.pdf | base64)" \ -H 'X-Attributes: {"Department":"finance","Status":"published","Year":"2026"}' \ --data-binary @q1.pdf ``` Rules for attributes: | Rule | Detail | |---|---| | Keys and values are strings | A value used with numeric operators must be a decimal integer in a string, for example `"2026"`. | | Reserved prefix | A key that starts with `__` is rejected with status `400`. | | Empty key or value | The pair is ignored. | | Consumed keys | `FilePath`, `ExpHours`, `Content-Type` and `Timestamp` in `X-Attributes` set the object path, lifetime, media type and creation time. They are not stored as your attributes. `FilePath` applies only when the request has no `X-Morph-Path` header. `Timestamp` takes an RFC 3339 date or an HTTP date; Unix seconds are rejected with status `400`. | | Fixed at upload | Attributes cannot be changed later. Upload a new object to change them. | ### 2. List by path prefix `GET /api/v1/buckets/{bucket}/objects` returns the objects whose path starts with `prefix`, with their basic metadata: ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket/objects?prefix=reports/2026/&maxItems=100" \ -H "Authorization: Bearer $TOKEN" \ | jq '.objects[] | {oid, path, size, contentType, creationDate, expirationDate}' ``` Without `prefix` the request lists all objects of the bucket. Paths are not unique: two uploads with the same path are two objects, and both are listed. ### 3. Search by attributes `POST /api/v1/buckets/{bucket}/objects/search` takes filters and the list of attributes to return: ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects/search?maxItems=100" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filters": [ { "key": "Department", "match": "MatchStringEqual", "value": "finance" }, { "key": "Status", "match": "MatchStringEqual", "value": "published" }, { "key": "Year", "match": "MatchNumGE", "value": "2025" } ], "attributes": ["FilePath", "Department", "Year"] }' | jq ``` The response has an `objects` array. Each element has `objectId` and `attributes`, a map with the requested attributes. An object that lacks a requested attribute has an empty string for it. How the request is read: - An object must match **all** filters. - At most 7 filters and at most 7 attributes. More is rejected with status `400`. - The result is sorted by the attribute of the first filter, then by object ID. With a numeric operator in the first filter the order is numeric, otherwise it is lexicographic. - The attribute of the first filter is returned only if you list it in `attributes`. - With `filters` and `attributes` both empty or absent, the search returns the IDs of all objects. - With `attributes` but no `filters`, only objects that have the first requested attribute are returned, sorted by it. - A search that matches nothing returns status `200` with an empty list. Match operators: | `match` | Matches objects whose attribute | |---|---| | `MatchStringEqual` | equals `value`. | | `MatchStringNotEqual` | differs from `value`. | | `MatchNotPresent` | is absent. | | `MatchCommonPrefix` | starts with `value`. | | `MatchNumGT`, `MatchNumGE`, `MatchNumLT`, `MatchNumLE` | is a number greater than, at least, less than, at most `value`. `value` is a decimal integer between −(2²⁵⁶ − 1) and 2²⁵⁶ − 1. | System properties usable as `key` and in `attributes`: | Key | Value format | |---|---| | `$Object:payloadLength` | Size of the object in bytes, as a decimal number. A filter value must be an unsigned 64-bit integer. | | `$Object:payloadHash` | SHA-256 of the content, as 64 hexadecimal characters. | | `$Object:ownerID` | User ID of the object's creator, as returned by a search that requests this attribute. | | `$Object:creationEpoch` | Epoch in which the object was created, as a decimal number. A filter value must be an unsigned 64-bit integer. | Any other key that starts with `$Object:` or with `__` is rejected with status `400`. This example finds objects larger than 1 GiB and returns their paths and sizes: ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects/search" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filters": [ { "key": "$Object:payloadLength", "match": "MatchNumGT", "value": "1073741824" } ], "attributes": ["$Object:payloadLength", "FilePath"] }' | jq ``` ### 4. Page through the results Both requests return at most `maxItems` objects: 100 by default, 1000 at most. A larger or negative value is rejected with status `400`. When more objects follow, the response has a `cursor` field. Send its value unchanged as the `cursor` query parameter of the next request, with the same filters and attributes. The last page has no `cursor`. ```shell CURSOR="" while :; do PAGE=$(curl -s -G "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ --data-urlencode "prefix=reports/" \ --data-urlencode "maxItems=1000" \ --data-urlencode "cursor=$CURSOR") echo "$PAGE" | jq -r '.objects[].path' CURSOR=$(echo "$PAGE" | jq -r '.cursor // empty') [ -z "$CURSOR" ] && break done ``` A malformed cursor is rejected with status `400` and the text `Cursor is invalid.` ### 5. Watch for incomplete results A search asks the storage nodes of the bucket. When some of them do not answer, the search response has `"incomplete": true`. The list is then valid but can miss objects. Repeat the search later. The field is absent when the result is complete. ## Check the result Search for the object you uploaded in step 1 by one of its attributes, and compare the returned ID with the `oid` from the upload: ```shell curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects/search" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filters": [{ "key": "FilePath", "match": "MatchStringEqual", "value": "reports/2026/q1.pdf" }], "attributes": ["FilePath", "Department", "Timestamp"] }' | jq '.objects[] | {objectId, attributes}' ``` `Timestamp` is the creation time in Unix seconds. ## Status codes | Status | Meaning | |---|---| | `400` | Malformed JSON, too many filters or attributes, a reserved key, an unknown `match`, a non-numeric value with a numeric operator, an invalid `maxItems` or cursor. | | `401` | The token is missing, invalid or expired. | | `403` | The access rules of the bucket do not allow `SEARCH` for you. | | `404` | The bucket does not exist in the namespace of your token. | Search always works in the namespace of the token. The `X-Morph-Namespace` header does not select another namespace for list and search requests. ## In the web console The bucket page lists objects and has **Basic search** by path prefix and **Advanced search** with filters built from a key, a condition and a value. ## Related - [Metadata](../../explanation/metadata.md) - [Control access to a bucket](control-access.md) - [Limits](../../reference/limits.md) - [REST API reference](../../reference/rest-api/index.md) --- # Transfer a bucket to another user This guide moves the ownership of a bucket, with all its objects, from one user to another. A transfer has two steps by two people. The owner creates a transfer request. The recipient accepts it. Until the recipient accepts, nothing changes. | Step | Who | Request | |---|---|---| | Create the transfer | The bucket owner. An administrator cannot do this for the owner. | `POST /api/v1/buckets/{bucket}/transfer` | | See pending transfers | The recipient, or an administrator of the namespace | `GET /api/v1/users/{user}/pending-transfers` | | Accept | The recipient only | `POST /api/v1/users/{user}/pending-transfers/{id}` | ## Before you start - Sender and recipient are users of the same [namespace](use-namespaces.md). A bucket cannot be transferred to another namespace. - The recipient's login. The account does not have to exist yet when the transfer is created, but it must exist to accept. - The recipient accepts soon after the request is created. A request is valid for 140 FS chain blocks, not for a fixed time, and then expires. The chain produces blocks faster while it has transactions to record, so the time is shorter on a busy cluster. The web console gives the validity as up to 5 minutes. On an idle cluster a request can stay valid for longer. - `curl` and `jq`. The commands use two tokens: `TOKEN` of the owner, here `first-admin`, and `RECIPIENT_TOKEN` of the recipient, here `alice`. ```shell export MORPH_URL=http://localhost:9100 export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) export RECIPIENT_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"alice\",\"password\":\"$ALICE_PASSWORD\"}" | jq -r .token) ``` ## Steps ### 1. Owner: create the transfer ```shell export TRANSFER_ID=$(curl -s -X POST "$MORPH_URL/api/v1/buckets/my-bucket/transfer" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "recipientLogin": "alice" }' | jq -r .transfer.id) echo "$TRANSFER_ID" ``` The response has status `201`. Its `transfer` object has `id`, `bucket`, `senderLogin` and `recipientLogin`. | Status | Meaning | |---|---| | `400` | The body is malformed, `recipientLogin` is empty, or it is your own login. | | `403` | You are not the owner of the bucket. | | `404` | The bucket does not exist in your namespace. | The owner keeps the bucket and full access to it while the transfer is pending. ### 2. Recipient: find the transfer ```shell curl -s "$MORPH_URL/api/v1/users/alice/pending-transfers" \ -H "Authorization: Bearer $RECIPIENT_TOKEN" | jq '.transfers[]' ``` Each entry has the transfer `id`, the `bucket` name and the `senderLogin`. Only transfers addressed to this user are listed. The sender's own list does not show it. ### 3. Recipient: accept Send the transfer ID with the header `x-morph-transfer-action: accept`: ```shell curl -i -X POST "$MORPH_URL/api/v1/users/alice/pending-transfers/$TRANSFER_ID" \ -H "Authorization: Bearer $RECIPIENT_TOKEN" \ -H "x-morph-transfer-action: accept" ``` The response has status `204`. The recipient is now the owner. | Status | Meaning | |---|---| | `400` | The transfer ID is malformed, or the action is not `accept`. | | `403` | The token does not belong to the user in the path, or the transfer is addressed to someone else. | | `404` | No pending transfer with this ID. A transfer that was already accepted or has expired also returns `404`. | | `409` | The transfer can no longer be applied, for example because the bucket has changed owner in the meantime. | `accept` is the only action. A transfer cannot be declined or withdrawn. A transfer that is not accepted expires by itself, and the bucket stays with its owner. ## What changes with the owner | | After the transfer | |---|---| | Objects | Unchanged. They stay in the bucket with their IDs and attributes. | | Storage policy, basic ACL, extended ACL | Unchanged. | | The `owner` group of the basic ACL and the `USER` role of the extended ACL | Now mean the new owner. The former owner is `others` and has only the access that `others` has. | | Bucket lock | Stays on the bucket. The new owner can extend it. | | Access tokens issued by the former owner | No longer accepted. An access token must be issued by the current owner of the bucket. | | Rights to set the extended ACL, the lock, and to create transfers and access tokens | Move to the new owner. | ## Check the result Read the bucket as the new owner and look at `owner`: ```shell curl -s "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $RECIPIENT_TOKEN" | jq -r .owner ``` The output is `alice`. The bucket is in the list of `alice` and no longer in the list of the former owner: ```shell curl -s "$MORPH_URL/api/v1/buckets?user=alice" \ -H "Authorization: Bearer $RECIPIENT_TOKEN" | jq .buckets ``` The pending list of `alice` no longer has the transfer. ## In the web console The menu of a bucket has **Transfer a bucket**, which asks for the **Recipient login**. The recipient finds the request under **Profile** > **Bucket transfer list** and chooses **Accept**. ## Related - [Use namespaces](use-namespaces.md) - [Control access to a bucket](control-access.md) - [Set storage quotas](set-quotas.md) - [REST API reference](../../reference/rest-api/index.md) --- # Use namespaces This guide sets up a namespace for a team or a tenant and shows how to work inside it. A namespace is a named group of users with their buckets. Every cluster has the default namespace, whose name is the empty string. Requests that name no namespace work in it. Additional namespaces are created by a global administrator. ## What a namespace isolates | Isolated per namespace | Detail | |---|---| | User accounts | The login `alice` in `team-a` and the login `alice` in `team-b` are two accounts with separate passwords, tokens, buckets and quotas. | | Bucket names | Each namespace has its own bucket names. `my-bucket` can exist once in every namespace. | | Visibility | A user sees and addresses only buckets of the own namespace. | | Administration | An administrator of a namespace manages the users, quotas and login providers of that namespace only. | | Default quota | Each namespace has its own default quota for new users. | | Login providers | OAuth and SAML providers are configured per namespace. | | Bucket transfers and ACL accounts | A bucket can be transferred only within its namespace. Logins in extended ACL rules and in access tokens refer to users of the bucket owner's namespace. | | Shared by all namespaces | Detail | |---|---| | Storage nodes and capacity | A namespace has no storage nodes of its own. Where data is stored is decided by the storage policy of each bucket. | | System storage policies | One list for the cluster, managed by global administrators. | | The FS chain, the license, cluster metrics | Cluster-wide. | A namespace separates names and administration. It does not separate hardware. To keep the data of a tenant on particular nodes, give its buckets a storage policy that selects those nodes. See [Choose a storage policy](choose-a-storage-policy.md). ## Roles | Role | Who | Can | |---|---|---| | Global administrator | A user with the role `admin` in the default namespace | Create and delete namespaces. Manage users, user quotas and default quotas in every namespace. Set bucket quotas in the default namespace only. Read buckets of every namespace by naming it in the `X-Morph-Namespace` header. | | Namespace administrator | A user with the role `admin` in another namespace | Manage users, quotas and login providers of that namespace. Read the buckets of its users and set their quotas. Cannot reach other namespaces or the namespace management requests. | | User | A user with the role `user` | Work with the own buckets. | ## Before you start - A token of a global administrator to create the namespace. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) export NAMESPACE=team-a ``` ## Steps ### 1. Create the namespace A namespace name has 1 to 31 characters: lowercase letters, digits and hyphens. It starts with a letter and does not end with a hyphen. The optional description has at most 256 bytes. ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/namespaces" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{\"name\":\"$NAMESPACE\",\"description\":\"buckets of team A\"}" ``` The response has status `201`. Status `409` means the name is taken. The new namespace takes a copy of the current default quota of the default namespace. Change it with `PUT /api/v1/cluster/default-quota` and the namespace header if the team needs another default. See [Set storage quotas](set-quotas.md). ### 2. Register an administrator for the namespace Send the namespace in the `X-Morph-Namespace` header. `NS_ADMIN_PASSWORD` is the password of the new account. ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Authorization: Bearer $TOKEN" \ -H "X-Morph-Namespace: $NAMESPACE" \ -H "Content-Type: application/json" \ -d "{\"name\":\"team-admin\",\"role\":\"admin\",\"password\":\"$NS_ADMIN_PASSWORD\"}" ``` The response has status `201`. The namespace administrator can register further users of the namespace without the header, because requests without it use the namespace of the token. See [Manage users and roles](../secure/manage-users-and-roles.md). ### 3. Log in to the namespace A login names the namespace in the header. Without the header the login is looked up in the default namespace and fails for a user of another namespace. ```shell export NS_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "X-Morph-Namespace: $NAMESPACE" \ -H "Content-Type: application/json" \ -d "{\"login\":\"team-admin\",\"password\":\"$NS_ADMIN_PASSWORD\"}" | jq -r .token) ``` The token belongs to the namespace. Every request with this token works in `team-a` without any header. ### 4. Work with buckets and objects Use the token as on every other page of this section. No header is needed: ```shell curl -i -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $NS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-3", "basicACL": { "final": false, "owner": { "get": true, "head": true, "put": true, "delete": true, "search": true }, "others": { "get": false, "head": false, "put": false, "delete": false, "search": false } } }' ``` Creating and deleting buckets, setting the extended ACL, the lock and transfers, creating access tokens, and uploading, listing, searching and deleting objects always work in the namespace of the token. These requests have no namespace header. ### 5. Reach a namespace from outside The `X-Morph-Namespace` header selects a namespace in three situations: | Caller | Requests | Effect of the header | |---|---|---| | Nobody logged in | `POST /api/v1/login`; `GET` and `HEAD` of a public object or of an object shared with an access token | Selects the namespace of the account or bucket. Without it the default namespace is used. | | Global administrator | Listing and reading buckets, their extended ACL, quota and lock; downloading objects; managing users, user quotas and default quotas | Selects the namespace to look into. | | Any other user | Any request that accepts the header | Only the own namespace is accepted. Another one is refused with status `403`. | A global administrator lists the buckets of a user of `team-a` like this: ```shell curl -s "$MORPH_URL/api/v1/buckets?user=team-admin" \ -H "Authorization: Bearer $TOKEN" \ -H "X-Morph-Namespace: $NAMESPACE" | jq .buckets ``` A header with a namespace that does not exist is refused with status `400`. ### 6. Optional: bind a gateway to the namespace A gateway-type node can be bound to one namespace when it is installed. Its console API and its S3 endpoint then work in that namespace for every client: - Clients must not send `X-Morph-Namespace` to this gateway. A request with the header is refused with status `400`. - The namespace management requests are disabled on this gateway and return status `403`. - Users of other namespaces are refused, except global administrators. The gateway-only installation is experimental. See [Add a gateway-only node](../deploy/add-a-gateway-node.md). ### 7. Delete a namespace ```shell curl -i -X DELETE "$MORPH_URL/api/v1/cluster/namespaces/$NAMESPACE" \ -H "Authorization: Bearer $TOKEN" ``` The response has status `204`. A namespace that still has users is refused with status `409`. Delete its users first. A user who owns buckets cannot be deleted, so the buckets go first. Each owner deletes their own buckets: in 0.30.1, a deletion request from an administrator for another user's bucket fails with status `500`. ## Check the result List the namespaces and read the new one: ```shell curl -s "$MORPH_URL/api/v1/cluster/namespaces" \ -H "Authorization: Bearer $TOKEN" | jq .namespaces curl -s "$MORPH_URL/api/v1/cluster/namespaces/$NAMESPACE" \ -H "Authorization: Bearer $TOKEN" ``` Confirm the isolation: read the bucket of step 4 with the token of the default namespace and without the header. The status is `404` when the default namespace has no bucket of that name. ```shell curl -s -o /dev/null -w '%{http_code}\n' "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` ## In the web console The login page has a **Namespace** field. Global administrators find **Namespaces** under **Configuration**. The bucket list of another namespace is shown read-only. ## Related - [Manage users and roles](../secure/manage-users-and-roles.md) - [Set storage quotas](set-quotas.md) - [Add a gateway-only node](../deploy/add-a-gateway-node.md) - [Security model](../../explanation/security-model.md) - [REST API reference](../../reference/rest-api/index.md) --- # Manage users and roles This guide shows how to register the first administrator and how to create, list, change and remove users through the console REST API. The console UI offers the same operations on its **Users** page (`/users`). ## Before you start - A Morph cluster whose installation has completed. See [Install a cluster](../deploy/install-a-cluster.md). - `curl` and `jq` on your workstation. - For every step after the first: a token of an administrator. Set the address of the console once: ```shell export MORPH_URL=http://localhost:9100 ``` ## What a user is A user has a name, a role and a password. The name is unique within its namespace. | Property | Rule | |---|---| | Name | 1 to 53 characters from `a-z`, `A-Z`, `0-9`, `@`, `.`, `-`, `+`, `=`, `_`, `~` | | Role | `admin` or `user` | | Password | Any string. Morph does not enforce a length or complexity rule. The first administrator needs a non-empty password, and a login with an empty password is refused. | | Namespace | The default namespace, or a namespace named in the `X-Morph-Namespace` header | Morph has two roles and no custom roles or groups. An `admin` in the default namespace is a **global administrator**. An `admin` in any other namespace is a **namespace administrator** and manages only that namespace. See [Use namespaces](../buckets-and-objects/use-namespaces.md). How a user maps to a key on the FS chain is described in the [security model](../../explanation/security-model.md). ## Register the first administrator While no user exists, `POST /api/v1/users` accepts one request without authentication. It must create a user with the role `admin` in the default namespace. 1. Register the administrator. ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{ "name": "first-admin", "role": "admin", "password": "CreateYourOwnPassword" }' ``` The response is: ```http HTTP/1.1 201 Created ... Registration completed. ``` A response `401 Unauthorized` with the body `Bearer token is required.` means that a user already exists. From then on only an administrator can register users. 2. Log in and keep the token. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) ``` :::warning Register the first administrator as soon as the cluster has started. Until then, anyone who can reach port 9100 can register it. ::: ## Create a user Send the name, the role and the initial password. The request needs the token of an administrator of the target namespace. ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "alice", "role": "user", "password": "InitialPasswordForAlice" }' ``` The response is `201 Created` with a `Location` header that points to the new user. A name that is already taken returns `409 Conflict`. A new user receives the default storage quota of its namespace, if one is set. See [Set storage quotas](../buckets-and-objects/set-quotas.md). To create the user in another namespace as a global administrator, add the header `-H "X-Morph-Namespace: team-a"`. ## List users List the users of a namespace. The response holds up to 100 users per page, sorted by name, and the total number of users in the namespace. ```shell curl -s "$MORPH_URL/api/v1/users?maxItems=100" \ -H "Authorization: Bearer $TOKEN" | jq ``` ```json { "users": [ { "name": "alice", "role": "user" }, { "name": "first-admin", "role": "admin" } ], "totalCount": 2 } ``` When the response contains a `cursor`, pass it as the `cursor` query parameter to get the next page. To read one user with its role and storage quotas: ```shell curl -s "$MORPH_URL/api/v1/users/alice" \ -H "Authorization: Bearer $TOKEN" | jq ``` ## Change a password A user changes its own password with its own token. An administrator can set the password of any user in the namespace it administers. Send only the `password` field: ```shell curl -i -X PUT "$MORPH_URL/api/v1/users/alice" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{"password": "ANewPassword"}' ``` The response is `204 No Content`. A password change has these effects: - Morph generates a new key pair for the user and stores it encrypted with the new password. - Morph revokes the user's session tokens (the tokens issued by login). The user must log in again. - Morph does not revoke the user's personal access tokens and S3 credentials. They stay listed and still authenticate, but they are signed with the old key. Object operations with them fail with `500 Internal Server Error` in the REST API and with `InternalError` in S3 as soon as the storage node checks the token again, at the latest in the next epoch. Issue new ones after a password change and revoke the old ones. See [Manage API tokens](manage-api-tokens.md) and [Manage S3 credentials](manage-s3-credentials.md). Morph has no password recovery for a user. An administrator sets a new password. ## Change a role Only an administrator can change a role. Send the `role` field: ```shell curl -i -X PUT "$MORPH_URL/api/v1/users/alice" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{"role": "admin"}' ``` The response is `204 No Content`. A token that the user received before the change to `admin` keeps the permissions of the role `user`: a request that needs the role `admin` still returns `403 Forbidden`. The user logs in again to use the new role. When an administrator sets the role `user`, Morph revokes all tokens of that user: session tokens, personal access tokens and S3 credentials. Morph refuses to demote the only administrator of the default namespace with `403 Forbidden` and the body `Cannot reduce the only admin.` ## Remove a user A user can be removed only when it owns no buckets. Delete or [transfer](../buckets-and-objects/transfer-a-bucket.md) its buckets first. ```shell curl -i -X DELETE "$MORPH_URL/api/v1/users/alice" \ -H "Authorization: Bearer $TOKEN" ``` The response is `204 No Content`. Morph revokes all tokens of the user and deletes its storage policies. | Response | Meaning | |---|---| | `409 Conflict`, `User removal is not allowed. User has buckets` | The user still owns at least one bucket. | | `403 Forbidden`, `Cannot delete the only admin.` | The user is the only administrator of the default namespace. | | `404 Not Found` | No user with this name exists in the namespace. | ## What each role may do The table lists what a session token obtained by login allows. A [personal access token](manage-api-tokens.md) can carry fewer permissions, never more. | Operation | `user` | Namespace administrator | Global administrator | |---|---|---|---| | Create buckets; read, write and delete objects in its own buckets | Yes | Yes | Yes | | Set the access rules and the lock time of a bucket | Owner only | Owner only | Owner only | | Read the properties, access rules, quota and lock time of a bucket of another user | No | In its namespace | In every namespace | | List the buckets of another user | No | In its namespace | In every namespace | | Delete a bucket of another user | No | In its namespace | In the default namespace | | Set a bucket quota | No | In its namespace | In the default namespace | | Create, list and revoke its own API tokens and S3 credentials | Yes | Yes | Yes | | List the API tokens and S3 credentials of another user and read their properties | No | In its namespace | In every namespace | | Create or revoke API tokens and S3 credentials of another user | No | No | No | | Manage its own storage policies | Yes | Yes | Yes | | Read the storage policies of another user | No | In its namespace | In every namespace | | Read system storage policies | Yes | Yes | Yes | | Create, update and delete system storage policies | No | No | Yes | | Read a user's role and quotas | In its namespace | In its namespace | In every namespace | | Register, list, update and delete users | No | In its namespace | In every namespace | | Set user quotas and the default quota | No | In its namespace | In every namespace | | Configure single sign-on providers | No | In its namespace | In every namespace | | Create, list and delete namespaces | No | No | Yes | | Read cluster metrics; list, admit and decommission storage nodes and gateways | No | No | Yes | | Upload and read the license; read the inner ring public keys | No | No | Yes | In 0.30.1, the request of a global administrator to delete a bucket of another user passes the permission check and then fails with `500 Internal Server Error`. The bucket stays. Let the owner delete the bucket. An administrator does not receive access to the objects of other users through its role. Object access follows the access rules of the bucket. See [Control access to a bucket](../buckets-and-objects/control-access.md) and the [security model](../../explanation/security-model.md). ## Check the result Log in as a user and read its own record. The example uses `alice` with the password from [Create a user](#create-a-user). If you changed the password or removed the user in the steps above, create the user again first. ```shell USER_TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "alice", "password": "InitialPasswordForAlice"}' | jq -r .token) curl -s "$MORPH_URL/api/v1/users/alice" \ -H "Authorization: Bearer $USER_TOKEN" | jq ``` The response shows the role and the storage quotas of the user. A wrong name or password returns `403 Forbidden` with the body `Login failed.` ## Related - [Set up single sign-on](set-up-single-sign-on.md) - [Manage API tokens](manage-api-tokens.md) - [Use namespaces](../buckets-and-objects/use-namespaces.md) - [REST API reference](../../reference/rest-api/index.md) - [Errors and status codes](../../reference/errors.md) - [Security model](../../explanation/security-model.md) --- # Set up single sign-on This guide shows how to register an identity provider so that users sign in to the console with their account at that provider. ## What Morph supports | Protocol | Details | |---|---| | OAuth 2.0 | Authorization code flow, optionally with PKCE (`S256`). Provider types: `github`, `google`, `yandex`, `vk`, and `general` for any other provider. | | SAML 2.0 | Morph acts as the service provider. Name ID format `emailAddress`. | Single sign-on applies to the console UI and the console REST API. It does not apply to S3: S3 clients authenticate with [S3 credentials](manage-s3-credentials.md). Morph does not provide LDAP or Kerberos sign-in, group or role mapping from the provider, SCIM provisioning, or SAML single logout. ## How provider accounts map to Morph users - Morph identifies a provider account by its email address. The email address becomes the Morph user name, so it must follow the rule for user names: at most 53 characters. Morph refuses any other address with `403 Forbidden`. - At the first sign-in Morph registers the user with the role `user` in the namespace the provider belongs to. An administrator can raise the role afterwards; later sign-ins keep it. See [Manage users and roles](manage-users-and-roles.md). - At every sign-in Morph sets a new random password for the user. A user who signs in through a provider therefore cannot also sign in with a password. - The new password comes with a new key for the user, as after every password change. Session tokens, personal access tokens and S3 credentials that the user received before the sign-in are not revoked, but object operations with them fail with `500 Internal Server Error` in the REST API and with `InternalError` in S3, at the latest in the next epoch. The user issues personal access tokens and S3 credentials again after each sign-in. For scripts and S3 clients, use a user that logs in with a password. - The `domains` list of a provider restricts which email addresses may sign in. Each entry starts with `@`, for example `@example.com`. An empty list allows every email address the provider returns. - If an existing Morph user has the same name as the email address, the provider account signs in as that user. :::warning Morph trusts the email address that the provider returns. Register only providers you control or trust, and set `domains` on every provider. ::: ## Before you start - A token of an administrator. A namespace administrator configures providers for its own namespace; a global administrator for any namespace. See [Manage users and roles](manage-users-and-roles.md). - The public URL under which users reach the console. The examples use `https://morph.example.com`. The console itself serves plain HTTP. To offer HTTPS, put a TLS-terminating proxy in front of it. See [Encrypt data](encrypt-data.md). - A working inner ring quorum. Every sign-in through a provider writes to the FS chain: the OAuth state, a new user, or the new random password of an existing user. Set the console address, log in as the administrator, and set the values you received from the identity provider: ```shell export MORPH_URL=http://localhost:9100 export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) export CLIENT_ID=my-client-id export CLIENT_SECRET=my-client-secret ``` ## Add an OAuth 2.0 provider 1. Register an application at the identity provider. Set its redirect URL to `https://morph.example.com/api/v1/oauth/callback`. Note the client ID and the client secret. 2. Create the provider in Morph. For the types `github`, `google`, `yandex` and `vk`, Morph fills in the endpoints, the scope and the email field itself: ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/oauth" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d "{ \"label\": \"Sign in with GitHub\", \"type\": \"github\", \"clientID\": \"$CLIENT_ID\", \"clientSecret\": \"$CLIENT_SECRET\", \"domains\": [\"@example.com\"], \"callbackURL\": \"https://morph.example.com/api/v1/oauth/callback\" }" ``` For any other provider use the type `general` and give every endpoint: ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/oauth" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d "{ \"label\": \"Company login\", \"type\": \"general\", \"clientID\": \"$CLIENT_ID\", \"clientSecret\": \"$CLIENT_SECRET\", \"authorizeURL\": \"https://idp.example.com/authorize\", \"tokenURL\": \"https://idp.example.com/token\", \"userInfoURL\": \"https://idp.example.com/userinfo\", \"authorizeHeaderPrefix\": \"Bearer\", \"scope\": [\"email\", \"profile\"], \"emailPath\": [\"email\"], \"domains\": [\"@example.com\"], \"usePKCE\": false, \"callbackURL\": \"https://morph.example.com/api/v1/oauth/callback\" }" ``` The response is `201 Created`. The `Location` header ends with the provider ID, a string of 20 hexadecimal characters, for example `0a1b2c3d4e5f60718293`. Keep it. This command reads it from the provider list by the label: ```shell export PROVIDER_ID=$(curl -s "$MORPH_URL/api/v1/cluster/oauth" \ | jq -r '.providers[] | select(.label == "Company login") | .id') ``` ### OAuth provider fields | Field | Meaning | |---|---| | `label` | Text of the sign-in button on the login page. | | `type` | `general`, `github`, `google`, `yandex` or `vk`. | | `clientID`, `clientSecret` | Credentials of the application registered at the provider. | | `callbackURL` | Redirect URL. It must match the URL registered at the provider exactly. | | `domains` | Allowed email domains, each starting with `@`. Empty allows all. | | `authorizeURL` | Authorization endpoint. `general` only. | | `tokenURL` | Token endpoint. `general` only. | | `userInfoURL` | Endpoint that returns the user's profile as JSON. `general` only. | | `authorizeHeaderPrefix` | Scheme Morph puts before the access token in the `Authorization` header of the user info request. Default `OAuth`. `general` only. | | `scope` | Scopes requested from the provider. They must make the email address available. `general` only. | | `emailPath` | Path to the email address in the user info response, for example `["email"]` or `["user", "email"]`. `general` only. | | `usePKCE` | Use PKCE. The provider must support it. `general` only. | For the built-in types Morph ignores the `general only` fields and uses these values: | Type | Scope | Email field | PKCE | |---|---|---|---| | `github` | `user:email` | `email` | No | | `google` | `email` | `email` | No | | `yandex` | `login:email` | `default_email` | No | | `vk` | `email` | `user.email` | Yes | With `github`, a user whose profile has no public email address cannot sign in. Morph answers `403 Forbidden` with the body `Email is empty.` ## Add a SAML 2.0 provider 1. Get the metadata XML of the identity provider and encode it in base64. ```shell IDP_METADATA=$(base64 < idp-metadata.xml | tr -d '\n') ``` 2. Create the provider in Morph. `rootURL` is the public URL of the console. `entityID` is the entity ID under which Morph presents itself to the identity provider. ```shell curl -i -X POST "$MORPH_URL/api/v1/cluster/saml" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d "{ \"label\": \"Company login\", \"entityID\": \"https://morph.example.com/sp\", \"idpMetadata\": \"$IDP_METADATA\", \"rootURL\": \"https://morph.example.com/\", \"domains\": [\"@example.com\"] }" ``` The response is `201 Created`. The `Location` header ends with the provider ID. Keep it. This command reads it from the provider list by the label: ```shell export PROVIDER_ID=$(curl -s "$MORPH_URL/api/v1/cluster/saml" \ | jq -r '.providers[] | select(.label == "Company login") | .id') ``` 3. Download the service provider metadata of Morph and import it at the identity provider. ```shell curl -s "$MORPH_URL/api/v1/saml/$PROVIDER_ID/metadata" -o morph-sp-metadata.xml ``` The assertion consumer service URL is `https://morph.example.com/api/v1/saml/$PROVIDER_ID/acs`. 4. Configure the identity provider to release the email address, either as the Name ID or as an attribute named `email`. Morph reads the `email` attribute first and falls back to the Name ID. ## List, change and remove providers List the providers of a namespace. This request needs no token, because the login page uses it. It returns only the ID, the label and, for OAuth, the type. ```shell curl -s "$MORPH_URL/api/v1/cluster/oauth" | jq curl -s "$MORPH_URL/api/v1/cluster/saml" | jq ``` The examples below read and remove an OAuth provider. For a SAML provider, use the path `/api/v1/cluster/saml/$PROVIDER_ID`. An ID on the path of the other protocol returns `404 Not Found`. Read the full configuration of a provider, including the client secret, as an administrator: ```shell curl -s "$MORPH_URL/api/v1/cluster/oauth/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" | jq ``` To change a provider, send the complete configuration with `PUT` to `/api/v1/cluster/oauth/$PROVIDER_ID` or `/api/v1/cluster/saml/$PROVIDER_ID`. For SAML, include `metadataPath` and `acsPath` as returned by the `GET` request. Remove a provider: ```shell curl -i -X DELETE "$MORPH_URL/api/v1/cluster/oauth/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" ``` Removing a provider does not remove the users who signed in through it. A namespace that still has providers cannot be deleted. ## How the sign-in works 1. The login page lists the providers of the namespace as buttons. A button opens the login endpoint of the provider, `/api/v1/oauth/{providerID}/login` or `/api/v1/saml/{providerID}/login`. 2. Morph redirects the browser to the identity provider. For OAuth, Morph creates a signed state value, records it on the FS chain, and sets it as a cookie that is valid for 300 seconds. 3. The identity provider authenticates the user and sends the browser back to the callback URL (OAuth) or the assertion consumer service URL (SAML). 4. For OAuth, Morph checks the state against the cookie and the FS chain, deletes it, exchanges the code for an access token, and requests the user info. For SAML, Morph validates the assertion. 5. Morph checks the email domain, registers or updates the user, and issues a session token. It returns the token in the cookie `x-morph-auth-token`, together with `x-morph-auth-login` and `x-morph-auth-role`, each valid for 300 seconds, and redirects to `/`. The console UI takes the token from the cookie. The session token is valid for the session lifetime of the console (100 hours by default). With OAuth, it is valid for the lifetime of the provider's access token if that is shorter. See [Manage API tokens](manage-api-tokens.md). Ending the session at the identity provider does not revoke a Morph session token that was already issued. Revoke it in Morph. ## Where the provider configuration is kept Morph stores the provider records, including the OAuth client secret and the SAML identity provider metadata, on the FS chain. Limit who can reach the chain RPC port. See [Harden a deployment](harden-a-deployment.md). ## Check the result 1. Open the login page of the console. The provider appears as a button with its label. 2. Without a browser, confirm that the login endpoint of an OAuth provider redirects to the identity provider: ```shell curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' \ "$MORPH_URL/api/v1/oauth/$PROVIDER_ID/login" ``` The status is `307` and the URL is the authorization endpoint of the provider. For a SAML provider, request `/api/v1/saml/$PROVIDER_ID/login`. The status is `302` when the identity provider offers the HTTP redirect binding. 3. Sign in through the provider, then list the users as an administrator. The email address appears with the role `user`. ## Related - [Manage users and roles](manage-users-and-roles.md) - [Use namespaces](../buckets-and-objects/use-namespaces.md) - [REST API reference](../../reference/rest-api/index.md) - [Security model](../../explanation/security-model.md) --- # Manage API tokens This guide shows how to obtain a session token, how to create a personal access token with limited permissions for a script or service, and how to list and revoke tokens. ## Token types Every request to the console REST API carries a token in the header `Authorization: Bearer `. | Type | Created by | Default lifetime | Purpose | |---|---|---|---| | Session token (`session`) | `POST /api/v1/login`, or a [single sign-on](set-up-single-sign-on.md) | 100 hours | Interactive work in the console UI and API. Carries every permission of the user's role. | | Personal access token (`pat`) | `POST /api/v1/users/{user}/tokens` | 30 days | Scripts and services. Carries the permissions you select. | | Access token for sharing | `POST /api/v1/buckets/{bucket}/access-tokens` | Set per token | Gives a third party access to objects of one bucket. It is passed as the `accessToken` query parameter, not in the `Authorization` header. See [Share objects with tokens](../buckets-and-objects/share-objects.md). | S3 clients do not use these tokens. They use [S3 credentials](manage-s3-credentials.md). A session token and a personal access token have the form `_`. The `Authorization` header may be at most 256 characters long. ## Before you start - A Morph user. See [Manage users and roles](manage-users-and-roles.md). - For the examples: a bucket named `my-bucket` that belongs to the user. See [Create a bucket](../buckets-and-objects/create-a-bucket.md). Without it, the request that creates the example token returns `400 Bad Request`. - `curl` and `jq`. ```shell export MORPH_URL=http://localhost:9100 export MORPH_USER=first-admin ``` ## Get a session token Log in with the user name and the password. For a user in a namespace other than the default one, add the header `X-Morph-Namespace`. ```shell export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) ``` The response body has the form `{"role":"admin","token":"..."}`. Each login creates a new session token. Earlier session tokens of the user stay valid until they expire or are revoked. Morph revokes all session tokens of a user when the user's password changes. ## Create a personal access token Only the user can create its own tokens. An administrator cannot create a token for another user. 1. Decide which permissions the token needs. See [Permissions](#permissions). 2. Create the token and keep it in a variable. This example creates a token whose object and bucket permissions are limited to reading objects of `my-bucket` and that expires after 24 hours: ```shell export PAT=$(curl -s -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/tokens" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "tokenName": "backup-reader", "ttl": "24h", "bucketName": "my-bucket", "get": true, "head": true, "search": true, "put": false, "delete": false, "createBucket": false, "deleteBucket": false, "setBucketEACL": false }' | jq -r .token) ``` The response body has the form `{"token":"..."}`. 3. Store the token in a safe place now. Morph cannot show it again: it keeps the secret part only in encrypted form. ### Token fields | Field | Rule | |---|---| | `tokenName` | Required. Up to 256 characters from `a-z`, `A-Z`, `0-9`, `.`, `-` and space. | | `ttl` | Optional. A duration such as `10m`, `24h` or `720h`, or a date in the form `2026-12-31 15:04:05` (UTC), which must be in the future. Default: 30 days. | | `bucketName` | Optional. Restricts object and bucket operations of the token to this bucket. The bucket must belong to the user. A token with a bucket name cannot create buckets. | ### Permissions A flag that you omit takes its default. | Flag | Default | Allows | |---|---|---| | `get` | `true` | Read object data. | | `head` | `true` | Read object headers with a HEAD request. | | `put` | `true` | Create objects. | | `delete` | `true` | Delete objects. | | `search` | `true` | List and search objects. Also required to address an object by its name in GET, HEAD and DELETE requests. | | `createBucket` | `true` | Create buckets. Includes `setBucketEACL`. A request that names a storage policy in `placementPolicyName` also needs `getUserPolicy`; without it Morph answers `403 Forbidden`. | | `deleteBucket` | `true` | Delete buckets. Includes `search`. | | `setBucketEACL` | `true` | Set the access rules of a bucket. | | `getUserPolicies`, `getUserPolicy`, `createUserPolicy`, `updateUserPolicy`, `deleteUserPolicy` | `false` | Read and manage the user's storage policies. | | `s3GetTokens`, `s3TokenDetails`, `s3CreateToken`, `s3RevokeToken` | `false` | List, read, create and revoke S3 credentials. | | `getBearerTokens`, `bearerTokenDetails`, `createBearerToken`, `revokeBearerToken` | `false` | List, read, create and revoke API tokens. `createBearerToken` also allows creating access tokens for sharing. | | `listBucketTransfers` | `false` | List pending bucket transfers. | | `registerUser`, `updateUser`, `deleteUser`, `listUser`, `setUserQuota`, `setDefaultStorageQuota`, `getUserMetrics` | `false` | User administration. Administrators only. | | `createOAuthProvider`, `updateOAuthProvider`, `deleteOAuthProvider`, `createSAMLProvider`, `updateSAMLProvider`, `deleteSAMLProvider` | `false` | Single sign-on configuration. Administrators only. | | `createSystemPolicy`, `updateSystemPolicy`, `deleteSystemPolicy` | `false` | System storage policies. Global administrators only. | | `createNamespace`, `getNamespace`, `listNamespaces`, `deleteNamespace` | `false` | Namespace administration. Global administrators only. | | `uploadLicense`, `getLicense`, `getIRPublicKeys` | `false` | License and inner ring keys. Global administrators only. | The flags `readContent`, `readHeaders` and `create` are deprecated. Use `get`, `head` with `search`, and `put`. Rules: - At least one of the flags `get`, `head`, `put`, `delete`, `search`, `createBucket`, `deleteBucket` and `setBucketEACL` must be `true`. Morph answers a request that switches all of them off with `500 Internal Server Error` and creates no token. - A user without the `admin` role cannot set an administrator flag. Morph answers `400 Bad Request` and a body that starts with `Validation error: permission denied to set`. - A token never gives more than the role of its user. On requests that administer users, quotas, single sign-on providers, namespaces, system storage policies, the license or nodes, Morph also checks the current role of the user on the FS chain. - Morph checks the permissions requested for a new token against the role of the user, not against the token that creates it. Grant `createBearerToken` only to a token that you trust as much as a session token. - The flags limit the operations listed in the table. They do not cover every endpoint of the API. Create the tokens for a script from a user that has only the role and the buckets the script needs. ## List tokens List the tokens of a user. The optional `type` parameter selects `session` or `pat`. A user lists its own tokens. An administrator can list the tokens of a user in the namespace it administers. ```shell curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/tokens?type=pat" \ -H "Authorization: Bearer $TOKEN" | jq ``` ```json { "tokens": [ { "id": "...", "name": "backup-reader", "type": "pat" } ] } ``` The response holds up to 100 tokens. When it contains a `cursor`, pass it as the `cursor` query parameter to get the next page. The `id` is the part of the token before the `_`. The list never contains the secret. The list is not sorted by creation time. Read the permissions, the creation time and the expiry time of one token. This example takes the ID of the token created above from the token itself: ```shell export TOKEN_ID=${PAT%%_*} curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" | jq ``` ## Revoke a token Only the user can revoke its own tokens. ```shell curl -i -X DELETE "$MORPH_URL/api/v1/users/$MORPH_USER/tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` The response is `204 No Content`. A token that was already revoked returns `204 No Content` or `404 Not Found`. An administrator who must cut off another user has these means: | Action | Effect | |---|---| | Set a new password for the user | Revokes the user's session tokens. Personal access tokens and S3 credentials are not revoked, but object operations with them fail from then on, at the latest in the next epoch. | | Set the user's role to `user` | Revokes all tokens and S3 credentials of the user. | | Remove the user | Revokes all tokens and S3 credentials of the user. | Each console caches a validated token for 10 seconds. The console that handles the revocation drops the token from its cache at once. A console on another Morph node can accept a revoked token for up to 10 seconds. An access token for sharing cannot be listed or revoked. It is valid until its expiry time. Give it a short lifetime. ## Expiry - A token is valid from its creation until its expiry time. Morph answers a request with an expired token with `401 Unauthorized`, the body `Token has expired.` and the header `WWW-Authenticate: Bearer realm="morph" error="expired_token" ...`. Some seconds later Morph has removed the token, and the answer is the one for an unknown token: `401 Unauthorized` with the body `Missing or invalid token.` - The lifetime of a session token is the console setting `neofs.sessionTTL`, which Morph generates as `100h`. See [Console settings](../../reference/configuration/console.md). A session token issued after an OAuth sign-in ends earlier if the provider's access token has a shorter lifetime. - Morph sets no upper limit for the `ttl` of a personal access token. - Session tokens and personal access tokens expire by wall-clock time in the releases after 0.30.1. In 0.30.1 and earlier, their validity is counted in epochs, so a token ends at an epoch boundary. - The lifetime of an access token for sharing is converted to whole network epochs, rounded up. The token is valid until the last of them has ended, up to two epochs past the requested time. ## How tokens are stored Morph keeps each session token and personal access token as an object in the system bucket `access-box-storage`. The object carries the owner, the type, the name, the permissions and the expiry time as attributes, and it expires on its own at the expiry time. In its content, the secret part of the token is encrypted for the keys of the registered Morph gateways, and the user's key is encrypted with that secret. See the [security model](../../explanation/security-model.md). Morph does not store an access token for sharing. It is a signed statement that the storage nodes verify. ## Check the result Call the API with a personal access token that is not revoked. If you revoked the example token in [Revoke a token](#revoke-a-token), create it again first. ```shell curl -i "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $PAT" ``` The response is `200 OK` with the list of objects. With a revoked token, the same request returns `401 Unauthorized` with the body `Missing or invalid token.` ## Related - [Manage S3 credentials](manage-s3-credentials.md) - [Share objects with tokens](../buckets-and-objects/share-objects.md) - [REST API reference](../../reference/rest-api/index.md) - [Errors and status codes](../../reference/errors.md) - [Security model](../../explanation/security-model.md) --- # Manage S3 credentials This guide shows how to issue an S3 access key and secret key for a user, how to limit what the key may do, and how to list, revoke and rotate keys. ## Before you start - A Morph user and a session token of that user. See [Manage API tokens](manage-api-tokens.md). Only the user can issue and revoke its own S3 credentials. An administrator can list them and read their properties. - For the example of a key for one bucket: a bucket named `my-bucket` that belongs to the user. See [Create a bucket](../buckets-and-objects/create-a-bucket.md). - `curl` and `jq`. The AWS CLI for the check at the end. ```shell export MORPH_URL=http://localhost:9100 export S3_URL=http://localhost:9080 export MORPH_USER=first-admin export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) ``` ## What an S3 credential is bound to | Binding | Detail | |---|---| | User | The key acts as the user who issued it. Buckets created with it belong to that user. | | Permissions | The flags set at creation. They cannot be changed afterwards. | | Bucket | Optional. A key with a bucket name works only in that bucket. | | Expiry | Set at creation, 30 days by default. Morph sets no upper limit. | | Gateways | The key is encrypted for the S3 gateways that are registered in the cluster when it is issued. A Morph node that joins later cannot use it. Issue new keys after you add a node. | ## Issue a credential 1. Create the credential. This example creates a key with full permissions that expires after 30 days: ```shell curl -s -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{"tokenName": "my-app"}' | jq ``` The response contains the access key ID and the secret access key: ```json { "access_key_id": "...", "secret_access_key": "..." } ``` 2. Store the secret access key now. Morph cannot show it again. To create a read-only key for one bucket that expires after 24 hours: ```shell curl -s -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "tokenName": "report-reader", "ttl": "24h", "bucketName": "my-bucket", "read": true, "modify": false, "manageSettings": false, "createBucket": false, "deleteBucket": false, "setBucketEACL": false }' | jq ``` ### Fields | Field | Default | Meaning | |---|---|---| | `tokenName` | Required | Name shown in listings. Up to 256 characters from `a-z`, `A-Z`, `0-9`, `.`, `-` and space. | | `ttl` | 30 days | A duration such as `10m`, `24h` or `720h`, or a date in the form `2026-12-31 15:04:05` (UTC), which must be in the future. | | `bucketName` | None | Restricts the key to this bucket. The bucket must belong to the user. A key with a bucket name cannot create buckets. | | `read` | `true` | Read objects: GET, HEAD and listing. | | `modify` | `true` | Create and delete objects. | | `manageSettings` | `true` | Manage the S3 settings of a bucket: CORS, tags, notifications, ownership and locks. The bucket policy and the bucket ACL need `setBucketEACL`. | | `createBucket` | `true` | Create buckets. | | `deleteBucket` | `true` | Delete buckets. | | `setBucketEACL` | `true` | Set the access rules of a bucket. | The token that calls this endpoint needs the permission `s3CreateToken`. A session token has it. A personal access token has it only when it was created with `"s3CreateToken": true`. ## List credentials List the credentials of a user. The list shows the access key ID and the name, never the secret. ```shell curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens" \ -H "Authorization: Bearer $TOKEN" | jq ``` ```json { "tokens": [ { "id": "...", "name": "my-app" } ] } ``` The response holds up to 100 credentials. When it contains a `cursor`, pass it as the `cursor` query parameter to get the next page. The list is not sorted by creation time. Read the permissions, the bucket, the creation time and the expiry time of one credential. This example selects the credential `my-app` by its name: ```shell export ACCESS_KEY_ID=$(curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens" \ -H "Authorization: Bearer $TOKEN" \ | jq -r '.tokens[] | select(.name == "my-app") | .id') curl -s "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens/$ACCESS_KEY_ID" \ -H "Authorization: Bearer $TOKEN" | jq ``` ## Revoke a credential ```shell curl -i -X DELETE "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens/$ACCESS_KEY_ID" \ -H "Authorization: Bearer $TOKEN" ``` The response is `204 No Content`. A credential that was already revoked returns `204 No Content` or `404 Not Found`. An S3 gateway caches a credential for 5 minutes after it has used it. A revoked key can therefore keep working on a gateway for up to 5 minutes. Morph also revokes all S3 credentials of a user when an administrator sets the user's role to `user` or removes the user. A password change does not revoke them, but it replaces the key of the user. A credential issued before the change still lists the buckets, and its object operations fail with `InternalError`, at the latest in the next epoch. Issue new credentials after a password change. The same holds after every sign-in of the user through a [single sign-on](set-up-single-sign-on.md) provider. ## Rotate a credential Morph cannot change the secret of an existing key. To rotate: 1. Issue a new credential with the same permissions. 2. Configure the clients with the new access key ID and secret access key. 3. Revoke the old credential. A credential that reaches its expiry time stops working and is removed from the list without any action. Issue the replacement before that time. ## How the gateway validates a request 1. The S3 client signs each request with AWS Signature Version 4 (`AWS4-HMAC-SHA256`). 2. The access key ID names an object in the system bucket `access-box-storage`: it is the ID of that bucket, the digit `0`, and the ID of the object. 3. The gateway reads that object and decrypts its part of it with its own key. This yields the secret access key and a session token signed by the user. 4. The gateway recomputes the request signature with the secret access key and compares. 5. The gateway sends the operation to the storage node together with the session token. The storage node checks the token and the access rules of the bucket. A gateway that is bound to a namespace accepts only credentials of users of that namespace. See [Use namespaces](../buckets-and-objects/use-namespaces.md) and the [security model](../../explanation/security-model.md). ## Check the result Issue a credential, configure the AWS CLI with it and list the buckets through the S3 gateway: ```shell CREDENTIAL=$(curl -s -X POST "$MORPH_URL/api/v1/users/$MORPH_USER/s3-tokens" \ -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: Bearer $TOKEN" \ -d '{"tokenName": "check", "ttl": "1h"}') export AWS_ACCESS_KEY_ID=$(echo "$CREDENTIAL" | jq -r .access_key_id) export AWS_SECRET_ACCESS_KEY=$(echo "$CREDENTIAL" | jq -r .secret_access_key) aws s3 ls --endpoint-url $S3_URL ``` The command lists the buckets of the user. A revoked key returns the S3 error `AccessDenied`, a wrong secret access key `SignatureDoesNotMatch`, and an unknown access key ID `InvalidAccessKeyId`. See [Use the AWS CLI](../integrate/aws-cli.md) for the client setup and [S3 compatibility](../../reference/s3-compatibility.md) for the error codes. ## Related - [Manage API tokens](manage-api-tokens.md) - [Use the AWS CLI](../integrate/aws-cli.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) - [REST API reference](../../reference/rest-api/index.md) --- # Encrypt data This guide shows how to encrypt the traffic of a Morph deployment, what Morph offers for encryption of stored data, and how to protect the key files. ## Before you start - Decide on TLS for the storage nodes before you install a node. The choice is made by the installation request. - Decide on the wallet passwords before the first start of the Morph container. The wallets are created at the first start. - For the checks: a token of a global administrator. See [Manage API tokens](manage-api-tokens.md). ```shell export MORPH_URL=http://localhost:9100 export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) ``` ## Encryption in transit The table lists every link and what Morph does on it. Ports are the defaults; see [Ports and protocols](../../reference/ports-and-protocols.md). | Link | Port | As installed | How to encrypt | |---|---|---|---| | S3 client to S3 gateway | 9080 | HTTP, not encrypted | Morph generates the gateway configuration with TLS disabled, and the installation request has no option for it. Terminate TLS in front of the gateway. See step 2. | | Browser or API client to console | 9100 | HTTP, not encrypted | The console has no TLS setting. Terminate TLS in front of the console. See step 2. | | Storage node to storage node, and external gRPC clients to a storage node | 8080 | gRPC, not encrypted | TLS, when every advertised address of the node uses `grpcs://`. See step 1. | | Console and S3 gateway to the storage node in the same Morph container | loopback | gRPC, not encrypted | Not needed. The traffic does not leave the container. | | Inner ring to inner ring (consensus) | 20333 | Not encrypted | Morph exposes no setting. Use a private network or an encrypted tunnel between the sites. | | Inner ring and storage nodes on the metadata chain | 20334, 21334 | Not encrypted | Morph exposes no setting. Use a private network or an encrypted tunnel between the sites. | | Storage node, console and S3 gateway to the FS chain RPC | 30333 | HTTP and WebSocket, not encrypted | Morph exposes no setting. Use a private network or an encrypted tunnel between the sites. | | Installer to installer during the installation of a cluster | 9100 | HTTP, not encrypted | Morph exposes no setting. Install over a private network. | | Monitoring system to the metrics collector | 5100 | HTTP, not encrypted | Morph exposes no setting. Restrict the port to the monitoring system. | | Console to an identity provider | provider's | As given by the provider URLs | Use `https://` URLs in the provider configuration. See [Set up single sign-on](set-up-single-sign-on.md). | ### 1. Enable TLS between storage nodes The scheme of the advertised storage node addresses selects the mode of the public gRPC listener: `grpc://` for plaintext, `grpcs://` for TLS. All addresses of one node must use the same scheme. 1. Give the addresses with `grpcs://` in the installation request: in `sn_addresses` of `POST /api/v1/start-node` for a cluster-type node, or in `addresses` of `POST /api/v1/new-sn` for a storage-type node. The complete requests are in [Enable TLS](../deploy/enable-tls.md). 2. Check that the cluster needs no gateway-type nodes. A gateway-type node does not start against storage nodes that were installed with `grpcs://`; see [Enable TLS](../deploy/enable-tls.md#limits). With TLS enabled: - The storage node generates a self-signed certificate from its node key. You do not supply a certificate or a certificate authority. - Storage nodes present these certificates to each other, and each node verifies the certificate of its peer against the peer's node key. - The storage node opens a second, plaintext listener on `127.0.0.1:8084` for the console and the S3 gateway in the same container. ### 2. Terminate TLS for S3 and the console Morph serves S3 on port 9080 and the console on port 9100 as plain HTTP. To offer HTTPS: 1. Put a reverse proxy or load balancer that terminates TLS in front of ports 9080 and 9100. See [Put a load balancer in front](../deploy/put-a-load-balancer-in-front.md). 2. Keep the link between the proxy and the Morph node on a trusted network, or run the proxy on the Morph host. 3. Do not publish ports 9080 and 9100 beyond the proxy. Although the underlying S3 gateway supports TLS (`server[].tls.enabled`, `cert_file`, `key_file`), Morph writes the gateway configuration with `tls.enabled: false`, manages the file, and does not support manual edits to `server[].tls`. [Enable TLS](../deploy/enable-tls.md) describes how to encrypt this traffic with a load balancer. ## Encryption at rest | Layer | What Morph provides | |---|---| | Object data and metadata on the drives | The storage node does not encrypt what it writes. Encryption of the drives or file systems below Morph is the operator's choice; Morph needs no configuration for it. | | S3 server-side encryption with customer keys (SSE-C) | Supported by the S3 gateway, with a condition. See below. | | S3 server-side encryption with managed keys (SSE-S3, SSE-KMS) | Not provided. `PutBucketEncryption`, `GetBucketEncryption` and `DeleteBucketEncryption` answer with HTTP status 501. Morph has no integration with a key management service. | | Objects written through the console REST API | No encryption option. | | FS chain data on the inner ring nodes | Not encrypted. | | User keys | Each user's private key is stored on the FS chain encrypted with the user's password (NEP-2). | | API tokens and S3 credentials | Stored as objects whose secret content is encrypted for the keys of the registered gateways. | | Wallet files of the node, the inner ring and the gateway | Encrypted with the wallet passwords. See [Where the keys are kept](#where-the-keys-are-kept). | Client-side encryption works with Morph as with any S3 store: the client encrypts before it uploads, and Morph stores the result unchanged. ### SSE-C With SSE-C the client sends an encryption key with each request. The gateway encrypts the object with AES-256-GCM before it stores it and decrypts it on the way out. The gateway does not store the key. It stores a salted HMAC of the key to recognize a wrong key. | Header | Value | |---|---| | `x-amz-server-side-encryption-customer-algorithm` | `AES256` | | `x-amz-server-side-encryption-customer-key` | The 32-byte key, base64-encoded | | `x-amz-server-side-encryption-customer-key-MD5` | The MD5 digest of the key, base64-encoded | Conditions and limits: - The gateway accepts SSE-C only on a request that reaches it over TLS on its own listener. TLS that ends at a proxy in front of the gateway does not count. With the gateway configuration that Morph generates, the gateway rejects requests that carry the SSE-C headers with HTTP status 500 and the S3 error `InternalError`. - An object can be read only with the key it was written with. Morph cannot recover an object whose key is lost. - The key passes through the gateway in memory on every request. SSE-C protects the data on the storage nodes and drives, not against the gateway host. ## Where the keys are kept Morph keeps its service keys in wallet files in the local state directory of the Morph container. Mount this directory from the host so that it survives the container. | Key | File in `/morph/local_state/config/` | Password variable | Default in the image | Present on | |---|---|---|---|---| | Inner ring node key | `wallet-ir.json`, and `az.json` for cluster administration | `MORPH_IR_WALLET_PASS` | `one` | cluster-type nodes | | Storage node key | `wallet-sn.json` | `MORPH_SN_WALLET_PASS` | `second` | cluster-type and storage-type nodes | | Gateway key, used by the console and the S3 gateway | `wallet-gateway.json` | `MORPH_GATEWAY_WALLET_PASS` | `gatewaypassword` | all nodes | Facts to plan with: - The wallets are created at the first start of the container, encrypted with the passwords that the variables hold at that moment. - Morph reads the variables again at every start. Pass the same values every time. - The generated configuration files in the same directory contain the wallet passwords in clear text, so that the services can open their wallets. Files and wallets have the mode `0640`. Whoever can read the directory can use the keys. - Morph has no integration with a hardware security module or a key management service. - Losing a wallet means losing the identity of that node. Back up the local state directory. See [Back up and restore](../operate/back-up-and-restore.md). ### 3. Set your own wallet passwords Set the three variables when you create the container, before the node is installed. ```shell docker run -d --restart unless-stopped \ -e MORPH_IR_WALLET_PASS="$IR_WALLET_PASS" \ -e MORPH_SN_WALLET_PASS="$SN_WALLET_PASS" \ -e MORPH_GATEWAY_WALLET_PASS="$GATEWAY_WALLET_PASS" \ -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 5100:5100 -p 9080:9080 \ -p 20334:20334 -p 21334:21334 \ -v /mnt/local_state:/morph/local_state \ --name morphcluster morphbits/morph:latest ``` Here `IR_WALLET_PASS`, `SN_WALLET_PASS` and `GATEWAY_WALLET_PASS` are shell variables that hold your passwords. Add the volume options for your drives as described in [Configure drives and shards](../deploy/configure-drives.md). Then protect what holds the passwords and the keys: 1. Restrict the local state directory on the host to the account that runs the container. 2. Restrict who can read the container definition and the container log. 3. Encrypt the backups of the local state directory. ## Check the result List the storage nodes and look at the scheme of their addresses. A node with TLS shows `grpcs://` endpoints: ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq ``` Through the proxy, request the console and the S3 endpoint with `https://` and confirm that the plain ports are not reachable from the client network. ## Related - [Enable TLS](../deploy/enable-tls.md) - [Harden a deployment](harden-a-deployment.md) - [Environment variables](../../reference/configuration/environment-variables.md) - [S3 gateway settings](../../reference/configuration/s3-gateway.md) - [S3 compatibility](../../reference/s3-compatibility.md) - [Security model](../../explanation/security-model.md) --- # Harden a deployment This guide takes a Morph deployment from the defaults of the image to a locked-down configuration. Each step names a control that exists in Morph, the reason for it, and a way to verify it. ## Before you start - Read the [security model](../../explanation/security-model.md). It explains which key can do what. - Plan steps 1 to 3 before the first start of the Morph container. They cannot be applied to a node that is already installed. - A firewall on each host, or network policies in front of the hosts, under your control. - For the checks: `curl`, `jq`, and a token of a global administrator. ```shell export MORPH_URL=http://localhost:9100 export TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"login": "first-admin", "password": "CreateYourOwnPassword"}' | jq -r .token) ``` ## Before installation ### 1. Set your own wallet passwords **Do:** Pass `MORPH_IR_WALLET_PASS`, `MORPH_SN_WALLET_PASS` and `MORPH_GATEWAY_WALLET_PASS` with your own values when you create the container, and pass the same values at every later start. See [Encrypt data](encrypt-data.md#3-set-your-own-wallet-passwords). **Why:** The image carries default values for these variables (`one`, `second`, `gatewaypassword`). The wallets of the node are created at the first start and encrypted with the values set at that moment. **Verify:** The container definition shows your values for the three variables, not the defaults listed in [Environment variables](../../reference/configuration/environment-variables.md). ### 2. Keep port 9100 closed to others until the node is set up **Do:** Until the node reports `MORPH CONTAINER STARTED` and the first administrator is registered, allow access to port 9100 only from the host you install from and, for a multi-node inner ring, from the other Morph nodes named in `installers_addresses`. **Why:** Before installation, port 9100 serves the installer API. It accepts requests without authentication, among them `POST /api/v1/start-node`, `POST /api/v1/new-sn` and `POST /api/v1/new-gateway`, which decide the role and the peers of the node. After installation, the console accepts the registration of the first administrator without authentication until one exists. **Verify:** After the first administrator is registered, a registration without a token is refused: ```shell curl -i -X POST "$MORPH_URL/api/v1/users" \ -H "Content-Type: application/json;charset=UTF-8" \ -d '{"name": "probe", "role": "user", "password": "probe"}' ``` The response is `401 Unauthorized` with the body `Bearer token is required.` The probe asks for the role `user`, so it creates nothing when no administrator exists yet: the response is then `400 Bad Request` with the body `User role is incorrect.` ### 3. Decide on TLS for the storage nodes **Do:** Advertise the storage node addresses with `grpcs://` in the installation request, unless the cluster needs gateway-type nodes: those do not start against storage nodes installed with TLS. See [Enable TLS](../deploy/enable-tls.md). **Why:** With `grpc://`, the traffic between storage nodes is not encrypted. The scheme is fixed by the installation request. **Verify:** The storage node list shows `grpcs://` endpoints: ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq ``` ## Network ### 4. Publish only the ports that need to be reached **Do:** Open each port only to the peers in the table. The full list is in [Ports and protocols](../../reference/ports-and-protocols.md). | Port | Service | Who needs to reach it | |---|---|---| | 9080 | S3 gateway | S3 clients, or only the TLS proxy in front | | 9100 | Console UI and REST API | Users and API clients, or only the TLS proxy in front | | 8080 | Storage node gRPC | The other Morph nodes | | 20333 | Inner ring consensus | The other inner ring nodes | | 20334 | Metadata chain of the inner ring | The other Morph nodes | | 21334 | Metadata chain of the storage node | The other Morph nodes | | 30333 | FS chain RPC | The other Morph nodes. Not users, not S3 clients. | | 5100 | Metrics collector | The monitoring system | | 16513 | Storage node control | Nobody. It listens on the loopback interface of the container. | | 16512 | Inner ring control | Nobody. Do not publish it. | | 8999, 8085 | Profiling (pprof) of the console and the S3 gateway | Nobody. They listen on the loopback interface of the container. | **Why:** - Port 30333 gives read access to everything the FS chain records: users with their password-encrypted keys, buckets, access rules, and the single sign-on provider records including the OAuth client secrets. - Port 5100 serves the metrics without authentication. - The storage node control service accepts only requests signed with the key of the node. The control service of the inner ring accepts requests signed with the key of the inner ring node itself; the generated configuration authorizes no further key. - The console and the S3 gateway run with profiling enabled on a loopback address. The storage node and the inner ring run with profiling disabled. The installation offers no switch for it. **Verify:** From a host outside the allowed peers, connections to 8080, 20333, 30333 and 5100 are refused or time out. The container has no port mapping for 16513, 16512, 8999 and 8085. ### 5. Put TLS in front of S3 and the console **Do:** Terminate TLS on a proxy or load balancer in front of ports 9080 and 9100. See [Encrypt data](encrypt-data.md#2-terminate-tls-for-s3-and-the-console). **Why:** Both ports serve plain HTTP. Console tokens, S3 signatures, passwords at login and object data cross them. **Verify:** Clients reach the console and S3 only by `https://`. ### 6. Limit login attempts at the proxy **Do:** Configure a request rate limit for `POST /api/v1/login` on the proxy in front of the console. **Why:** The console does not limit failed logins and does not lock accounts. **Verify:** The proxy rejects a burst of login requests from one address. ## Host and container ### 7. Protect the local state directory **Do:** Mount `/morph/local_state` from a host directory that only the account running the container can read. Encrypt its backups. **Why:** The directory holds the wallets of the node and the generated configuration files, which contain the wallet passwords in clear text. Whoever reads it can act as this node, and with the gateway wallet can open the API tokens and S3 credentials that users have issued. **Verify:** The host directory is not readable by other accounts. ### 8. Restrict access to the container log **Do:** Limit who can read the container log and where it is shipped. **Why:** At start, the log includes the values of the `MORPH_*` variables, the wallet passwords among them. The console log also contains user names, bucket names and object names. **Verify:** Only operators can read the log on the host and in your log system. ### 9. Run the container with a read-only root file system **Do:** Start the container with `--read-only`. Give every path in the installer configuration explicitly, mount each of them, and mount a directory for `/morph/local_state`: ```shell docker run -d --restart unless-stopped --read-only \ -p 9100:9100 -p 8080:8080 -p 30333:30333 -p 20333:20333 -p 5100:5100 -p 9080:9080 \ -p 20334:20334 -p 21334:21334 \ -v /mnt/local_state:/morph/local_state \ -v ./custom-installer.config.yaml:/morph/config/installer.config.yaml \ -v /mnt/sdb:/data/sdb -v /mnt/sdc:/data/sdc -v /mnt/meta:/data/meta \ --name morphcluster morphbits/morph:latest ``` See [Installer configuration](../../reference/configuration/installer.md) for the file. **Why:** Nothing can then be written into the image at run time. All state is in the volumes you mounted. **Verify:** The container reaches `MORPH CONTAINER STARTED` after installation. ### 10. Encrypt the drives if you need encryption at rest **Do:** Use the disk or file-system encryption of the host for the data and metadata drives. **Why:** The storage node does not encrypt what it stores. See [Encrypt data](encrypt-data.md#encryption-at-rest). **Verify:** The mounted data paths are on encrypted volumes. ## Accounts, tokens and access rules ### 11. Keep administrators few and passwords strong **Do:** Give the role `admin` only to the people who operate the cluster. Use a second global administrator account for recovery. Use long random passwords. **Why:** Morph enforces no password rule. A global administrator can create and remove users, set any user's password, admit and decommission nodes, and manage all namespaces. Morph refuses to remove or demote the only global administrator, and has no other way to regain administrator access when its password is lost. **Verify:** List the users and check the roles: ```shell curl -s "$MORPH_URL/api/v1/users" -H "Authorization: Bearer $TOKEN" | jq ``` ### 12. Use namespace administrators for tenants **Do:** Create a namespace per tenant and give tenants the role `admin` only in their own namespace. See [Use namespaces](../buckets-and-objects/use-namespaces.md). **Why:** A namespace administrator cannot reach users, buckets or settings outside its namespace, and cannot change system storage policies, nodes or the license. **Verify:** A request of the namespace administrator with the header `X-Morph-Namespace` of another namespace returns `403 Forbidden`. ### 13. Issue tokens and S3 credentials with the least permissions **Do:** - Give scripts a personal access token, not a session token. Switch off every flag the script does not need, set `bucketName` when it works in one bucket, and set a short `ttl`. At least one object or bucket flag must stay on. See [Manage API tokens](manage-api-tokens.md). - Leave `createBearerToken` and `s3CreateToken` off unless the script must issue credentials. - Give each script its own user without the role `admin` where possible. The flags do not cover every endpoint of the API. - Issue S3 credentials per application, read-only where possible (`"modify": false`), bound to a bucket where possible, with a `ttl` that matches your rotation period. See [Manage S3 credentials](manage-s3-credentials.md). - Revoke tokens and credentials that are no longer used. **Why:** A session token carries every permission of the user's role. A personal access token created with the defaults allows the object and bucket operations of the user for 30 days. **Verify:** List the tokens of each user, then read the properties of each token as described in [Manage API tokens](manage-api-tokens.md#list-tokens): ```shell curl -s "$MORPH_URL/api/v1/users/first-admin/tokens?type=pat" \ -H "Authorization: Bearer $TOKEN" | jq ``` ### 14. Keep buckets private unless they must be public **Do:** Create buckets without access for `others`, and grant access with access rules or access tokens for sharing. See [Control access to a bucket](../buckets-and-objects/control-access.md) and [Share objects with tokens](../buckets-and-objects/share-objects.md). **Why:** Objects in a bucket that allows `others` to read can be fetched without any token, through the console API and through S3. **Verify:** A download without a token is refused: ```shell curl -i "$MORPH_URL/api/v1/buckets/my-bucket/objects/my-object" ``` ### 15. Restrict single sign-on to your domains **Do:** Set `domains` on every OAuth and SAML provider. See [Set up single sign-on](set-up-single-sign-on.md). **Why:** With an empty list, every account of the identity provider can sign in and becomes a Morph user. **Verify:** Read each provider as an administrator and check `domains`. ## Monitoring ### 16. Collect the logs **Do:** Ship the container log to your log system. See [Read logs](../observe/read-logs.md). **Why:** Morph has no separate audit log and no log of S3 or REST data access per user. The console application log is the record there is: it notes failed logins with the login name, requests denied for insufficient rights, and token revocations, at the level `info`. **Verify:** A failed login appears in your log system with the message `invalid password` or `nonexistent user`. ## Check the result Walk through this list after every change of the deployment: 1. Registration without a token returns `401` (step 2). 2. From outside the allowed peers, only the TLS endpoints of S3 and the console answer (steps 4 and 5). 3. The storage nodes list `grpcs://` endpoints, if you chose TLS (step 3). 4. No administrator accounts exist that you do not know (step 11). 5. No token or S3 credential exists without an owner who still needs it (step 13). ## Related - [Encrypt data](encrypt-data.md) - [Manage users and roles](manage-users-and-roles.md) - [Ports and protocols](../../reference/ports-and-protocols.md) - [Environment variables](../../reference/configuration/environment-variables.md) - [Security model](../../explanation/security-model.md) --- # Collect metrics This guide shows how to scrape the metrics of a Morph node with Prometheus. Each Morph container serves one metrics endpoint, the collector. On every request the collector reads the Prometheus endpoint of each process in the container (inner ring, storage node, console, S3 gateway, depending on the installation type) and returns the combined result. You scrape one endpoint per Morph node. Morph ships no Prometheus server. You run your own. ## Before you start - A running Morph node. See [Install a cluster](../deploy/install-a-cluster.md). - A Prometheus server that can reach port 5100 of every Morph node. - The collector port published by the Morph container. The examples use these variables: ```shell export MORPH_METRICS_URL=http://localhost:5100 # collector of one Morph node export MORPH_CONTAINER=morphcluster # name of the Morph container on that host ``` ## Steps 1. Publish the collector port when you start the Morph container. The collector listens on port 5100 on all interfaces of the container. To use another port, set `MORPH_PORT_PROMETHEUS_COLLECTOR` and publish that port: ```shell docker run -e MORPH_PORT_PROMETHEUS_COLLECTOR=5200 -p 5200:5200 ... morphbits/morph:latest ``` The collector serves plain HTTP without authentication. Allow only your monitoring system to reach the port. 2. Request the endpoint once to see that it answers: ```shell curl -s "$MORPH_METRICS_URL/metrics" | grep '_state_health 2' ``` On a healthy cluster-type node the output contains these three lines, in any order: ```text neofs_ir_state_health 2 neofs_node_state_health 2 neofs_s3_gw_state_health 2 ``` A storage-type node has no `neofs_ir_state_health`. A gateway-type node has only `neofs_s3_gw_state_health`. 3. Add a scrape job to the Prometheus configuration, with one target per Morph node. The path is `/metrics`. Name the job `morph` if you plan to use the [example alerting rules](set-up-alerts.md), which select `up{job="morph"}`. ```yaml scrape_configs: - job_name: morph metrics_path: /metrics static_configs: - targets: - morph-node-1.example.com:5100 - morph-node-2.example.com:5100 - morph-node-3.example.com:5100 - morph-node-4.example.com:5100 ``` 4. Reload Prometheus. ## Check the result Run this query in Prometheus: ```text up{job="morph"} ``` Every Morph node shows the value 1. Then query `neofs_node_state_health`: every node that runs a storage node shows 2. ## What the collector returns - The collector does not rename metrics. Metric names keep the prefixes of the components: `neofs_node_` (storage node), `neofs_ir_` (inner ring), `neofs_s3_` (S3 gateway), `morph_console_` (console), `neogo_` (chain). - Metrics that every Go process has under the same name (`go_*`, `process_*`, `promhttp_*`) get a `process` label: `ir`, `neofs`, `morph` or `s3`. - The storage node also exposes `neogo_*` metrics, for its metadata chain. They carry `process="neofs"`. The `neogo_*` series without a `process` label come from the inner ring. - The collector gives each process 1 second to answer. A process that does not answer is missing from that response, and the response still has status 200. A scrape that succeeds therefore does not prove that every component answered. The example alerting rules include rules for missing series. The full list is in the [metrics reference](../../reference/metrics.md). ## Endpoints of the components Each component has its own Prometheus endpoint and an optional pprof endpoint for Go profiling. Morph generates the component configurations with these settings: | Component | Configuration file in the container | `prometheus` | `pprof` | |---|---|---|---| | Storage node | `/morph/local_state/config/config-sn.yaml` | enabled, `localhost:6664` | disabled, `localhost:6663` | | Inner ring | `/morph/local_state/config/config-ir.yaml` | enabled, `localhost:9090` | disabled, `:6060` | | S3 gateway | `/morph/local_state/config/config-s3.yaml` | enabled, `localhost:8086` | enabled, `localhost:8085` | | Console | `/morph/local_state/config/config.yaml` | enabled, `localhost:8989` | enabled, `localhost:8999` | The endpoints listen on `localhost` inside the container, so you cannot scrape them from outside. To read one directly, run the request inside the container. Use the address `127.0.0.1`: the endpoints listen on IPv4 only, and `wget` in the image resolves `localhost` to the IPv6 address first. ```shell docker exec "$MORPH_CONTAINER" wget -qO- http://127.0.0.1:6664/metrics ``` ## Switch an endpoint on or off :::warning The component configuration files are managed by Morph. Manual edits are not supported and can break on upgrades. Morph currently exposes no setting of its own for `pprof`; change these files only on advice from Morph support, at your own risk. ::: Every component configuration has a `prometheus` and a `pprof` section of the same form: ```yaml prometheus: enabled: true address: localhost:8989 ``` 1. Edit the section in the configuration file of the component (see the table above). 2. Restart the Morph container. The inner ring's generated `pprof` address is `:6060`, which listens on all interfaces once you enable it. :::warning Leave `prometheus` enabled, with its generated address, for the storage node, the inner ring and the S3 gateway. The Morph entrypoint starts these processes by waiting for `neofs_node_state_health 2`, `neofs_ir_state_health 2` and `neofs_s3_gw_state_health 2` on these endpoints, and then checks the same lines every 10 seconds. Without them the container does not finish its start, or stops after `MORPH_HEALTHCHECK_ERROR_LIMIT` failed checks. ::: The console's `prometheus` endpoint is not part of these checks. If you disable it, the `morph_console_*` metrics disappear from the collector. ## Related - [Metrics reference](../../reference/metrics.md) - [Set up alerts](set-up-alerts.md) - [Build a dashboard](build-a-dashboard.md) - [Check cluster health](check-cluster-health.md) - [Ports and protocols](../../reference/ports-and-protocols.md) - [Environment variables](../../reference/configuration/environment-variables.md) --- # Set up alerts This guide shows how to load the example alerting rules for Morph into Prometheus and how to react to each alert. The rules file is an example to start from: [morph-alerts.yml](pathname:///files/morph-alerts.yml). It uses only metrics from the [metrics reference](../../reference/metrics.md). Every rule carries a comment that says what it detects and where its threshold comes from. Morph ships no Alertmanager and sends no notifications itself. ## Before you start - Prometheus scrapes every Morph node. See [Collect metrics](collect-metrics.md). - The scrape job is named `morph`. Otherwise change `job="morph"` in the rules file. - An Alertmanager, or another receiver, is connected to Prometheus if you want notifications. - Your epoch duration. The epoch rules assume the default of 3600 seconds. If your cluster uses another duration, change the `2h` windows to twice your epoch duration. The examples use this variable: ```shell export MORPH_DOCS_URL=https://docs.morphbits.io # where you read this documentation ``` ## Steps 1. Download the rules file to the host that runs Prometheus: ```shell curl -fsSLO "$MORPH_DOCS_URL/files/morph-alerts.yml" ``` 2. Set the write-cache size. The rule `MorphWriteCacheFilling` compares the write-cache with 1073741824 bytes (1GB, the size in the sample installer configuration). Replace the number with the size that you set in `sn.shards[].writecache.size`. If your shards have no write-cache, the rule never fires and you can delete it. 3. Check the file with `promtool`, which comes with Prometheus: ```shell promtool check rules morph-alerts.yml ``` 4. Reference the file in the Prometheus configuration: ```yaml rule_files: - morph-alerts.yml ``` 5. Reload Prometheus. ## Check the result Open the **Alerts** page of Prometheus. It lists four groups: `morph-availability`, `morph-chain`, `morph-storage` and `morph-requests`. On a healthy cluster every rule is inactive, except `MorphPolicerReplicating` while the policer copies data. ## Thresholds - **State rules** compare a gauge with a value that the software defines, for example `neofs_node_state_health != 2`. They are exact. - **Ratio rules** use a value chosen for a first setup: 0.8 for space and write-cache, 0.05 for error ratios. They are starting points. Adjust them to your workload. ## What each alert means and what to do first ### Availability | Alert | Meaning | First action | |---|---|---| | `MorphNodeNotScraped` | Prometheus cannot read the collector of a Morph node. The Morph container is stopped or restarting, or port 5100 is unreachable. | Look at the state of the container and its last log lines. See [Read logs](read-logs.md) and [Handle a node failure](../operate/handle-a-node-failure.md). | | `MorphStorageNodeNotReady` | `neofs_node_state_health` is not 2 (READY). The storage node is starting, shutting down, or in an undefined state. | Read the storage node's log lines. If the node does not come back, see [Handle a node failure](../operate/handle-a-node-failure.md). | | `MorphInnerRingNotReady` | `neofs_ir_state_health` is not 2 (READY). | Read the inner ring's log lines and check how many inner ring nodes are still ready. Below quorum the FS chain stops. See [Inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md). | | `MorphS3GatewayNotReady` | `neofs_s3_gw_state_health` is not 2. The S3 gateway has no healthy connection to a storage node. | Check the storage node on the same Morph node first: the gateway uses it by default. On a gateway-type node, which has no storage node, check the storage nodes it was given at installation. | | `MorphConsoleNotUp` | `morph_console_up` is not 1. The console has not finished its startup. | Read the console's log lines. See [Diagnose common problems](../troubleshoot/diagnose-common-problems.md). | | `MorphS3GatewayMetricsMissing`, `MorphConsoleMetricsMissing`, `MorphStorageNodeMetricsMissing`, `MorphInnerRingMetricsMissing` | The collector answers, and the metrics of one process are missing. The process did not answer the collector within 1 second, or its Prometheus endpoint is disabled. | Look for `worker error` in the entrypoint's log lines. See [Read logs](read-logs.md). | ### Chain | Alert | Meaning | First action | |---|---|---| | `MorphChainNotAdvancing` | The block height of an inner ring node has not changed for 5 minutes. The chain produces a block at least every 20 seconds, so it stands still. Without blocks there are no new buckets, no access-rule changes, no epoch ticks and no membership changes. Data already on the chain can still be read. | Count the inner ring nodes that are ready. With 4 nodes the chain needs 3, with 7 it needs 5. Bring failed inner ring nodes back. See [Recover from a site failure](../operate/recover-from-a-site-failure.md). | | `MorphEpochNotAdvancing` | The epoch is the same as 2 hours ago. Storage nodes cannot renew their place in the network map, and the network map does not change. | Check `MorphChainNotAdvancing` and `MorphInnerRingNotReady` first. A standing chain is the usual cause. | | `MorphStorageNodeEpochBehind` | A storage node works with an older epoch than the inner ring. It does not follow the FS chain. | Check that the node reaches the chain RPC port of the inner ring nodes (see [Ports and protocols](../../reference/ports-and-protocols.md)), then read the storage node's log lines. | `MorphChainNotAdvancing` has a limit: the inner ring writes the same height gauge for the FS chain and for its metadata chain. The rule fires only when the gauge does not change at all. ### Storage | Alert | Meaning | First action | |---|---|---| | `MorphRedundancyShortage` | The policer of a storage node found objects with too few replicas or with missing parts, and has not finished a clean pass since. The policer is already restoring them. | Find the cause: a storage node that left the network map, or a shard that is not in read-write mode. See [Handle a node failure](../operate/handle-a-node-failure.md) and [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md). | | `MorphPolicerReplicating` | The policer has been copying objects or parts to other nodes for more than 10 minutes. This is repair after a failure, or movement of data after the network map changed. Informational. | No action if you added, removed or repaired a node. Otherwise treat it like `MorphRedundancyShortage`. | | `MorphShardNotReadWrite` | A shard is in a mode other than read-write. In `read-only` and `degraded-read-only` mode the storage node does not write to it. | If you did not set the mode yourself, treat the drive as failed. See [Replace a failed drive](../operate/replace-a-failed-drive.md). | | `MorphShardSpaceLow` | The objects in a shard use more than 80 % of the size of its file system. The ratio is an estimate. | Check the free space on the drive. Plan more capacity. See [Add storage nodes](../operate/add-storage-nodes.md) and [Size a cluster](../deploy/size-a-cluster.md). | | `MorphWriteCacheFilling` | The write-cache of a shard has stayed above 80 % of its configured size for 15 minutes. When it is full, the storage node writes new objects directly to the object store of the shard. | Check the drive behind the shard: the write-cache empties into it. See [Configure drives and shards](../deploy/configure-drives.md). | ### Requests | Alert | Meaning | First action | |---|---|---| | `MorphS3ErrorRatioHigh` | More than 5 % of the S3 requests on a node ended with a status outside 200 to 299. Client errors count, for example requests for keys that do not exist. | Find the failing operations and statuses in the S3 gateway's log lines. See [Errors and status codes](../../reference/errors.md). | | `MorphS3BackendErrors` | Calls from the S3 gateway to a storage node fail. | Check the storage node named in the `endpoint` label. | | `MorphObjectPutFailureRatioHigh` | More than 5 % of the object PUT requests on a storage node failed. | Read the storage node's log lines. Check the shard modes and the network map: a storage policy that the current network map cannot satisfy makes every write to its buckets fail. | | `MorphObjectGetFailureRatioHigh` | More than 5 % of the object GET requests on a storage node failed. Requests for objects that do not exist count as failures. | Read the storage node's log lines. See [Diagnose common problems](../troubleshoot/diagnose-common-problems.md). | ## What the rules do not cover The bundled versions expose no metric for the following. Check them with the console API or `neofs-cli`, as described in [Check cluster health](check-cluster-health.md). - Whether a storage node is in the network map, and its state there (online, offline, maintenance). - The error counter of a shard, and which mode a shard is in. The metric `neofs_node_object_readonly` only tells read-write from every other mode. - Free space on a drive. The storage node reports the size of the file system and the size of the stored objects. A storage node that stops sending heartbeats leaves the network map after more than 3 epochs. No alert in the file fires for that event itself. `MorphNodeNotScraped` and `MorphStorageNodeNotReady` fire for its usual causes. ## Related - [Metrics reference](../../reference/metrics.md) - [Collect metrics](collect-metrics.md) - [Check cluster health](check-cluster-health.md) - [Build a dashboard](build-a-dashboard.md) --- # Build a dashboard This guide shows how to import the example Grafana dashboard for Morph and how to read its panels. Morph ships no Grafana and no built-in dashboard. The file [morph-dashboard.json](pathname:///files/morph-dashboard.json) is an example to start from. It uses only metrics from the [metrics reference](../../reference/metrics.md). ## Before you start - Prometheus scrapes every Morph node. See [Collect metrics](collect-metrics.md). - A Grafana server with that Prometheus as a data source. The examples use this variable: ```shell export MORPH_DOCS_URL=https://docs.morphbits.io # where you read this documentation ``` ## Steps 1. Download the dashboard file: ```shell curl -fsSLO "$MORPH_DOCS_URL/files/morph-dashboard.json" ``` 2. In Grafana, open **Dashboards**, choose **New**, then **Import**. 3. Upload `morph-dashboard.json` and select **Import**. 4. At the top of the dashboard, choose your Prometheus in **Data source**. 5. Choose the Morph nodes to show in **Node**. The list holds every `instance` that reports `morph_console_up`. **All** is the default. ## Check the result The **Process health** panel shows one tile per process and node, and every tile reads **ready**. The **Epoch** panel shows one line that steps up once per epoch. ## What each panel shows ### Health | Panel | Shows | Metrics | |---|---|---| | Process health | The state of the storage node, the inner ring and the S3 gateway on each node: ready (2), starting (1), shutting down (3, storage node and inner ring), initializing network (4, inner ring only), undefined or unhealthy (0). The S3 gateway reports 0, 1 or 2 only. | `neofs_node_state_health`, `neofs_ir_state_health`, `neofs_s3_gw_state_health` | | Console up | Whether the console on each node has started. | `morph_console_up` | ### Epoch and chain | Panel | Shows | Metrics | |---|---|---| | Epoch | The current epoch as each inner ring and each storage node sees it. The lines lie on top of each other and step up once per epoch. A line that stays below the others is a node that does not follow the chain. | `neofs_ir_state_epoch`, `neofs_node_state_epoch` | | Chain height | The block height that each inner ring reports. A flat line means that the chain produces no blocks. The inner ring writes this gauge for the FS chain and for its metadata chain, so the line can alternate between two heights. | `neogo_block_height` without a `process` label | No panel shows the network map: the bundled versions expose no metric for the number of nodes in it or for the state of a node. See [Check cluster health](check-cluster-health.md). ### Capacity and objects | Panel | Shows | Metrics | |---|---|---| | Stored object size and file system size per node | Two lines per node: the size of the stored objects, and the size of the file systems that hold the object data. Shards on one file system each report its full size, so the second line counts that file system more than once. | `neofs_node_engine_payload_size`, `neofs_node_engine_capacity` | | Share of the file system used per shard | The first value divided by the second, for each shard. | the same | | Object counts | The object counters of the shards, summed over the selected nodes, by counter type: `phy`, `root`, `ts`, `lock`, `link`, `gc`. | `neofs_node_object_counter` | | Write-cache size per shard | The bytes in the write-cache of each shard. A shard without a write-cache has no line. | `neofs_node_writecache_size` | ### Storage node requests | Panel | Shows | Metrics | |---|---|---| | Object request rate | Object requests per second that the storage nodes served, by operation: put, get, head, search, delete. | `neofs_node_object__req_count` | | Failed object requests | Requests per second that ended with an error. | `neofs_node_object__req_count` minus `neofs_node_object__req_count_success` | | Object request duration, 95th percentile | The handling time of object requests in seconds, by operation. | `neofs_node_object_rpc__time` | ### S3 gateway requests | Panel | Shows | Metrics | |---|---|---| | S3 request rate by operation | S3 requests per second, by the `api` label. | `neofs_s3_requests_total` | | S3 error ratio | The share of S3 responses with a status outside 200 to 299, per node. Client errors count. | `neofs_s3_errors_total`, `neofs_s3_requests_total` | | S3 request duration by operation, 95th percentile | The handling time of S3 requests in seconds. | `neofs_s3_request_seconds` | ### Policer and shards | Panel | Shows | Metrics | |---|---|---| | Policer activity | Objects per second that the policer checked (`processed`), copied to other nodes (`replicated`), removed as surplus (`deleted`) or moved between local shards (`relocated`). | `neofs_node_state_policer_object_count` | | Policer state | Two tiles per node. **redundancy** reads **ok** after a full pass without missing replicas or parts. **placement** reads **ok** after a full pass in which every replica was on the nodes that rank for it. It does not follow erasure-coded parts; for those see [Watch the progress](../operate/add-storage-nodes.md#watch-the-progress). Both read **shortage or unknown** from the start of the storage node until its first pass ends. | `neofs_node_state_policer_consistency_state`, `neofs_node_state_policer_optimal_placement` | | Shard modes | One tile per shard: **read-write**, or **not read-write** for every other mode. | `neofs_node_object_readonly` | No panel shows the error counter of a shard: the storage node exposes no metric for it. `neofs-cli control shards list` prints it. ## Change the dashboard The dashboard is editable. The percentile panels use `histogram_quantile` over the histogram buckets, so their precision is limited by the bucket boundaries of the metric. For the full list of metrics that you can add, see the [metrics reference](../../reference/metrics.md). ## Related - [Collect metrics](collect-metrics.md) - [Set up alerts](set-up-alerts.md) - [Metrics reference](../../reference/metrics.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) --- # Read logs This guide shows where a Morph node writes its logs and which messages to look for. All processes in the Morph container write to the container's standard output and standard error: the entrypoint, the installer, the inner ring, the storage node, the console and the S3 gateway. Morph writes no log files. Retention and rotation are those of your Docker logging driver. The bundled versions have no request tracing and no separate audit log. The logs described here are the only record of what the processes did. ## Before you start - Shell access to the host that runs the Morph container. - The name of the Morph container. The examples use this variable: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container ``` ## Steps 1. Follow the log of the container: ```shell docker logs -f "$MORPH_CONTAINER" ``` 2. Add timestamps. The storage node, the inner ring and the S3 gateway print timestamps only when they run with a terminal, so their lines in the container log have none. Let Docker add the time at which it received each line: ```shell docker logs -t --since 1h "$MORPH_CONTAINER" ``` 3. Tell the processes apart by the format of the line (see the table below). Lines in JSON come from the entrypoint and the console. The other lines come from the storage node, the inner ring and the S3 gateway. 4. Search for a message from the tables below. For example, to see what the policer did: ```shell docker logs "$MORPH_CONTAINER" 2>&1 | grep -e "boost mode" -e "finished local storage cycle" ``` ## Check the result At the end of a start the entrypoint writes `✅ ALL SERVICES STARTED`, `✅ MORPH CONTAINER STARTED` and `Monitoring service health (manager)...`, in this order. This command prints the second line once the start is complete: ```shell docker logs "$MORPH_CONTAINER" 2>&1 | grep "MORPH CONTAINER STARTED" ``` ## Format and level of each component | Process | Format | Level as Morph generates it | Configuration key | |---|---|---|---| | Entrypoint (`morphentry`) | JSON, ISO 8601 time | `info`, fixed | Not configurable | | Console (`morph`) | JSON, ISO 8601 time | `info`, sampling off | `logger.level` in `/morph/local_state/config/config.yaml` | | Storage node (`neofs-node`) | Text (`console` encoding), no timestamp without a terminal | `info` | `logger.level` in `/morph/local_state/config/config-sn.yaml` | | Inner ring (`neofs-ir`) | Text (`console` encoding), no timestamp without a terminal | `info` | `logger.level` in `/morph/local_state/config/config-ir.yaml` | | S3 gateway (`neofs-s3-gw`) | Text (`console` encoding), no timestamp without a terminal | `info` | `logger.level` in `/morph/local_state/config/config-s3.yaml` | The levels are `debug`, `info`, `warn`, `error`, `dpanic`, `panic` and `fatal`. The storage node, the inner ring and the S3 gateway also support `logger.encoding: json` and `logger.timestamp: true`. :::warning Morph manages the component configuration files. Manual edits (such as enabling `debug` logging) are not supported and can break on upgrades. Morph currently exposes no setting of its own for component log levels; change these files only on advice from Morph support during diagnosis, at your own risk. ::: When troubleshooting with Morph support, a change to `logger.level` takes effect after restarting the Morph container. Some messages below are written at `debug` level and appear only when the level is lowered to `debug`. ## Messages of the entrypoint The entrypoint marks the steps of a start with symbols. The text is the `msg` field of the JSON line. | Message | Level | Meaning | |---|---|---| | `⭐ INSTALLER IS STARTING ⭐` | info | First start: the installer runs. | | `✅ INSTALLATION COMPLETE ✅` | info | The installer has written the configuration files. | | `Detected installation` | info | The installation type, in the field `type`: `cluster`, `storage` or `gateway`. | | `⭐ STARTING` | info | The inner ring, the storage node or the S3 gateway is started. The field `bin` names the binary. | | `⭐ Starting morph ⭐` | info | The console is started. | | `💤 Waiting for metric` | info | Repeated every 5 seconds while the process is not ready. The field `want` holds the awaited line, for example `neofs_node_state_health 2`. | | `process exited while waiting, restarting` | warn | The process ended before it became ready. The entrypoint starts it again. | | `✅ READY` | info | The process reports the awaited health value. | | `local SN is not in Netmap` | info | Storage-type node: the storage node is not yet in the network map. Repeated every 10 seconds. An administrator has to grant the node access first; see [Add storage nodes](../operate/add-storage-nodes.md). | | `✅ local SN in Netmap` | info | Storage-type node: the storage node is in the network map. The start continues. | | `✅ ALL SERVICES STARTED` | info | Every process of the installation type is ready. | | `✅ MORPH CONTAINER STARTED` | info | The start is complete. The entrypoint begins its health checks. | | `health probe failed` | warn | A health check of the process in the field `process` failed. `consecutiveFails` counts the failures in a row. | | `health restored` | info | The process passes its health check again. | | `Critical Error: Service unhealthy beyond threshold; Stopping container...` | error | A process failed `MORPH_HEALTHCHECK_ERROR_LIMIT` checks in a row. The entrypoint stops all processes and exits. | | `service unhealthy beyond threshold (continuing)` | error | The same, with `RESTART_IF_ERROR_LIMIT_REACHED=false`: the entrypoint keeps running and counts again. | | `process exited` | error | A process ended on its own. The entrypoint stops the others and exits. | | `Critical Error: Stopping all processes and container...` | error | The entrypoint stops its processes. It writes this line on every stop, also after `docker stop`. | | `Container stopped due to process died or healthcheck triggered` | fatal | The last line when the entrypoint exits because of a failure. | | `worker error` | error | Logger `collector`: a process did not answer the metrics collector. The field `address` names its endpoint. | | `old config preserved` | info | A start after an upgrade changed a configuration file. The field `backup` names the copy of the old file. | When its API accepts requests, the console's web server prints the plain-text line `⇨ http server started on [::]:9100`. It is not a JSON log line. ## Messages of the storage node ### Policer | Message | Level | Meaning | |---|---|---| | `missing replicas detected, entering boost mode` | info | Most of the last 8 batches contained objects with too few replicas or missing parts. The policer now checks larger batches. | | `recovery complete, leaving boost mode` | info | Most of the last 8 batches were clean. The policer returns to its normal batch size. | | `finished local storage cycle` | info | The policer has passed over all local objects once. `cleanShortageCycle` is true when the pass found no missing replicas or parts, `cleanPlacementCycle` when every replica was on the nodes that rank for it. Erasure-coded parts that were moved do not change it. | | `shortage of object copies detected` | debug | One object has fewer replicas than its storage policy requires. The field `shortage` is the number missing. | | `misplaced object copies detected, replicating to primary nodes` | debug | The replicas exist, and some of the nodes that rank first for the object do not hold it. | | `EC part successfully recreated` | info | The policer rebuilt a missing part of an erasure-coded object and stored it. | | `too many EC parts unavailable, recreation is impossible` | warn | The number of unavailable parts of an erasure-coded object, in the field `unavailable`, exceeds what the rule can rebuild. The policer leaves the object as it is in this pass. | | `local replica of the object is redundant in the container, removing...` | info | Enough other nodes hold the object. The policer removes the local surplus replica. | | `node is outside the network map, holding the replica...` | info | This storage node is not in the network map. It keeps its data and removes nothing. | ### Shards | Message | Level | Meaning | |---|---|---| | `setting shard mode` | info | A mode change of a shard begins. | | `shard mode set successfully` | info | The shard is now in the mode named in the field `mode`. | | `shard is moved in degraded mode due to error threshold` | info | The error counter of the shard reached `storage.shard_ro_error_threshold`, and the storage node switched the shard to `degraded-read-only`. The generated configuration does not set the threshold, so this switch does not happen in a standard Morph deployment. | | `shard is moved in read-only mode due to error threshold` | info | The same, when the switch to `degraded-read-only` failed and the shard went to `read-only`. | | `could not get object from shard`, `could not put object to shard`, `could not head object from shard`, `could not select objects from shard`, `meta info was present, but object is missing` | warn | An operation on a shard failed. The fields `shard_id` and `error count` name the shard and its error counter after this failure. A growing counter on one shard points to a failing drive: see [Replace a failed drive](../operate/replace-a-failed-drive.md). | | `shard has been removed` | info | A shard was removed from the storage node. | The error counter of a shard appears only in these lines and in `neofs-cli control shards list`. No metric carries it. ## Related - [Check cluster health](check-cluster-health.md) - [Collect diagnostics](../troubleshoot/collect-diagnostics.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) - [Storage node settings](../../reference/configuration/storage-node.md) - [Failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md) --- # Check cluster health This guide shows the ways to find out whether a Morph node and its cluster are healthy. Each way answers a different question: | Question | Where to look | |---|---| | Do the processes in this container run and answer? | The entrypoint's health checks and the container log | | Is each process ready? | The health gauges on the collector endpoint | | Which storage nodes are in the network map? How full are the drives? | The console API | | Is this storage node online in the network map? What are the modes and error counters of its shards? | `neofs-cli control` | ## Before you start - Shell access to the host that runs the Morph container. - For the console API: an administrator account. The requests need a global administrator session. - For `neofs-cli`: the binary of the bundled storage node version inside the Morph container. The Morph image does not contain it. To copy it in, follow "Before you start" in [Replace a failed drive](../operate/replace-a-failed-drive.md). The examples use these variables: ```shell export MORPH_URL=http://localhost:9100 # console of one Morph node export MORPH_METRICS_URL=http://localhost:5100 # metrics collector of that node export MORPH_PASSWORD='CreateYourOwnPassword' # password of first-admin export MORPH_CONTAINER=morphcluster # name of the Morph container export NEOFS_CLI=/morph/local_state/neofs-cli # path of neofs-cli inside the container export SN_CLI_CONFIG=/morph/local_state/config/cli-config-sn.yaml # generated CLI configuration with the node's wallet ``` ## Steps ### 1. Check the container The entrypoint of the Morph container supervises the processes. The image defines no Docker `HEALTHCHECK`, so `docker ps` shows no health state for the container. The entrypoint checks every process every 10 seconds instead: | Process | Check | |---|---| | Metrics collector | `GET /metrics` on the collector port answers with a status below 400 | | Inner ring (cluster-type) | The collector output contains `neofs_ir_state_health 2` | | `sn-verificator` (cluster-type) | `GET /health` answers with a status below 400 | | Storage node (cluster-type, storage-type) | The collector output contains `neofs_node_state_health 2` | | Console | `HEAD /` on the console port answers with a status below 400 | | S3 gateway | The collector output contains `neofs_s3_gw_state_health 2` | When a process fails `MORPH_HEALTHCHECK_ERROR_LIMIT` checks in a row (3 in the image), the entrypoint stops all processes and exits. It also exits when a process ends on its own. The entrypoint does not restart a failed process. With the restart policy of the installation guide (`--restart unless-stopped`) Docker then starts the container again; without a restart policy it stays stopped. With `RESTART_IF_ERROR_LIMIT_REACHED=false` the entrypoint logs the failure and keeps running. See that the container runs: ```shell docker ps --filter "name=$MORPH_CONTAINER" ``` Look for failed checks in its log: ```shell docker logs --since 1h "$MORPH_CONTAINER" 2>&1 | grep -e "health probe failed" -e "health restored" ``` No output means that every check passed during the last hour. ### 2. Read the health gauges Request the collector and select the health gauges: ```shell curl -s "$MORPH_METRICS_URL/metrics" | grep -E '^(neofs_(node|ir|s3_gw)_state_health|morph_console_up) ' ``` | Gauge | Healthy value | Other values | |---|---|---| | `neofs_node_state_health` | 2 (READY) | 0 undefined, 1 starting, 3 shutting down | | `neofs_ir_state_health` | 2 (READY) | 0 undefined, 1 starting, 3 shutting down, 4 initializing the network | | `neofs_s3_gw_state_health` | 2 (ready) | 0 no healthy connection to a storage node, 1 starting | | `morph_console_up` | 1 | 0 not started | A gauge that is missing means that the process does not run on this installation type, or that it did not answer the collector within 1 second. The storage node's gauge says that the process is ready. It does not say that the node is in the network map. Use step 3 or step 4 for that. ### 3. Ask the console 1. Log in and keep the token: ```shell TOKEN=$(curl -s -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d "{\"login\":\"first-admin\",\"password\":\"$MORPH_PASSWORD\"}" | jq -r .token) ``` 2. List the storage nodes in the current network map: ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" | jq '.nodes[] | {address, endpoints}' ``` Every storage node that you expect is in the list. A node that has asked to join and is not yet in the network map is not listed. A node that stopped sending heartbeats stays listed until more than 3 epochs have passed. 3. Read the cluster metrics: ```shell curl -s "$MORPH_URL/api/v1/cluster/metrics" \ -H "Authorization: Bearer $TOKEN" | jq ``` The response holds the totals `buckets`, `objects`, `dataSize` (bytes of object data, without metadata) and `users`, and a `nodes` list. Each node has its `endpoint` and a `drives` list. In the bundled version a drive fills only `totalSpace`, taken from the node's capacity attribute, in bytes. The `mountPoint`, `usedSpace` and `availSpace` fields of a drive and the node's `uptime` are present but always 0 or empty: the bundled console does not compute them. The console API has no endpoint for the current epoch or for the state of the chain. Read `neofs_ir_state_epoch` and `neogo_block_height` from the collector for these. ### 4. Ask the storage node The storage node's control service listens on `localhost:16513` inside the container. Run `neofs-cli` in the container. 1. Check the health and the network map state of the storage node: ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control healthcheck \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` A healthy node prints: ```text Network status: ONLINE Health status: READY ``` `Network status` is `ONLINE`, `OFFLINE` or `MAINTENANCE`. The command exits with a status other than 0 when the health status is not `READY`. 2. List the shards with their modes and error counters: ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards list \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" ``` For each shard the command prints `Shard :`, `Mode:`, the paths of the metabase and the object store, and `Error count:`. Every shard is in mode `read-write` and has an error count of 0. The `Write-cache:` line of this output repeats the metabase path. For the real write-cache path, add `--json` and read the field `writecache`. The inner ring of a cluster-type node has its own control service on port 16512. It accepts requests signed with the inner ring node's own key, so `control healthcheck --ir` needs `--endpoint localhost:16512` and the generated configuration `/morph/local_state/config/cli-config-ir.yaml` (see [command-line tools](../../reference/command-line-tools.md)). The gauge `neofs_ir_state_health` from step 2 reports the same state. ## Check the result The cluster is healthy when all of these hold: - Every Morph container runs, and its log shows no `health probe failed` lines. - On every node, the health gauges of the processes that run there are 2, and `morph_console_up` is 1. - `GET /api/v1/cluster/storage-nodes` lists every storage node. - On every storage node, `control healthcheck` prints `Network status: ONLINE`, and `control shards list` shows every shard in `read-write` mode with an error count of 0. - `neofs_ir_state_epoch` is the same on all inner ring nodes and grows once per epoch. - `neofs_node_state_policer_consistency_state` is 1 on every storage node. It is 0 from the start of a storage node until the policer has finished its first pass. To be told when one of these stops holding, see [Set up alerts](set-up-alerts.md). ## Related - [Collect metrics](collect-metrics.md) - [Read logs](read-logs.md) - [Metrics reference](../../reference/metrics.md) - [REST API reference](../../reference/rest-api/index.md) - [Command-line tools](../../reference/command-line-tools.md) - [Environment variables](../../reference/configuration/environment-variables.md) - [Handle a node failure](../operate/handle-a-node-failure.md) - [Use maintenance mode](../operate/use-maintenance-mode.md) - [Diagnose common problems](../troubleshoot/diagnose-common-problems.md) --- # Use the AWS CLI This guide configures the AWS CLI version 2 for the S3 endpoint of Morph and shows the commands for common tasks. ## Before you start - A Morph node whose S3 endpoint you can reach. The default port is 9080. - An S3 access key ID and secret access key. To create them, see [Manage S3 credentials](../secure/manage-s3-credentials.md) or the tutorial [Store your first object with S3](../../tutorials/first-steps-with-s3.md). - AWS CLI version 2.13 or later, which reads the endpoint from the profile. Set the endpoint and the profile name that the commands on this page use. The commands also expect your access key ID in `S3_ACCESS_KEY` and your secret access key in `S3_SECRET_KEY`, as the tutorial sets them. ```shell export S3_URL=http://localhost:9080 export AWS_PROFILE=morph ``` `AWS_PROFILE` makes every `aws` command in this shell use the profile `morph`. ## Configure the profile 1. Store the credentials in the profile `morph`. ```shell aws configure set aws_access_key_id "$S3_ACCESS_KEY" --profile morph aws configure set aws_secret_access_key "$S3_SECRET_KEY" --profile morph ``` 2. Set the endpoint and a region. Morph has no regions and accepts any region name in the signature. ```shell aws configure set endpoint_url "$S3_URL" --profile morph aws configure set region us-east-1 --profile morph ``` 3. Select path-style addressing. The gateway does not serve virtual-hosted-style requests. ```shell aws configure set s3.addressing_style path --profile morph ``` 4. Turn off the checksums that the CLI adds by default since version 2.23. The gateway verifies a trailing checksum on an unsigned chunked upload, ignores a checksum sent in a header, does not decode signed chunks with a trailing checksum, and returns no checksum on downloads. With `when_required` the CLI adds a checksum only where an operation demands one. ```shell aws configure set request_checksum_calculation when_required --profile morph aws configure set response_checksum_validation when_required --profile morph ``` 5. List your buckets to test the profile. ```shell aws s3 ls ``` The command prints one line per bucket that you own, or nothing when you have none. An error `SignatureDoesNotMatch` points to a wrong secret access key, `InvalidAccessKeyId` to an access key ID that is not in the form Morph issues, and `AccessDenied` to an access key ID that the gateway cannot find or open. ## Create a bucket with a storage policy The `LocationConstraint` of the S3 API selects the storage policy of the bucket. Use the name of one of your storage policies or of a system policy such as `REP-3`. To see the names, see [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). 1. Create the bucket with the policy `REP-3`. This policy stores three replicas on three storage nodes. On a cluster with a single node, use `REP-1` in its place. ```shell aws s3api create-bucket --bucket my-bucket \ --create-bucket-configuration LocationConstraint=REP-3 ``` Without `--create-bucket-configuration` the bucket gets the default storage policy of the cluster. A policy name that does not exist returns `NoSuchBucketPolicy`. A policy that the storage nodes of the cluster cannot satisfy, such as `REP-3` on a single node, returns `InvalidLocationConstraint`. 2. Read the location constraint back. ```shell aws s3api get-bucket-location --bucket my-bucket ``` The output contains `"LocationConstraint": "REP-3"`. Creating a bucket is a transaction on the FS chain. If the CLI retries the request, the retry can return `BucketAlreadyOwnedByYou`, which means that the first attempt created the bucket. The storage policy of a bucket is set at creation. ## Upload, download and synchronize 1. Upload one file. ```shell aws s3 cp ./my-object s3://my-bucket/my-object ``` 2. Download it. ```shell aws s3 cp s3://my-bucket/my-object ./my-object.copy ``` 3. Synchronize a local directory to a prefix of the bucket. The command uploads the files that are missing in the bucket or differ in size or modification time. ```shell aws s3 sync ./data s3://my-bucket/data ``` 4. List the prefix. ```shell aws s3 ls s3://my-bucket/data/ ``` ## Tune multipart uploads `aws s3 cp` and `aws s3 sync` split files above a threshold into parts. The gateway accepts part numbers 1 to 10000, parts of at most 4 GiB minus 1 byte, and requires at least 5 MiB for every part except the last. 1. Set the threshold and the part size. Choose a part size that keeps the largest file you upload below 10000 parts. ```shell aws configure set s3.multipart_threshold 64MB --profile morph aws configure set s3.multipart_chunksize 64MB --profile morph ``` 2. Decide how many requests run at the same time. The CLI uploads the parts of a file in parallel. A part that reaches the gateway before the part with the preceding number is stored out of sequence, and the gateway reads and writes such parts again when the upload is completed. With one request at a time the parts arrive in order and the completion writes no data again. The default of the CLI is 10. ```shell aws configure set s3.max_concurrent_requests 1 --profile morph ``` The background is explained in [How S3 maps onto Morph](../../explanation/s3-on-morph.md#multipart-uploads). 3. List unfinished uploads, and abort the ones you no longer need. Morph does not remove them automatically. ```shell aws s3api list-multipart-uploads --bucket my-bucket ``` ```shell aws s3api abort-multipart-upload --bucket my-bucket \ --key my-object --upload-id "$UPLOAD_ID" ``` Set `UPLOAD_ID` to an `UploadId` from the listing. ## Create a presigned URL 1. Create a URL that allows downloading the object for one hour. The longest lifetime that the gateway accepts is 604800 seconds (7 days). ```shell aws s3 presign s3://my-bucket/my-object --expires-in 3600 ``` 2. Download the object with the URL that the command printed. ```shell curl -o my-object.copy "$PRESIGNED_URL" ``` Set `PRESIGNED_URL` to the printed URL. The URL contains the host name of the endpoint in your profile. Whoever uses the URL must reach Morph under that name. ## Use versioning 1. Enable versioning on the bucket. ```shell aws s3api put-bucket-versioning --bucket my-bucket \ --versioning-configuration Status=Enabled ``` 2. Upload the object twice, then list its versions. ```shell aws s3api list-object-versions --bucket my-bucket --prefix my-object ``` The output lists both versions with their `VersionId`. One has `"IsLatest": true`. An object that you uploaded under this key before you enabled versioning is listed too, with the `VersionId` `null`. 3. Download a specific version. ```shell aws s3api get-object --bucket my-bucket --key my-object \ --version-id "$VERSION_ID" ./my-object.old ``` Set `VERSION_ID` to a `VersionId` from the listing. 4. Delete the object. In a versioned bucket this adds a delete marker and keeps the versions. To remove a version for good, pass `--version-id`. ```shell aws s3api delete-object --bucket my-bucket --key my-object ``` The output shows `"DeleteMarker": true` and the `VersionId` of the delete marker. `get-object` and `head-object` for the key without a version now return a 404 error. 5. Remove the delete marker to make the latest version current again. ```shell aws s3api delete-object --bucket my-bucket --key my-object \ --version-id "$VERSION_ID" ``` Set `VERSION_ID` to the `VersionId` that the previous command printed. ## Tag objects and buckets An object or a bucket carries at most 10 tags. 1. Set the tags of an object. ```shell aws s3api put-object-tagging --bucket my-bucket --key my-object \ --tagging 'TagSet=[{Key=project,Value=demo}]' ``` 2. Read them. ```shell aws s3api get-object-tagging --bucket my-bucket --key my-object ``` 3. Set and read the tags of a bucket. ```shell aws s3api put-bucket-tagging --bucket my-bucket \ --tagging 'TagSet=[{Key=team,Value=storage}]' aws s3api get-bucket-tagging --bucket my-bucket ``` ## Check the result Run the commands below. The first prints the endpoint of Morph that the profile holds, the second lists `my-bucket`, and the third prints the header fields of the object. ```shell aws configure get endpoint_url aws s3 ls aws s3api head-object --bucket my-bucket --key my-object ``` The `ETag` in the output of `head-object` is a SHA-256 checksum with 64 hexadecimal characters. Morph does not use MD5 for ETags. ## Related pages - [S3 compatibility](../../reference/s3-compatibility.md): every operation with its status, limits and error codes. - [Use the AWS SDKs](aws-sdks.md) - [Use other S3 tools](s3-tools.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) - [Control access to a bucket](../buckets-and-objects/control-access.md) --- # Use the AWS SDKs This guide creates a working S3 client for Morph in Python, Go, Java and JavaScript and writes and reads one object with it. ## Before you start - A Morph node whose S3 endpoint you can reach. The default port is 9080. - An S3 access key ID and secret access key, see [Manage S3 credentials](../secure/manage-s3-credentials.md) or the tutorial [Store your first object with S3](../../tutorials/first-steps-with-s3.md). - A bucket named `my-bucket`, see [Create a bucket](../buckets-and-objects/create-a-bucket.md). - The AWS CLI with the profile `morph` for the check at the end, see [Use the AWS CLI](aws-cli.md). - A current release of the SDK. The checksum options below exist in boto3 1.36, AWS SDK for Go v2 with `config` 1.29, AWS SDK for Java 2.30 and AWS SDK for JavaScript 3.729, and in later releases. The examples read the endpoint and the credentials from the environment. Set the endpoint, and set `S3_ACCESS_KEY` and `S3_SECRET_KEY` to your access key ID and secret access key as the tutorial does. ```shell export S3_URL=http://localhost:9080 ``` ## Settings every client needs Apply these five settings in any SDK. The sections below show them for each language. | Setting | Value | Reason | |---|---|---| | Endpoint | The S3 URL of a Morph node or of your load balancer | The SDK otherwise sends requests to AWS. | | Region | Any name, for example `us-east-1` | The SDK needs a region to sign. Morph has no regions and accepts any name. | | Addressing | Path-style | The gateway does not serve virtual-hosted-style requests. | | Credentials | Static access key ID and secret access key | Morph issues long-lived keys. It has no STS and no session tokens. | | Request checksum calculation and response checksum validation | `when_required` | See below. | Current SDKs add a checksum to every upload unless told otherwise. The gateway handles the forms differently: - A checksum in a request header is ignored. - A trailing checksum on an unsigned chunked upload (`STREAMING-UNSIGNED-PAYLOAD-TRAILER`) is verified. - A trailing checksum on a chunked upload with signed chunks (`STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER`) is not supported, and the upload fails. The AWS SDK for Java can send this form to an `http://` endpoint. - Downloads carry no checksum headers, so there is nothing for the SDK to validate. With `when_required` the SDK adds a checksum only to the operations that demand one, so uploads do not use the trailing-checksum forms, on `http://` and on `https://` endpoints. The integrity of stored data does not depend on this setting: the storage nodes keep a SHA-256 checksum of every object. ## Write and read an object 1. Pick your language and create the client with the settings above. 2. Run the example. It stores the text `hello` under the key `my-object` in the bucket `my-bucket`, reads it back and prints it. ### Python (boto3) ```python import os import boto3 from botocore.config import Config s3 = boto3.client( "s3", endpoint_url=os.environ["S3_URL"], region_name="us-east-1", aws_access_key_id=os.environ["S3_ACCESS_KEY"], aws_secret_access_key=os.environ["S3_SECRET_KEY"], config=Config( s3={"addressing_style": "path"}, request_checksum_calculation="when_required", response_checksum_validation="when_required", ), ) s3.put_object(Bucket="my-bucket", Key="my-object", Body=b"hello") body = s3.get_object(Bucket="my-bucket", Key="my-object")["Body"].read() print(body.decode()) ``` ### Go (aws-sdk-go-v2) ```go package main import ( "context" "fmt" "io" "log" "os" "strings" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/s3" ) func main() { ctx := context.Background() cfg, err := config.LoadDefaultConfig(ctx, config.WithBaseEndpoint(os.Getenv("S3_URL")), config.WithRegion("us-east-1"), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( os.Getenv("S3_ACCESS_KEY"), os.Getenv("S3_SECRET_KEY"), "")), config.WithRequestChecksumCalculation(aws.RequestChecksumCalculationWhenRequired), config.WithResponseChecksumValidation(aws.ResponseChecksumValidationWhenRequired), ) if err != nil { log.Fatal(err) } client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.UsePathStyle = true }) _, err = client.PutObject(ctx, &s3.PutObjectInput{ Bucket: aws.String("my-bucket"), Key: aws.String("my-object"), Body: strings.NewReader("hello"), }) if err != nil { log.Fatal(err) } out, err := client.GetObject(ctx, &s3.GetObjectInput{ Bucket: aws.String("my-bucket"), Key: aws.String("my-object"), }) if err != nil { log.Fatal(err) } defer out.Body.Close() body, err := io.ReadAll(out.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ### Java (AWS SDK for Java 2.x) ```java import java.net.URI; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.checksums.RequestChecksumCalculation; import software.amazon.awssdk.core.checksums.ResponseChecksumValidation; import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.PutObjectRequest; public class MorphExample { public static void main(String[] args) { S3Client s3 = S3Client.builder() .endpointOverride(URI.create(System.getenv("S3_URL"))) .region(Region.US_EAST_1) .credentialsProvider(StaticCredentialsProvider.create( AwsBasicCredentials.create( System.getenv("S3_ACCESS_KEY"), System.getenv("S3_SECRET_KEY")))) .forcePathStyle(true) .requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED) .responseChecksumValidation(ResponseChecksumValidation.WHEN_REQUIRED) .build(); s3.putObject( PutObjectRequest.builder().bucket("my-bucket").key("my-object").build(), RequestBody.fromString("hello")); String body = s3.getObjectAsBytes( GetObjectRequest.builder().bucket("my-bucket").key("my-object").build()) .asUtf8String(); System.out.println(body); } } ``` Do not set `checksumValidationEnabled` in an `S3Configuration` on the same client. The SDK rejects a client that combines it with the two checksum options and reports `Checksum behavior has been configured on both S3Configuration and the client/global level`. ### JavaScript (AWS SDK for JavaScript v3) ```javascript import { S3Client, PutObjectCommand, GetObjectCommand } from "@aws-sdk/client-s3"; const s3 = new S3Client({ endpoint: process.env.S3_URL, region: "us-east-1", forcePathStyle: true, credentials: { accessKeyId: process.env.S3_ACCESS_KEY, secretAccessKey: process.env.S3_SECRET_KEY, }, requestChecksumCalculation: "WHEN_REQUIRED", responseChecksumValidation: "WHEN_REQUIRED", }); await s3.send(new PutObjectCommand({ Bucket: "my-bucket", Key: "my-object", Body: "hello" })); const res = await s3.send(new GetObjectCommand({ Bucket: "my-bucket", Key: "my-object" })); console.log(await res.Body.transformToString()); ``` Run the file as an ES module, for example with the extension `.mjs`. ## Check the result Each example prints `hello`. Then confirm with the AWS CLI that the object is in the bucket: ```shell aws s3api head-object --bucket my-bucket --key my-object \ --endpoint-url "$S3_URL" --profile morph ``` The output shows `"ContentLength": 5` and an `ETag` of 64 hexadecimal characters. If the upload fails: | Error | Cause | |---|---| | `SignatureDoesNotMatch` | Wrong secret access key, or a proxy between client and gateway changes the path or the signed headers, or the client signs the `User-Agent` header, as the AWS SDK for Java 1.x does. Use the AWS SDK for Java 2.x. | | `SignatureDoesNotMatch` on CreateMultipartUpload from Java | The AWS SDK for Java 2.x signs a `Content-Length` header with the value 0 on this request. Upload with PutObject. | | `InvalidAccessKeyId` | The access key ID is not in the form Morph issues. | | `AccessDenied` on every request | The gateway cannot find or open the credential, or the credential belongs to another namespace than the gateway. | | `MalformedXML` on an upload, `NoSuchBucket` on a download from an existing bucket | The client uses virtual-hosted-style addressing. Turn on path-style. | | `IncompleteBody`, or an error on upload from Java over `http://` | The SDK sends signed chunks with a trailing checksum. Set the checksum options to `when_required`. | ## Notes for application code - **ETag.** Do not treat the ETag as an MD5 digest. It is a SHA-256 checksum for single-part and for multipart objects, and it is returned without quotes. - **Multipart uploads.** Part numbers 1 to 10000, at most 4 GiB minus 1 byte per part, at least 5 MiB for every part except the last. Parts that arrive before their predecessor are written again when the upload is completed. Transfer helpers upload parts in parallel; set their concurrency to 1 (`max_concurrency` in boto3's `TransferConfig`, `Concurrency` in the Go upload manager) when the cost of the completion matters more than the upload time. - **Multipart uploads from Java.** The AWS SDK for Java 2.x signs the `Content-Length` header of CreateMultipartUpload. The header has the value 0, and the gateway answers a request with such a signature with `SignatureDoesNotMatch`. Upload with PutObject from Java. Multipart uploads from the SDKs for Python, Go and JavaScript work. - **Conditional reads.** Pass the ETag to `If-Match` and `If-None-Match` exactly as the gateway returned it. - **Server-side encryption.** `ServerSideEncryption` and KMS parameters are ignored. Only customer-provided keys (SSE-C) are implemented, and only on a TLS listener of the gateway. - **Retries after a timeout.** A request that waits more than 30 seconds for a free slot on the gateway returns HTTP 503 `RequestTimeout`. The SDKs retry it. ## Related pages - [S3 compatibility](../../reference/s3-compatibility.md) - [Use the AWS CLI](aws-cli.md) - [Use Apache Spark](apache-spark.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) --- # Use other S3 tools This guide connects rclone, s3cmd and the MinIO client (`mc`) to the S3 endpoint of Morph. ## Before you start - A Morph node whose S3 endpoint you can reach. The default port is 9080. - An S3 access key ID and secret access key, see [Manage S3 credentials](../secure/manage-s3-credentials.md) or the tutorial [Store your first object with S3](../../tutorials/first-steps-with-s3.md). - A bucket named `my-bucket`, see [Create a bucket](../buckets-and-objects/create-a-bucket.md). - The AWS CLI with the profile `morph` for the check at the end, see [Use the AWS CLI](aws-cli.md). Set the endpoint. The commands also expect your access key ID in `S3_ACCESS_KEY` and your secret access key in `S3_SECRET_KEY`, as the tutorial sets them. ```shell export S3_URL=http://localhost:9080 ``` Every tool needs the same four facts about Morph: | Setting | Value | |---|---| | Endpoint | The S3 URL of a Morph node or of your load balancer | | Addressing | Path-style | | Signature | Version 4 | | Region | Any name, for example `us-east-1` | The ETag of Morph is a SHA-256 checksum, for single-part and for multipart objects. A tool that compares the ETag with an MD5 digest has to be told not to. ## Configure rclone 1. Create the remote `morph`. The provider `Other` selects a generic S3 service. `use_multipart_etag false` stops rclone from comparing the ETag of a multipart upload with a value computed from MD5 digests. ```shell rclone config create morph s3 \ provider=Other \ access_key_id="$S3_ACCESS_KEY" \ secret_access_key="$S3_SECRET_KEY" \ endpoint="$S3_URL" \ region=us-east-1 \ force_path_style=true \ use_multipart_etag=false ``` 2. List the bucket. ```shell rclone lsf morph:my-bucket ``` 3. Copy a directory into the bucket. ```shell rclone copy ./data morph:my-bucket/data ``` Options for large files, to pass on the command line or to add to the remote: | Option | Meaning for Morph | |---|---| | `--s3-chunk-size` | Part size of multipart uploads. Morph requires at least 5 MiB for every part except the last and accepts at most 4 GiB minus 1 byte. rclone uploads at most 10000 parts, which is also the limit of Morph. | | `--s3-upload-cutoff` | Size above which rclone uses a multipart upload. | | `--s3-upload-concurrency` | Number of parts of one file uploaded at the same time. With `1` the parts reach Morph in order, and completing the upload writes no data again. See [How S3 maps onto Morph](../../explanation/s3-on-morph.md#multipart-uploads). | ## Configure s3cmd 1. Set the host and port of the endpoint, without the scheme. ```shell export S3_HOST=localhost:9080 ``` 2. Write the configuration file `~/.s3cfg`. Setting `host_bucket` to the same value as `host_base`, without a bucket placeholder, selects path-style addressing. `use_https` must match the scheme of your endpoint. ```shell cat > ~/.s3cfg < # Use Apache Spark This guide configures the Hadoop S3A connector (`s3a://`) of Apache Spark for the S3 endpoint of Morph, and reads and writes a dataset. ## Before you start - A Morph node, or a load balancer in front of several, whose S3 endpoint the Spark driver and all executors can reach. The default port is 9080. - An S3 access key ID and secret access key, see [Manage S3 credentials](../secure/manage-s3-credentials.md) or the tutorial [Store your first object with S3](../../tutorials/first-steps-with-s3.md). - A bucket named `my-bucket` without versioning, see [Create a bucket](../buckets-and-objects/create-a-bucket.md). The reason for an unversioned bucket is given under [Consistency](#consistency). - The AWS CLI with the profile `morph` for the check at the end, see [Use the AWS CLI](aws-cli.md). - A Spark distribution built with Hadoop 3.5, for example Spark 4.3.0. You need the `hadoop-aws` module in exactly the version of the Hadoop libraries in that distribution, and the `spark-hadoop-cloud` module in the version of Spark. A distribution built with Hadoop 3.3 cannot connect: its S3A connector uses the AWS SDK for Java 1.x, which signs the `User-Agent` header, and the gateway answers every request with such a signature with `SignatureDoesNotMatch`. Set the endpoint and the versions of your distribution. The commands also expect your access key ID in `S3_ACCESS_KEY` and your secret access key in `S3_SECRET_KEY`, as the tutorial sets them. ```shell export S3_URL=http://localhost:9080 export HADOOP_VERSION=3.5.0 export SPARK_VERSION=4.3.0 export SCALA_VERSION=2.13 ``` ## Connect Spark to Morph 1. Create the file `morph-s3a.conf` with the connection properties. Each property of the S3A connector is passed to Spark with the prefix `spark.hadoop.`. ```shell cat > morph-s3a.conf <> morph-s3a.conf <> morph-s3a.conf < # Diagnose common problems This guide lists symptoms with their causes and fixes. Search the page for the message you see. The messages are quoted as the software prints them. ## Before you start Most checks use the log of the Morph container and the metrics collector of the node. ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container export METRICS_URL=http://localhost:5100 # metrics collector of the node export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator ``` ```shell docker logs --tail 200 "$MORPH_CONTAINER" curl -s "$METRICS_URL/metrics" | grep -E '^neofs_(ir|node|s3_gw)_state_health ' ``` A health metric with the value 2 means ready. The commands with `neofs-cli` need the binary inside the container; see [Collect diagnostics](collect-diagnostics.md). ## The container does not start ### The log stops at `⭐ INSTALLER IS STARTING ⭐` **Cause.** The node is not installed. The container waits for the installation request on port 9100. **Fix.** On a new node, send the installation request. See [Install a cluster](../deploy/install-a-cluster.md) and [Add storage nodes](../operate/add-storage-nodes.md). On a node that was installed before, this message means that the container does not see its state: `/morph/local_state/config/installation.txt` is missing. Stop the container and mount the node's state directory at `/morph/local_state`. Do not send an installation request. It would create a new node with new keys. ### `💤 Waiting for metric` repeats The line names the metric it waits for in the field `want`. | `want` | Cause | Fix | |---|---|---| | `neofs_ir_state_health 2` | The inner ring process is not ready. It needs to reach the other inner ring nodes on the consensus port (20333). | Start the other cluster-type nodes and check the network between them. During the first installation every cluster-type node has to receive its installation request. | | `neofs_node_state_health 2` | The storage node is not ready. It needs a chain RPC endpoint and all its shards. | Read the storage node's own lines above the message. Check that every drive is mounted and that the inner ring nodes are reachable on port 30333. | | `neofs_s3_gw_state_health 2` | The S3 gateway is not ready. It needs the storage node and the chain RPC. | Check the two metrics above first. | ### `process exited while waiting, restarting` **Cause.** A bundled process exits during the start. The entrypoint starts it again, in a loop. For the storage node the common causes are: - A shard cannot be initialized: a drive is not mounted, is read-only or has failed. The storage node does not start with a shard that it cannot initialize. - The chain RPC endpoints in its configuration cannot be reached or are malformed. In the installation request of a storage-type node, give the endpoints as `http://:30333`. - `invalid version, resynchronization is required`: the metabase of a shard has a format that this release cannot migrate. It is too old because a release was skipped during an upgrade, or it is newer because an older image was started after an upgrade. See [Upgrade paths](../../releases/upgrade-paths.md). **Fix.** Read the lines of the process just before the restart and remove the cause. For a failed drive, see [Replace a failed drive](../operate/replace-a-failed-drive.md). ### `💤 Waiting for morph to be online...` repeats **Cause.** The console is not answering on port 9100 yet. At its start the console connects to the storage node and to the chain RPC, and on a cluster-type node it deploys or updates Morph's contracts, which needs blocks and the signatures of the inner ring majority. **Fix.** Check the inner ring quorum (see [Chain changes do not go through](#chain-changes-do-not-go-through)). Read the console's lines above the message. ### `local SN is not in Netmap` repeats on a storage-type node **Cause.** The storage node is not in the network map, and the container waits for it before it starts the console and the S3 gateway. See [A storage node never enters the network map](#a-storage-node-never-enters-the-network-map). With `couldn't use sidechain endpoint` next to it, the node cannot reach the chain RPC of the inner ring nodes. ### `Critical Error: Service unhealthy beyond threshold; Stopping container...` **Cause.** The entrypoint probes every process every 10 seconds. A process has failed `MORPH_HEALTHCHECK_ERROR_LIMIT` probes in a row (3 by default). The entrypoint then stops all processes and the container exits. **Fix.** The line names the process. The `health probe failed` lines before it carry the error. Remove the cause and start the container. With the environment variable `RESTART_IF_ERROR_LIMIT_REACHED=false` the entrypoint logs `service unhealthy beyond threshold (continuing)` and keeps the container running. ### `Container stopped due to process died or healthcheck triggered` **Cause.** A bundled process exited after the start (`process exited` names it), or the health check above triggered. The entrypoint does not restart a process that exits after the start. It stops the others and the container exits with code 1. **Fix.** Find the error of the named process above the message. With the restart policy of the installation guide (`--restart unless-stopped`) Docker starts the container again; without a restart policy it stays stopped. A container that keeps exiting and restarting has a persistent error: read the log of an earlier run with `docker logs`. ## Network map ### A storage node never enters the network map Check in this order: | Check | Cause | Fix | |---|---|---| | Has one epoch passed since the node started? | A new node is a candidate until the next epoch, up to 3600 seconds with the default epoch. | Wait. | | Was the node's address granted? | Without the grant the node has no GAS and cannot register on the FS chain. | Grant it. See [Add storage nodes](../operate/add-storage-nodes.md). | | Does the log of a cluster-type node contain `could not verify and update information about network map candidate`? | The license check refused the node. The error field gives the reason: `demo period expired`, `node limit reached`, `capacity limit exceeded` or `node is already present, but cannot increase capacity`. | Upload a license that allows the node. See [Manage licenses](../operate/manage-licenses.md). | | Does the grant answer `409` with `Cannot grant access for a blocked account.`? | The address was decommissioned. | Install the machine again as a new node with an empty `/morph/local_state`. | | Does the storage node log `can't send heartbeat tx` or `can't send bootstrap tx`? | The node cannot send transactions: no chain RPC, no GAS, or a blocked account. | Check the chain RPC endpoints, then the points above. | ### A storage node has disappeared from the network map | Cause | How to tell | Fix | |---|---|---| | The node sent no heartbeat for more than 3 epochs. | The node was down or cut off from the chain RPC for 3 to 4 hours with the default epoch. | Start it or restore its connection. It registers again and enters the map at the next epoch. See [Handle a node failure](../operate/handle-a-node-failure.md). | | The node was decommissioned. | A grant for its address answers `409`. | None. Decommissioning cannot be undone. | | The node was set to `offline` with `neofs-cli control set-status`. | The health check shows `Network status: OFFLINE`. | Restart the Morph container. The storage node registers again at start and sends its heartbeat every epoch. | ## Object operations fail ### `incomplete object PUT by placement` **Cause.** A write to a replicated bucket could not place the full number of replicas that the storage policy requires. Too many candidate nodes of the bucket are down, in maintenance, full or read-only. The nodes that could be reached may have stored their replica. The message ends with the error of the last node that answered. **Fix.** Bring the missing nodes back. Check which nodes the policy can use: a policy with placement factor 1 whose selector selects only as many nodes as a rule stores has no spare candidates, so one missing node fails every write. For buckets that have to accept writes during a failure, see [Choose a storage policy](../buckets-and-objects/choose-a-storage-policy.md). ### `not enough nodes to SELECT from` **Cause.** The storage policy cannot be satisfied on the current network map. A selector or filter matches fewer nodes than the policy needs. - At bucket creation: the policy asks for more nodes, or for nodes with attributes, than the cluster has. - On an existing bucket: nodes that the policy needs have left the network map, for example a site that the policy names. Every operation on the bucket fails, reads included, although the remaining nodes still hold the data. **Fix.** Compare the policy with the attributes of the nodes in the network map (`GET /api/v1/cluster/storage-nodes`). Bring nodes with the missing attributes back into the map. The storage policy of an existing bucket cannot be changed through the console API. See [Recover from a site failure](../operate/recover-from-a-site-failure.md). ### `node is under maintenance` **Cause.** The storage node is in maintenance mode and refuses object operations. Requests through the S3 gateway and the console of the same node fail, because both use the local storage node. **Fix.** Take the node out of the load balancer for the time of the maintenance, or set it back to `online`. See [Use maintenance mode](../operate/use-maintenance-mode.md). ### `shard is in read-only mode`, `could not put object to any shard` **Cause.** The node could not store an object on any of its shards. The shards are in `read-only` or `degraded-read-only` mode, are full, or return write errors. **Fix.** List the shards and their modes. ```shell docker exec "$MORPH_CONTAINER" /morph/local_state/neofs-cli control shards list \ --endpoint localhost:16513 --config /morph/local_state/config/cli-config-sn.yaml ``` `neofs_node_object_readonly` shows the same per shard. A shard that was switched by an operator or by its error counter stays in its mode until it is switched back or the storage node restarts. If the drive is healthy, switch it back with `control shards set-mode --mode read-write --clear-errors`. If the drive has failed, see [Replace a failed drive](../operate/replace-a-failed-drive.md). If the shards are full, add capacity. See [Add storage nodes](../operate/add-storage-nodes.md). ### Redundancy does not return after a drive failure **Symptom.** `neofs_node_state_policer_consistency_state` stays 0 on other nodes long after a drive has failed, and the node with the failed drive still lists its shard in `read-write` mode. **Cause.** The shard of the failed drive was not taken out of service. Its metabase still lists the lost objects, so the node answers that it has them and does not store the rebuilt replicas and parts. The automatic switch is off by default. **Fix.** Switch the shard to `degraded-read-only`. See [Replace a failed drive](../operate/replace-a-failed-drive.md). ### Reads take longer after nodes were added **Cause.** Expected. Until the policers have moved existing objects into the new order, a read asks nodes that rank for an object but do not hold it yet, gets `object not found` from them and continues with the next node. **Fix.** None. The effect ends when the policers have finished the move. For replicated buckets that is when `neofs_node_state_policer_optimal_placement` is 1 on every storage node. The gauge does not follow erasure-coded parts; for those see [Watch the progress](../operate/add-storage-nodes.md#watch-the-progress). ## Chain changes do not go through **Symptom.** Creating a bucket, changing access rules, adding a user or granting a node does not complete. The epoch does not advance. Objects in existing buckets can still be read and written. **Cause.** The inner ring has lost its quorum: fewer than 3 of 4, or 5 of 7, inner ring nodes are running and connected. The FS chain produces no blocks. **Check.** On each cluster-type node, run this twice, some seconds apart. Without a quorum the height stays the same. ```shell curl -s "$METRICS_URL/metrics" | grep -E '^(neofs_ir_state_health|neogo_block_height|neogo_peers_connected) ' ``` **Fix.** Start the missing cluster-type nodes and restore the network between the inner ring nodes on port 20333. See [Handle a node failure](../operate/handle-a-node-failure.md). ## Console API | Status and message | Cause | Fix | |---|---|---| | `401` `Token is missing or invalid.`, or `Missing or invalid token.` when a token is present but not accepted | The request has no `Authorization: Bearer` header (first message), or the token is not a valid session or access token (second message). | Log in and send the token. See [Manage API tokens](../secure/manage-api-tokens.md). | | `401` `Token has expired.` | The session or token lifetime has passed. | Log in again or create a new token. | | `401` `Bearer token is required.` on `POST /api/v1/users` | The first administrator already exists. Creating further users needs a token. | Log in as an administrator. | | `403` `Insufficient rights.` | The user's role does not allow the operation. Cluster operations (nodes, gateways, license, metrics) need a global administrator. | Use an account with the required role. See [Manage users and roles](../secure/manage-users-and-roles.md). | | `403` `Namespace management is disabled for this gateway.` | The gateway-type node is bound to one namespace. | Send the request to a cluster-type node. | | `400` `Failed to add node.` on a storage node grant | The license does not allow the node, or the demo period has expired. | See [Manage licenses](../operate/manage-licenses.md). | | `409` `Cannot grant access for a blocked account.` | The account was decommissioned. | Use a new node with new keys. | | `501` `Decommissioning is available only on an Inner Ring Morph instance.` | The request went to a storage-type or gateway-type node. | Send it to the console of a cluster-type node. | For all status codes, see [Errors and status codes](../../reference/errors.md). ## S3 The S3 gateway answers these errors with status `403`. | Error code | Message | Cause | Fix | |---|---|---|---| | `SignatureDoesNotMatch` | `The request signature we calculated does not match the signature you provided. Check your key and signing method.` | The secret key is wrong, or the request was changed after signing. | Check the secret key of the client. If a proxy or load balancer is in front, make sure it passes the request on unchanged. | | `InvalidAccessKeyId` | `The Access Key Id you provided does not exist in our records.` | The gateway cannot find credentials for this access key. | Create S3 credentials for the user and use the new key pair. See [Manage S3 credentials](../secure/manage-s3-credentials.md). | | `RequestTimeTooSkewed` | `The difference between the request time and the server's time is too large.` | The clocks of the client and of the Morph node differ. | Synchronize both clocks. | | `AccessDenied` | `Access Denied.` | The credentials are valid, but the access rules of the bucket do not allow the operation. | See [Control access to a bucket](../buckets-and-objects/control-access.md). | See [S3 compatibility](../../reference/s3-compatibility.md) for operations that the gateway does not support. ## `neofs-cli` control commands | Message | Cause | Fix | |---|---|---| | `failed to dial "..." via gRPC` | The control service listens on `localhost:16513` inside the Morph container only. | Run `neofs-cli` inside the container with `docker exec`. | | `key is not in the allowed list` | The request is signed with a key that the control service does not accept. It accepts the storage node's own key. | Use `--config /morph/local_state/config/cli-config-sn.yaml`. | | `shard must be in read-only mode` | `control shards evacuate` was called on a shard in `read-write` mode. | Switch the shard to `read-only` first. | | `can't add non-online node to map` | `set-status --status maintenance` was called on a node that is not in the network map. | Set the status to `online` first and wait for the next epoch. | | `local maintenance is started, but state is not updated in the network` | The node refuses object operations now, but could not send the state change to the FS chain. | Check the chain RPC and the inner ring quorum, then repeat the command. | ## Related - [Collect diagnostics](collect-diagnostics.md) - [Check cluster health](../observe/check-cluster-health.md) - [Read logs](../observe/read-logs.md) - [Metrics](../../reference/metrics.md) --- # Collect diagnostics This guide gathers what is needed to analyze a problem on a Morph node: versions, the container log, metrics, health checks, the shard list and the network map. Morph has no command that collects a support bundle. The steps below write files into one directory. Run them on every affected node and on one healthy node for comparison. ## Before you start - Shell access to the host with permission to run `docker`. - `neofs-cli` of the bundled storage node version (0.58.1) for the steps that use it. The Morph image does not contain this binary. Download it from the NeoFS node release and copy it into the container. The storage node's control service listens on `localhost:16513` inside the container and accepts requests signed with the node's own key. The generated file `cli-config-sn.yaml` names that wallet, so the commands run inside the container with `docker exec`. Set the variables used below: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container export METRICS_URL=http://localhost:5100 # metrics collector of this node export CHAIN_RPC=http://localhost:30333 # chain RPC, on cluster-type nodes export MORPH_URL=http://localhost:9100 # console of a cluster-type node export TOKEN=... # session token of a global administrator export NEOFS_CLI=/morph/local_state/neofs-cli # path of neofs-cli inside the container export SN_CLI_CONFIG=/morph/local_state/config/cli-config-sn.yaml # generated CLI configuration of the storage node export SN_API=localhost:8080 # storage node API inside the container; 127.0.0.1:8084 if the node serves TLS export OUT=./morph-diagnostics # directory for the collected files mkdir -p "$OUT" ``` Copy `neofs-cli` into the container if it is not there yet: ```shell wget -O neofs-cli https://github.com/nspcc-dev/neofs-node/releases/download/v0.58.1/neofs-cli-linux-amd64 docker cp neofs-cli "$MORPH_CONTAINER":"$NEOFS_CLI" docker exec "$MORPH_CONTAINER" chmod +x "$NEOFS_CLI" ``` ## Steps 1. Record the image, the installation type and the mounts of the container. ```shell docker inspect --format '{{.Config.Image}}' "$MORPH_CONTAINER" > "$OUT/image.txt" docker inspect --format '{{json .Mounts}}' "$MORPH_CONTAINER" > "$OUT/mounts.json" docker exec "$MORPH_CONTAINER" cat /morph/local_state/config/installation.txt > "$OUT/installation-type.txt" ``` The installation type is `cluster`, `storage` or `gateway`. 2. Save the container log with timestamps. All bundled processes write to it. ```shell docker logs --timestamps "$MORPH_CONTAINER" > "$OUT/container.log" 2>&1 ``` The first lines of every start have the message `MORPH env` and print the environment of the entrypoint, including the wallet passwords. Remove them before you share the file: ```shell grep -v 'MORPH env' "$OUT/container.log" > "$OUT/container.redacted.log" rm "$OUT/container.log" ``` The entrypoint marks the steps of a start. Use these lines to find your way: | Marker | Meaning | |---|---| | `⭐ INSTALLER IS STARTING ⭐` | The node is not installed and waits for the installation request. | | `✅ INSTALLATION COMPLETE ✅` | The installer has written keys and configuration. | | `config migration complete`, `old config preserved` | A configuration file was migrated to the format of this release. | | `⭐ STARTING` | The entrypoint starts a bundled process. The field `bin` names it. | | `💤 Waiting for metric` | The entrypoint waits for the process to report ready. | | `✅ READY` | The process reports ready. | | `✅ local SN in Netmap` | On a storage-type node: the storage node is in the network map. | | `✅ ALL SERVICES STARTED` | Every process of the installation type is ready. | | `✅ MORPH CONTAINER STARTED` | The start is complete. Health monitoring begins. | | `health probe failed` | A health probe of a process failed. The field `consecutiveFails` counts them. | | `process exited` | A bundled process stopped by itself. | | `Critical Error: Stopping all processes and container...` | The entrypoint shuts the container down. | 3. Save the metrics. The collector on port 5100 gathers the metrics of all processes in the container. ```shell curl -s "$METRICS_URL/metrics" > "$OUT/metrics.txt" ``` The versions of the bundled components are in the metrics: ```shell grep -E '^neofs_(ir|node)_version' "$OUT/metrics.txt" ``` The lines that support looks at first: ```shell grep -E '^(neofs_(ir|node|s3_gw)_state_health|neofs_(ir|node)_state_epoch|neogo_block_height|neogo_peers_connected|neofs_node_state_policer_|neofs_node_object_readonly|neofs_node_engine_(payload_size|capacity))' "$OUT/metrics.txt" ``` 4. Run the health check of the storage node. Skip this step on a gateway-type node. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control healthcheck \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" > "$OUT/sn-healthcheck.txt" 2>&1 ``` A healthy node answers: ```text Network status: ONLINE Health status: READY ``` 5. Save the shard list with modes, paths and error counts. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" control shards list --json \ --endpoint localhost:16513 --config "$SN_CLI_CONFIG" > "$OUT/shards.json" 2>&1 ``` 6. Save the network map as this storage node sees it. The output has the epoch, the version of the map and one entry per node with its public key, state, endpoints and attributes. ```shell docker exec "$MORPH_CONTAINER" "$NEOFS_CLI" netmap snapshot \ --rpc-endpoint "$SN_API" --config "$SN_CLI_CONFIG" > "$OUT/netmap.txt" 2>&1 ``` 7. Save the list of storage nodes as the console reports it. Send the request to a cluster-type node. ```shell curl -s "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" > "$OUT/storage-nodes.json" ``` 8. On a cluster-type node, save the state of the chain node: protocol settings with the hardforks, and the height. ```shell curl -s -X POST "$CHAIN_RPC" \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "getversion", "params": []}' > "$OUT/chain-version.json" curl -s -X POST "$CHAIN_RPC" \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "getblockcount", "params": []}' > "$OUT/chain-height.json" ``` 9. Save the free space of the data, metadata and state paths. ```shell docker exec "$MORPH_CONTAINER" df -h > "$OUT/df.txt" ``` 10. Write down what the files cannot show: the time the problem started, what changed before it (upgrade, new node, drive swap, network change), the exact request that fails and its full answer, and the storage policy of the affected bucket. ## What not to include - The wallets in `/morph/local_state/config` (`wallet-*.json`, `az.json`). They are the private keys of the node. - The generated configuration files as they are. `config-ir.yaml`, `config-sn.yaml`, `config.yaml`, `config-s3.yaml` and the `cli-config-*.yaml` files contain wallet passwords. If a configuration file is asked for, remove the password lines first. - Session tokens and S3 secret keys in copied requests. ## Check the result The directory contains these files: ```shell ls "$OUT" ``` ```text chain-height.json chain-version.json container.redacted.log df.txt image.txt installation-type.txt metrics.txt mounts.json netmap.txt shards.json sn-healthcheck.txt storage-nodes.json ``` A file that holds an error message in place of data is a finding in itself. Keep it. ## Related - [Diagnose common problems](diagnose-common-problems.md) - [Read logs](../observe/read-logs.md) - [Collect metrics](../observe/collect-metrics.md) - [Command-line tools](../../reference/command-line-tools.md) - [Metrics](../../reference/metrics.md) --- # REST API This reference is generated from the OpenAPI specification of the Morph console (`upstream/morph-api.yaml` in this repository, a copy of the console's `api/morph.yaml`). | Property | Value | |---|---| | Title | Morph API | | Description | REST API of the multi-node/multi-drive Morph object storage. | | Specification version | `v0.30.1` | | OpenAPI version | `3.0.0` | | Operations | 81 | | Paths | 45 | | Schemas | 101 ([list](schemas.md)) | ## Base URL and versioning The specification declares one server URL: `/api`. The URL is relative, so a request goes to the address of the console followed by `/api` and the path of the operation. With the console at `http://localhost:9100`, the operation `POST /v1/users` is `POST http://localhost:9100/api/v1/users`. Every path starts with a version segment. This specification contains the version `/v1`. The specification itself has the version `v0.30.1`. ## Authentication | Scheme | Type | HTTP scheme | Description | |---|---|---|---| | `BearerAuth` | http | bearer | Bearer token authentication. Use an access token provided by the login. Include the token in the "Authorization" header with the "Bearer" prefix, e.g., "Authorization: Bearer <token>". | The scheme `BearerAuth` applies to every operation that does not state its own requirement. 68 of 81 operations require credentials. The others are listed here. | Operation | Authentication | |---|---| | [`POST /v1/users/{user}`](users.md#post-v1-users-user) | optional | | [`POST /v1/users`](users.md#post-v1-users) | optional | | [`GET /v1/users`](users.md#get-v1-users) | optional | | [`POST /v1/login`](login.md#post-v1-login) | none | | [`GET /v1/buckets/{bucket}/objects/{object}`](buckets.md#get-v1-buckets-bucket-objects-object) | optional | | [`HEAD /v1/buckets/{bucket}/objects/{object}`](buckets.md#head-v1-buckets-bucket-objects-object) | optional | | [`GET /v1/cluster/oauth`](cluster.md#get-v1-cluster-oauth) | none | | [`GET /v1/oauth/{providerID}/login`](oauth.md#get-v1-oauth-providerid-login) | none | | [`GET /v1/oauth/callback`](oauth.md#get-v1-oauth-callback) | none | | [`GET /v1/saml/{providerID}/login`](saml.md#get-v1-saml-providerid-login) | none | | [`POST /v1/saml/{providerID}/acs`](saml.md#post-v1-saml-providerid-acs) | none | | [`GET /v1/saml/{providerID}/metadata`](saml.md#get-v1-saml-providerid-metadata) | none | | [`GET /v1/cluster/saml`](cluster.md#get-v1-cluster-saml) | none | ## Common headers Request headers that operations declare as parameters: | Header | Type | Operations | Description | |---|---|---|---| | `X-Morph-Namespace` | string | 39 | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. | | `Range` | string | [`GET /v1/buckets/{bucket}/objects/{object}`](buckets.md#get-v1-buckets-bucket-objects-object) | Request a specific range of bytes from the object. Supports a single range only. | | `x-attributes` | string | [`POST /v1/buckets/{bucket}/objects`](buckets.md#post-v1-buckets-bucket-objects) | User attributes either a Base64-encoded JSON string or a plain JSON string (as a fallback). The server first attempts standard Base64 decoding; if that fails it treats the raw value as JSON. | | `x-morph-action` | string | [`POST /v1/cluster/storage-node`](cluster.md#post-v1-cluster-storage-node) | An action to apply to storage node or gateway accounts. "grant-access" with `address` grants a storage node access to become a network candidate. A public-key-only "grant-access" registers and grants access to a Morph/S3 gateway key without storage node admission. "decommission" is retained for legacy requests, use `DELETE /v1/cluster/storage-nodes/{address}` or `DELETE /v1/cluster/gateways/{address}` instead. Fields used only by the other action are ignored. Decommissioning is available only on an IR-enabled Morph instance and otherwise returns `501`. Constraints: one of `grant-access`, `decommission`. | | `x-morph-lifetime` | integer (int64) | [`POST /v1/buckets/{bucket}/objects`](buckets.md#post-v1-buckets-bucket-objects) | Object lifetime, in hours. The console sets the expiration time of the object to the time of the upload plus this many hours. Zero means that this header sets no expiration. Constraints: minimum 0. | | `x-morph-lifetime-date` | string | [`POST /v1/buckets/{bucket}/objects`](buckets.md#post-v1-buckets-bucket-objects) | Exact object expiration date in RFC3339 format (e.g. "2026-12-31T23:59:59Z"). Takes priority over X-Morph-Lifetime. The lifetime in hours is computed from the current time. Must be in the future. | | `x-morph-path` | string (base64) | [`POST /v1/buckets/{bucket}/objects`](buckets.md#post-v1-buckets-bucket-objects) | Object name. It can be a file path or object name, which suits your situation better. The object name encoded in base64. Constraints: minimum length 1. | | `x-morph-transfer-action` | string | [`POST /v1/users/{user}/pending-transfers/{id}`](users.md#post-v1-users-user-pending-transfers-id) | An action to apply to a bucket transfer. The only available action for now is "accept", which accepts the pending bucket transfer. | Response headers that the specification defines for reuse: | Header | Type | Description | |---|---|---| | `WWW-Authenticate` | string | Indicates the required authentication scheme. Example: `Bearer realm="morph"`. | | `X-Object-Id` | string | Object ID. | | `X-Attributes` | string | Object attributes serialized as a JSON key-value map. | | `Content-Length` | integer (int64) | | | `Content-Type` | string | | | `Last-Modified` | string | HTTP-date per RFC 7231 (e.g., Tue, 15 Nov 1994 12:45:26 GMT). | | `Accept-Ranges` | string | | | `Content-Disposition` | string | `inline`, or `attachment` if the `download` query parameter is set. The base name of the object's `FilePath` (or `FileName` if `FilePath` is absent) is given in the `filename` parameter or, for non-ASCII names, in the percent-encoded `filename*` one (RFC 5987). Example: `attachment; filename=cat.png`. | ## Paging 6 operations return their result in pages. They take these query parameters: | Parameter | Type | Operations | Description | |---|---|---|---| | `cursor` | string | 6 | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | integer | 4 | Limits the number of items in the response. Negative values and values above 100 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 100; default `100`. | | `maxItems` | integer | 2 | Limits the number of objects in the response. Negative values and values above 1000 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 1000; default `100`. | The response field `cursor` ([ListCursor](schemas.md#listcursor)): Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. Operations with paging: | Operation | Parameters | |---|---| | [`GET /v1/users/{user}/s3-tokens`](users.md#get-v1-users-user-s3-tokens) | `cursor`, `maxItems` (maximum 100) | | [`GET /v1/users/{user}/tokens`](users.md#get-v1-users-user-tokens) | `cursor`, `maxItems` (maximum 100) | | [`GET /v1/users`](users.md#get-v1-users) | `cursor`, `maxItems` (maximum 100) | | [`GET /v1/buckets`](buckets.md#get-v1-buckets) | `cursor`, `maxItems` (maximum 100) | | [`GET /v1/buckets/{bucket}/objects`](buckets.md#get-v1-buckets-bucket-objects) | `cursor`, `maxItems` (maximum 1000) | | [`POST /v1/buckets/{bucket}/objects/search`](buckets.md#post-v1-buckets-bucket-objects-search) | `cursor`, `maxItems` (maximum 1000) | ## Errors The specification defines no body schema for error responses (status 4xx and 5xx). An error is identified by its HTTP status code, and each operation describes what the code means for it. | Status | Operations | Response headers | Most frequent description | |---|---|---|---| | `400` | 55 | - | Passed data is invalid. | | `401` | 73 | `WWW-Authenticate` | Token is missing or incorrect. | | `403` | 73 | `WWW-Authenticate` | Insufficient rights to execute request. | | `404` | 47 | - | Bucket not found. | | `409` | 15 | - | Storage policy with this name already exists. | | `413` | 1 | - | License too large. | | `416` | 1 | - | Requested range is not satisfiable. | | `500` | 1 | - | Unable to perform requested action. | | `501` | 3 | - | Decommissioning is not implemented on this instance. | | `507` | 1 | - | User doesn't have enough space. | ## Corrections to the specification This reference differs from the published specification in 36 places, where the specification does not match what the console does. The corrections are kept in `upstream/morph-api.errata.yaml`. | The reference says | Established by | |---|---| | `GET /v1/saml/{providerID}/login` answers `302`, not `307`, when it redirects to the identity provider. | console: internal/api/morph_v1_auth.go (V1SamlLogin); nspcc-dev/saml: samlsp/middleware.go (HandleStartAuthFlow) | | The same operation answers `200` with an HTML form when the provider uses the POST binding. | nspcc-dev/saml: samlsp/middleware.go (HandleStartAuthFlow) | | Search results contain only the requested attributes. The first filter key is not added to them. | console: internal/service/bucket.go (search: the filter key is deleted from the result unless requested) | | `selectors` of a storage policy has no limit of 256 items. That number is the limit for replica rules. | sdk: netmap/policy.go (maxREPRules = 256, applied to replica rules in Verify) | | `X-Morph-Lifetime` is added to the upload time as hours. It is not converted through the epoch duration. | console: internal/neofs/object/storage.go (expiration = now + hours); CHANGELOG.md 0.30.0 (time-based object expiration) | | `ExpHours` in `X-Attributes` also applies when `X-Morph-Lifetime` is sent as 0. | console: internal/api/morph_v1_objects.go (V1CreateObject: ExpHours is used when the lifetime is 0) | | `X-Morph-Lifetime: 0` does not override `ExpHours`. | console: internal/api/morph_v1_objects.go (V1CreateObject) | | `createBucket` implies `setBucketEACL` for personal access tokens only, not for S3 credentials (CommonDetailedTokenInfo). | console: internal/service/s3tokens/generators.go (buildSessionTokensV2 against buildSessionTokensV2Extended) | | `createBucket` implies `setBucketEACL` for personal access tokens only, not for S3 credentials (CommonCreateTokenRequest). | console: internal/service/s3tokens/generators.go (buildSessionTokensV2 against buildSessionTokensV2Extended) | | `manageSettings` does not cover the bucket policy, which needs `setBucketEACL` (S3DetailedTokenInfo). | console: internal/service/s3tokens/generators.go (manageSettings adds the attribute verbs only); gateway: api/handler/acl.go (PutBucketPolicy sets the eACL) | | `manageSettings` does not cover the bucket policy, which needs `setBucketEACL` (S3CreateAccessTokenRequest). | console: internal/service/s3tokens/generators.go (manageSettings adds the attribute verbs only); gateway: api/handler/acl.go (PutBucketPolicy sets the eACL) | | `PUT /v1/users/{user}`: `role` and `password` are optional and independent. A request with `role` from a user who is not an administrator answers `403`. | console: internal/api/morph_v1_users.go (V1UpdateUser), internal/service/user_management.go; checked on a 0.30.1 node, 2026-11-18 | | The example of `PUT /v1/users/{user}` sends the password only. | checked on a 0.30.1 node, 2026-11-18 | | `V1UpdateUserRequest` requires both fields only for the deprecated register operation. | console: internal/api/morph_v1_users.go | | The example of the deprecated `POST /v1/users/{user}` registers the first administrator with the role `admin`; with `user` the console answers `400 User role is incorrect.` | console: internal/api/morph_v1_users.go (first user must be an admin); checked on a 0.30.1 node, 2026-11-18 | | `POST /v1/buckets` answers `409` also when the storage policy cannot be satisfied. | console: internal/api/morph_v1_buckets.go (V1CreateBucket); checked on a 0.30.1 node, 2026-11-18 | | `POST /v1/buckets` answers `404` for an unknown storage policy name. | console: internal/api/morph_v1_buckets.go (V1CreateBucket); checked on a 0.30.1 node, 2026-11-18 | | `eACL.records` is `null` when the bucket has no extended ACL records. | console: internal/api/morph_v1_buckets.go, internal/apiserver (no omitempty); checked on a 0.30.1 node, 2026-11-18 | | `metadataConsistency` is an empty string when the bucket's storage policy sets no consistency. | console: internal/api/conv.go, internal/api/morph_v1_buckets.go; checked on a 0.30.1 node, 2026-11-18 | | `getUserMetrics` is available to administrators only (DetailedBearerTokenInfo). | console: internal/api/validation.go (checkAdminOnlyTokenFields); checked on a 0.30.1 node, 2026-11-18 | | `getUserMetrics` is available to administrators only (CreateBearerTokenRequest). | console: internal/api/validation.go (checkAdminOnlyTokenFields); checked on a 0.30.1 node, 2026-11-18 | | `GET /v1/users/{user}` answers `400` for an unknown namespace in `X-Morph-Namespace`. | console: internal/api/morph_v1_users.go; checked on a 0.30.1 node, 2026-11-18 | | `GET /v1/users/{user}` answers `403` when the caller may not select the namespace. | console: internal/api/morph_v1_users.go; checked on a 0.30.1 node, 2026-11-18 | | `GET /v1/saml/{providerID}/metadata` returns the service provider metadata as XML. | nspcc-dev/saml: samlsp/middleware.go (ServeMetadata) | | `POST /v1/buckets/{bucket}/objects` answers `404` for a bucket that does not exist. | console: internal/api/morph_v1_objects.go (V1CreateObject); checked on a 0.30.1 node, 2026-11-18 | | The request examples for storage policies carry a policy that the console accepts (one replica, no selectors or filters). | checked on a 0.30.1 node, 2026-11-18: a policy built from the type names alone is rejected with `400 Invalid policy format.` | | The request examples with extended ACL records carry a record that the console accepts. A target needs a role or an account list. | checked on a 0.30.1 node, 2026-11-18: an empty target is rejected with `400 ... role is not set, but account list is empty` | | The example date of `PUT /v1/buckets/{bucket}/timelock` is in the future. The console rejects a past date. | checked on a 0.30.1 node, 2026-11-18: `400 Bad parameter: timelock must be greater than the current time.` | | The example date of `lockUntil` in `POST /v1/buckets` is in the future. | console: internal/api/morph_v1_buckets.go | | `final`, `owner` and `others` are not required: the console accepts a create-bucket request with any of them left out, or with no `basicACL` at all, and treats every missing flag as `false`. | console: internal/api/morph_v1_buckets.go (V1CreateBucket); checked on a 0.30.1 node, 2026-11-18 | | `delete` is not required in an ACL group; a missing flag is `false`. | console: internal/api/morph_v1_buckets.go; checked on a 0.30.1 node, 2026-11-18 | | `softQuota` and `hardQuota` are not required; a field left out is set to `0`. | console: internal/api/morph_v1_users.go (V1SetUserQuota); checked on a 0.30.1 node, 2026-11-18 | | `uptime` in the cluster metrics is always 0 in this release. | console: internal/neofs/metrics/metrics.go (convertNodes sets no uptime); checked on a 0.30.1 node, 2026-11-18 | | `mountPoint` in the cluster metrics is always empty in this release. | console: internal/neofs/metrics/metrics.go (convertNodes); checked on a 0.30.1 node, 2026-11-18 | | `usedSpace` in the cluster metrics is always 0 in this release. | console: internal/neofs/metrics/metrics.go (convertNodes sets only Total); checked on a 0.30.1 node, 2026-11-18 | | `availSpace` in the cluster metrics is always 0 in this release. | console: internal/neofs/metrics/metrics.go (convertNodes); checked on a 0.30.1 node, 2026-11-18 | ## Operations ### Users Page: [Users](users.md). | Method | Path | Summary | |---|---|---| | `POST` | [`/v1/users/{user}`](users.md#post-v1-users-user) | Deprecated. Use `POST /v1/users` with the user name in the request body instead. | | `PUT` | [`/v1/users/{user}`](users.md#put-v1-users-user) | Update existing user. | | `GET` | [`/v1/users/{user}`](users.md#get-v1-users-user) | Get user meta. | | `DELETE` | [`/v1/users/{user}`](users.md#delete-v1-users-user) | Delete a user. | | `PUT` | [`/v1/users/{user}/quota`](users.md#put-v1-users-user-quota) | Set user storage quota. | | `POST` | [`/v1/users/{user}/quota`](users.md#post-v1-users-user-quota) | Deprecated. Use `PUT /v1/users/{user}/quota` instead. | | `GET` | [`/v1/users/{user}/s3-tokens`](users.md#get-v1-users-user-s3-tokens) | List a user's S3 token identifiers. | | `POST` | [`/v1/users/{user}/s3-tokens`](users.md#post-v1-users-user-s3-tokens) | Generate s3 access tokens. | | `GET` | [`/v1/users/{user}/s3-tokens/{token}`](users.md#get-v1-users-user-s3-tokens-token) | Get a user's S3 token details. | | `DELETE` | [`/v1/users/{user}/s3-tokens/{token}`](users.md#delete-v1-users-user-s3-tokens-token) | Revoke s3 token. | | `GET` | [`/v1/users/{user}/tokens`](users.md#get-v1-users-user-tokens) | List a user's Bearer token identifiers. | | `POST` | [`/v1/users/{user}/tokens`](users.md#post-v1-users-user-tokens) | Generate Bearer token. | | `GET` | [`/v1/users/{user}/tokens/{token}`](users.md#get-v1-users-user-tokens-token) | Get a user's Bearer token details. | | `DELETE` | [`/v1/users/{user}/tokens/{token}`](users.md#delete-v1-users-user-tokens-token) | Revoke Bearer token. | | `POST` | [`/v1/users`](users.md#post-v1-users) | Register a new user. | | `GET` | [`/v1/users`](users.md#get-v1-users) | Get user list. | | `GET` | [`/v1/users/{user}/storage-policies`](users.md#get-v1-users-user-storage-policies) | List a user's storage policies. | | `POST` | [`/v1/users/{user}/storage-policies`](users.md#post-v1-users-user-storage-policies) | Create storage policy. | | `GET` | [`/v1/users/{user}/storage-policies/{policyName}`](users.md#get-v1-users-user-storage-policies-policyname) | Get a user's storage policy by name. | | `PUT` | [`/v1/users/{user}/storage-policies/{policyName}`](users.md#put-v1-users-user-storage-policies-policyname) | Update storage policy. | | `DELETE` | [`/v1/users/{user}/storage-policies/{policyName}`](users.md#delete-v1-users-user-storage-policies-policyname) | Delete storage policy. | | `GET` | [`/v1/users/{user}/metrics`](users.md#get-v1-users-user-metrics) | Get user metrics. | | `GET` | [`/v1/users/{user}/pending-transfers`](users.md#get-v1-users-user-pending-transfers) | List pending bucket transfer requests addressed to a user. | | `POST` | [`/v1/users/{user}/pending-transfers/{id}`](users.md#post-v1-users-user-pending-transfers-id) | Apply some action to a pending bucket transfer request by ID. | ### Login Page: [Login](login.md). | Method | Path | Summary | |---|---|---| | `POST` | [`/v1/login`](login.md#post-v1-login) | Login via username and password. | ### Buckets Page: [Buckets](buckets.md). | Method | Path | Summary | |---|---|---| | `POST` | [`/v1/buckets`](buckets.md#post-v1-buckets) | Create a new bucket. | | `GET` | [`/v1/buckets`](buckets.md#get-v1-buckets) | List buckets owned by the requested user. | | `GET` | [`/v1/buckets/{bucket}`](buckets.md#get-v1-buckets-bucket) | Get bucket information by name. | | `DELETE` | [`/v1/buckets/{bucket}`](buckets.md#delete-v1-buckets-bucket) | Delete a bucket from the system. | | `PUT` | [`/v1/buckets/{bucket}/eacl`](buckets.md#put-v1-buckets-bucket-eacl) | Set EACL to the bucket. | | `GET` | [`/v1/buckets/{bucket}/eacl`](buckets.md#get-v1-buckets-bucket-eacl) | Get bucket EACL. | | `PUT` | [`/v1/buckets/{bucket}/quota`](buckets.md#put-v1-buckets-bucket-quota) | Set bucket quota. | | `GET` | [`/v1/buckets/{bucket}/quota`](buckets.md#get-v1-buckets-bucket-quota) | Get bucket quota. | | `PUT` | [`/v1/buckets/{bucket}/timelock`](buckets.md#put-v1-buckets-bucket-timelock) | Set bucket lock time. | | `GET` | [`/v1/buckets/{bucket}/timelock`](buckets.md#get-v1-buckets-bucket-timelock) | Get bucket lock time. | | `POST` | [`/v1/buckets/{bucket}/transfer`](buckets.md#post-v1-buckets-bucket-transfer) | Create a new bucket transfer request addressed to a recipient. | | `POST` | [`/v1/buckets/{bucket}/access-tokens`](buckets.md#post-v1-buckets-bucket-access-tokens) | Generate an access token which can be used for access sharing. | | `POST` | [`/v1/buckets/{bucket}/objects`](buckets.md#post-v1-buckets-bucket-objects) | Uploads a new object into the specified bucket. | | `GET` | [`/v1/buckets/{bucket}/objects`](buckets.md#get-v1-buckets-bucket-objects) | List all objects in the bucket with brief metadata. | | `POST` | [`/v1/buckets/{bucket}/objects/search`](buckets.md#post-v1-buckets-bucket-objects-search) | Search for objects in the bucket using structured filters. | | `DELETE` | [`/v1/buckets/{bucket}/objects/{object}`](buckets.md#delete-v1-buckets-bucket-objects-object) | Delete an object from the bucket. | | `GET` | [`/v1/buckets/{bucket}/objects/{object}`](buckets.md#get-v1-buckets-bucket-objects-object) | Download object data. | | `HEAD` | [`/v1/buckets/{bucket}/objects/{object}`](buckets.md#head-v1-buckets-bucket-objects-object) | Get object metadata. | ### Cluster Page: [Cluster](cluster.md). | Method | Path | Summary | |---|---|---| | `GET` | [`/v1/cluster/default-quota`](cluster.md#get-v1-cluster-default-quota) | Get the default storage quota applied to users created in the selected namespace. | | `PUT` | [`/v1/cluster/default-quota`](cluster.md#put-v1-cluster-default-quota) | Set the default storage quota applied to users subsequently created in the selected namespace. | | `POST` | [`/v1/cluster/default-quota`](cluster.md#post-v1-cluster-default-quota) | Deprecated. Use `PUT /v1/cluster/default-quota` instead. | | `GET` | [`/v1/cluster/metrics`](cluster.md#get-v1-cluster-metrics) | Scrape system metrics. | | `GET` | [`/v1/cluster/storage-nodes`](cluster.md#get-v1-cluster-storage-nodes) | List storage nodes in the current NetMap snapshot. | | `POST` | [`/v1/cluster/storage-nodes`](cluster.md#post-v1-cluster-storage-nodes) | Grant a storage node access to become a network candidate. | | `GET` | [`/v1/cluster/gateways`](cluster.md#get-v1-cluster-gateways) | List registered gateway keys. | | `POST` | [`/v1/cluster/gateways`](cluster.md#post-v1-cluster-gateways) | Grant access to the gateway account and register its public key for Morph and S3. | | `DELETE` | [`/v1/cluster/storage-nodes/{address}`](cluster.md#delete-v1-cluster-storage-nodes-address) | Decommission a storage node account. | | `DELETE` | [`/v1/cluster/gateways/{address}`](cluster.md#delete-v1-cluster-gateways-address) | Decommission a registered gateway account. | | `POST` | [`/v1/cluster/storage-node`](cluster.md#post-v1-cluster-storage-node) | Deprecated grant endpoint. | | `GET` | [`/v1/cluster/storage-policies`](cluster.md#get-v1-cluster-storage-policies) | Get system storage policies. | | `POST` | [`/v1/cluster/storage-policies`](cluster.md#post-v1-cluster-storage-policies) | Create storage policy. | | `GET` | [`/v1/cluster/storage-policies/{policyName}`](cluster.md#get-v1-cluster-storage-policies-policyname) | Get system storage policy by name. | | `PUT` | [`/v1/cluster/storage-policies/{policyName}`](cluster.md#put-v1-cluster-storage-policies-policyname) | Update system storage policy. | | `DELETE` | [`/v1/cluster/storage-policies/{policyName}`](cluster.md#delete-v1-cluster-storage-policies-policyname) | Delete system storage policy. | | `GET` | [`/v1/cluster/ir-keys`](cluster.md#get-v1-cluster-ir-keys) | Get Inner Ring public keys. | | `POST` | [`/v1/cluster/license`](cluster.md#post-v1-cluster-license) | Upload license. | | `GET` | [`/v1/cluster/license`](cluster.md#get-v1-cluster-license) | Get brief license metadata. | | `POST` | [`/v1/cluster/oauth`](cluster.md#post-v1-cluster-oauth) | Create a new OAuth provider in the selected namespace. | | `GET` | [`/v1/cluster/oauth`](cluster.md#get-v1-cluster-oauth) | List all OAuth providers in the selected namespace. | | `PUT` | [`/v1/cluster/oauth/{providerID}`](cluster.md#put-v1-cluster-oauth-providerid) | Update an existing OAuth provider in the selected namespace. | | `DELETE` | [`/v1/cluster/oauth/{providerID}`](cluster.md#delete-v1-cluster-oauth-providerid) | Delete OAuth provider from the selected namespace. | | `GET` | [`/v1/cluster/oauth/{providerID}`](cluster.md#get-v1-cluster-oauth-providerid) | Get OAuth provider from the selected namespace. | | `POST` | [`/v1/cluster/saml`](cluster.md#post-v1-cluster-saml) | Create a new SAML provider in the selected namespace. | | `GET` | [`/v1/cluster/saml`](cluster.md#get-v1-cluster-saml) | List all SAML providers in the selected namespace. | | `PUT` | [`/v1/cluster/saml/{providerID}`](cluster.md#put-v1-cluster-saml-providerid) | Update an existing SAML provider in the selected namespace. | | `DELETE` | [`/v1/cluster/saml/{providerID}`](cluster.md#delete-v1-cluster-saml-providerid) | Delete SAML provider from the selected namespace. | | `GET` | [`/v1/cluster/saml/{providerID}`](cluster.md#get-v1-cluster-saml-providerid) | Get SAML provider from the selected namespace. | | `POST` | [`/v1/cluster/namespaces`](cluster.md#post-v1-cluster-namespaces) | Create a new namespace. | | `GET` | [`/v1/cluster/namespaces`](cluster.md#get-v1-cluster-namespaces) | List all namespaces. | | `GET` | [`/v1/cluster/namespaces/{namespace}`](cluster.md#get-v1-cluster-namespaces-namespace) | Get information about the namespace by name. | | `DELETE` | [`/v1/cluster/namespaces/{namespace}`](cluster.md#delete-v1-cluster-namespaces-namespace) | Delete namespace from the system. | ### OAuth Page: [OAuth](oauth.md). | Method | Path | Summary | |---|---|---| | `GET` | [`/v1/oauth/{providerID}/login`](oauth.md#get-v1-oauth-providerid-login) | Login using OAuth provider. | | `GET` | [`/v1/oauth/callback`](oauth.md#get-v1-oauth-callback) | OAuth provider callback. | ### SAML Page: [SAML](saml.md). | Method | Path | Summary | |---|---|---| | `GET` | [`/v1/saml/{providerID}/login`](saml.md#get-v1-saml-providerid-login) | Login using SAML provider. | | `POST` | [`/v1/saml/{providerID}/acs`](saml.md#post-v1-saml-providerid-acs) | ACS route for IDP provider. | | `GET` | [`/v1/saml/{providerID}/metadata`](saml.md#get-v1-saml-providerid-metadata) | Get SP metadata. | --- # Users Operations of the Morph REST API in the group `users`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` - `TOKEN`: bearer token - `TOKEN_ID`: value of the `token` path parameter - `POLICY_NAME`: value of the `policyName` path parameter - `TRANSFER_ID`: value of the `id` path parameter | Operation | Summary | |---|---| | [`POST /v1/users/{user}`](#post-v1-users-user) | Deprecated. Use `POST /v1/users` with the user name in the request body instead. | | [`PUT /v1/users/{user}`](#put-v1-users-user) | Update existing user. | | [`GET /v1/users/{user}`](#get-v1-users-user) | Get user meta. | | [`DELETE /v1/users/{user}`](#delete-v1-users-user) | Delete a user. | | [`PUT /v1/users/{user}/quota`](#put-v1-users-user-quota) | Set user storage quota. | | [`POST /v1/users/{user}/quota`](#post-v1-users-user-quota) | Deprecated. Use `PUT /v1/users/{user}/quota` instead. | | [`GET /v1/users/{user}/s3-tokens`](#get-v1-users-user-s3-tokens) | List a user's S3 token identifiers. | | [`POST /v1/users/{user}/s3-tokens`](#post-v1-users-user-s3-tokens) | Generate s3 access tokens. | | [`GET /v1/users/{user}/s3-tokens/{token}`](#get-v1-users-user-s3-tokens-token) | Get a user's S3 token details. | | [`DELETE /v1/users/{user}/s3-tokens/{token}`](#delete-v1-users-user-s3-tokens-token) | Revoke s3 token. | | [`GET /v1/users/{user}/tokens`](#get-v1-users-user-tokens) | List a user's Bearer token identifiers. | | [`POST /v1/users/{user}/tokens`](#post-v1-users-user-tokens) | Generate Bearer token. | | [`GET /v1/users/{user}/tokens/{token}`](#get-v1-users-user-tokens-token) | Get a user's Bearer token details. | | [`DELETE /v1/users/{user}/tokens/{token}`](#delete-v1-users-user-tokens-token) | Revoke Bearer token. | | [`POST /v1/users`](#post-v1-users) | Register a new user. | | [`GET /v1/users`](#get-v1-users) | Get user list. | | [`GET /v1/users/{user}/storage-policies`](#get-v1-users-user-storage-policies) | List a user's storage policies. | | [`POST /v1/users/{user}/storage-policies`](#post-v1-users-user-storage-policies) | Create storage policy. | | [`GET /v1/users/{user}/storage-policies/{policyName}`](#get-v1-users-user-storage-policies-policyname) | Get a user's storage policy by name. | | [`PUT /v1/users/{user}/storage-policies/{policyName}`](#put-v1-users-user-storage-policies-policyname) | Update storage policy. | | [`DELETE /v1/users/{user}/storage-policies/{policyName}`](#delete-v1-users-user-storage-policies-policyname) | Delete storage policy. | | [`GET /v1/users/{user}/metrics`](#get-v1-users-user-metrics) | Get user metrics. | | [`GET /v1/users/{user}/pending-transfers`](#get-v1-users-user-pending-transfers) | List pending bucket transfer requests addressed to a user. | | [`POST /v1/users/{user}/pending-transfers/{id}`](#post-v1-users-user-pending-transfers-id) | Apply some action to a pending bucket transfer request by ID. | ## POST /v1/users/{user} {#post-v1-users-user} **Deprecated.** The specification marks this operation as deprecated. Deprecated. Use `POST /v1/users` with the user name in the request body instead. This method will be removed in a future version. Register a new user. This method should also be used to register the first admin. In the case of the first admin, authentication is not required. Operation ID: `v1RegisterUserDeprecated` **Authentication**: Optional (`BearerAuth`). The specification accepts the request with or without credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1UpdateUserRequest](schemas.md#v1updateuserrequest). | Field | Type | Required | Description | |---|---|---|---| | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | | `password` | string | yes | User's new password. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | User successfully registered. | `Location` | - | | `400` | Passed account data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | User with this name already registered. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created user. Example: `/api/v1/users/USER_NAME`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "role": "admin", "password": "CreateYourOwnPassword" }' ``` ## PUT /v1/users/{user} {#put-v1-users-user} Update existing user. Operation ID: `v1UpdateUser` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: object. | Field | Type | Required | Description | |---|---|---|---| | `role` | [UserRole](schemas.md#userrole) | no | New role. Optional: leave it out to keep the role. Only an administrator may send it, also when the value does not change. Constraints: one of `user`, `admin`. | | `password` | string | no | New password. Optional: leave it out to keep the password. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | User successfully updated. | - | - | | `400` | Passed account data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | User not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/users/first-admin" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "password": "CreateYourOwnPassword" }' ``` ## GET /v1/users/{user} {#get-v1-users-user} Get user meta. Operation ID: `v1GetUser` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | User found. | - | [V1GetUserResponse](schemas.md#v1getuserresponse) (`application/json`) | | `400` | The namespace named in `X-Morph-Namespace` does not exist. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | The token does not allow selecting the namespace named in `X-Morph-Namespace`. | - | - | | `404` | User not found. | - | - | Body of the `200` response (`application/json`), schema [V1GetUserResponse](schemas.md#v1getuserresponse): | Field | Type | Required | Description | |---|---|---|---| | `storageHardQuota` | integer (uint64) | yes | User's storage hard quota for all their buckets, in bytes. A zero value means unlimited. | | `storageSoftQuota` | integer (uint64) | yes | User's storage soft quota for all their buckets, in bytes. A zero value means unlimited. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/users/{user} {#delete-v1-users-user} Delete a user. Operation ID: `v1DeleteUser` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | User successfully deleted. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | User not found. | - | - | | `409` | User removal is not allowed. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/users/first-admin" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/users/{user}/quota {#put-v1-users-user-quota} Set user storage quota. Operation ID: `v1SetUserStorageQuota` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [SetStorageQuotaRequest](schemas.md#setstoragequotarequest). | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | User quota successfully changed. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | User not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/users/first-admin/quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## POST /v1/users/{user}/quota {#post-v1-users-user-quota} **Deprecated.** The specification marks this operation as deprecated. Deprecated. Use `PUT /v1/users/{user}/quota` instead. This method will be removed in a future version. Change user storage quota. Operation ID: `v1SetUserStorageQuotaDeprecated` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [SetStorageQuotaRequest](schemas.md#setstoragequotarequest). | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | User quota successfully changed. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | User not found. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin/quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## GET /v1/users/{user}/s3-tokens {#get-v1-users-user-s3-tokens} List a user's S3 token identifiers. The owner or an authorized administrator can view them. Operation ID: `v1S3GetAccessTokens` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of items in the response. Negative values and values above 100 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 100; default `100`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [S3GetAccessTokensResponse](schemas.md#s3getaccesstokensresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [S3GetAccessTokensResponse](schemas.md#s3getaccesstokensresponse): | Field | Type | Required | Description | |---|---|---|---| | `tokens` | array of [S3TokenInfo](schemas.md#s3tokeninfo) | yes | Tokens list. | | `tokens[].id` | string | yes | Token ID. | | `tokens[].name` | string | yes | User-defined token name. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/s3-tokens" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/users/{user}/s3-tokens {#post-v1-users-user-s3-tokens} Generate s3 access tokens. Operation ID: `v1S3CreateAccessToken` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | **Request body** Media type `application/json`, schema: [S3CreateAccessTokenRequest](schemas.md#s3createaccesstokenrequest). | Field | Type | Required | Description | |---|---|---|---| | `ttl` | string | no | The value can be set as a duration or a date. Token lifetime is measured in real time. Constraints: default `"30 days."`. Example: `10m - 10 minutes. 24h - 24 hours. 48h - 2 days. Use format "2024-10-23 15:04:05" to set the date instead of duration.`. | | `createBucket` | boolean | no | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | no | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | no | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `bucketName` | string | no | When set to a non-empty value, this restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `tokenName` | string | yes | User defined token name. It may contain "a-z", "A-Z", "0-9", ".", "-", " ". Constraints: maximum length 256. | | `read` | boolean | no | Flag allowing to read objects with this token. Constraints: default `true`. | | `modify` | boolean | no | Flag allowing to create and delete objects with this token. Constraints: default `true`. | | `manageSettings` | boolean | no | Flag allowing to manage S3 bucket cors, tags, notifications, ownerships and locks with this token. Constraints: default `true`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [S3CreateAccessTokenResponse](schemas.md#s3createaccesstokenresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [S3CreateAccessTokenResponse](schemas.md#s3createaccesstokenresponse): | Field | Type | Required | Description | |---|---|---|---| | `access_key_id` | string | yes | AWS access key ID. | | `secret_access_key` | string | yes | AWS secret access Key. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin/s3-tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tokenName": "string" }' ``` ## GET /v1/users/{user}/s3-tokens/{token} {#get-v1-users-user-s3-tokens-token} Get a user's S3 token details. The owner or an authorized administrator can view them. Operation ID: `v1S3GetTokenDetails` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `token` | path | string | yes | Token id. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [S3GetAccessTokenDetailsResponse](schemas.md#s3getaccesstokendetailsresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Token not found. | - | - | Body of the `200` response (`application/json`), schema [S3GetAccessTokenDetailsResponse](schemas.md#s3getaccesstokendetailsresponse): | Field | Type | Required | Description | |---|---|---|---| | `token` | [S3DetailedTokenInfo](schemas.md#s3detailedtokeninfo) | yes | | | `token.createBucket` | boolean | yes | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `token.deleteBucket` | boolean | yes | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `token.setBucketEACL` | boolean | yes | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `token.expiresAt` | string (date-time) | yes | Estimated time when token will expire in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `token.createdAt` | string (date-time) | yes | Time when token was issued in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `token.name` | string | yes | User-defined token name. | | `token.bucketName` | string | yes | When set to non empty value, it restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `token.read` | boolean | yes | Flag allowing to read objects with this token. Constraints: default `true`. | | `token.modify` | boolean | yes | Flag allowing to create and delete objects with this token. Constraints: default `true`. | | `token.manageSettings` | boolean | yes | Flag allowing to manage S3 bucket cors, tags, notifications, ownerships and locks with this token. Constraints: default `true`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/s3-tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/users/{user}/s3-tokens/{token} {#delete-v1-users-user-s3-tokens-token} Revoke s3 token. Operation ID: `v1S3RevokeToken` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `token` | path | string | yes | Token id. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | The token has been revoked. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Token not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/users/first-admin/s3-tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/users/{user}/tokens {#get-v1-users-user-tokens} List a user's Bearer token identifiers. The owner or an authorized administrator can view them. Operation ID: `v1GetBearerTokens` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `type` | query | [TokenType](schemas.md#tokentype) | no | Optional filter by token type. If omitted, returns all token types. Constraints: one of `session`, `pat`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of items in the response. Negative values and values above 100 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 100; default `100`. | Example values of `type`: | Value | Meaning | |---|---| | `session` | | | `pat` | | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetBearerTokensResponse](schemas.md#getbearertokensresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [GetBearerTokensResponse](schemas.md#getbearertokensresponse): | Field | Type | Required | Description | |---|---|---|---| | `tokens` | array of [BearerTokenInfo](schemas.md#bearertokeninfo) | yes | Bearer tokens list. | | `tokens[].id` | string | yes | Token ID. | | `tokens[].name` | string | yes | User-defined token name. | | `tokens[].type` | [TokenType](schemas.md#tokentype) | no | Token type. Constraints: one of `session`, `pat`. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/tokens" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/users/{user}/tokens {#post-v1-users-user-tokens} Generate Bearer token. Operation ID: `v1CreateBearerToken` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | **Request body** Media type `application/json`, schema: [CreateBearerTokenRequest](schemas.md#createbearertokenrequest). | Field | Type | Required | Description | |---|---|---|---| | `ttl` | string | no | The value can be set as a duration or a date. Token lifetime is measured in real time. Constraints: default `"30 days."`. Example: `10m - 10 minutes. 24h - 24 hours. 48h - 2 days. Use format "2024-10-23 15:04:05" to set the date instead of duration.`. | | `createBucket` | boolean | no | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | no | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | no | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `bucketName` | string | no | When set to a non-empty value, this restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `tokenName` | string | yes | User defined token name. It may contain "a-z", "A-Z", "0-9", ".", "-", " ". Constraints: maximum length 256. | | `get` | boolean | no | Flag allowing GET object operation (read object payload) with this token. Addressing an object by FilePath additionally requires SEARCH. Constraints: default `true`. | | `head` | boolean | no | Flag allowing HEAD object operation (read object headers) with this token. Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. Constraints: default `true`. | | `put` | boolean | no | Flag allowing PUT object operation (create objects) with this token. Constraints: default `true`. | | `delete` | boolean | no | Flag allowing DELETE object operation with this token. Addressing an object by FilePath additionally requires SEARCH. Constraints: default `true`. | | `search` | boolean | no | Flag allowing SEARCH object operation with this token. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. Note that `deleteBucket` enables this operation as well. Constraints: default `true`. | | `readContent` | boolean | no | **Deprecated.** Use Get instead. Flag allowing to read objects with this token. Deprecated, use get instead. Ignored if get is set. Constraints: default `true`. | | `readHeaders` | boolean | no | **Deprecated.** Use Head and Search instead. Flag allowing to read headers objects with this token. Deprecated, use head and search instead. `head` overrides it for HEAD, `search` overrides it for SEARCH. Constraints: default `true`. | | `create` | boolean | no | **Deprecated.** Use Put instead. Flag allowing to create objects with this token. Deprecated, use put instead. Ignored if put is set. Constraints: default `true`. | | `registerUser` | boolean | no | When set to true, this token grants permission to register a new user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateUser` | boolean | no | When set to true, this token grants permission to update an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteUser` | boolean | no | When set to true, this token grants permission to delete an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listUser` | boolean | no | When set to true, this token grants permission to list users. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setUserQuota` | boolean | no | When set to true, this token grants permission to set user storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setDefaultStorageQuota` | boolean | no | When set to true, this token grants permission to set default storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `getUserPolicies` | boolean | no | When set to true, this token grants permission to get user storage policies. Constraints: default `false`. | | `createUserPolicy` | boolean | no | When set to true, this token grants permission to create user storage policy. Constraints: default `false`. | | `updateUserPolicy` | boolean | no | When set to true, this token grants permission to update user storage policy. Constraints: default `false`. | | `getUserPolicy` | boolean | no | When set to true, this token grants permission to get user storage policy. Constraints: default `false`. | | `deleteUserPolicy` | boolean | no | When set to true, this token grants permission to delete user storage policy. Constraints: default `false`. | | `createSystemPolicy` | boolean | no | When set to true, this token grants permission to create system storage policy. This option is available to global admins only. Constraints: default `false`. | | `updateSystemPolicy` | boolean | no | When set to true, this token grants permission to update system storage policy. This option is available to global admins only. Constraints: default `false`. | | `deleteSystemPolicy` | boolean | no | When set to true, this token grants permission to delete system storage policy. This option is available to global admins only. Constraints: default `false`. | | `s3GetTokens` | boolean | no | When set to true, this token grants permission to get S3 access tokens. Constraints: default `false`. | | `s3CreateToken` | boolean | no | When set to true, this token grants permission to create S3 access token. Constraints: default `false`. | | `s3TokenDetails` | boolean | no | When set to true, this token grants permission to get S3 access token details. Constraints: default `false`. | | `s3RevokeToken` | boolean | no | When set to true, this token grants permission to revoke S3 access token. Constraints: default `false`. | | `getBearerTokens` | boolean | no | When set to true, this token grants permission to get Bearer tokens. Constraints: default `false`. | | `createBearerToken` | boolean | no | When set to true, this token grants permission to create Bearer token. Constraints: default `false`. | | `bearerTokenDetails` | boolean | no | When set to true, this token grants permission to get Bearer token details. Constraints: default `false`. | | `revokeBearerToken` | boolean | no | When set to true, this token grants permission to revoke Bearer token. Constraints: default `false`. | | `createOAuthProvider` | boolean | no | When set to true, this token grants permission to create OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateOAuthProvider` | boolean | no | When set to true, this token grants permission to update OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteOAuthProvider` | boolean | no | When set to true, this token grants permission to delete OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `uploadLicense` | boolean | no | When set to true, this token grants permission to upload license. This option is available to global admins only. Constraints: default `false`. | | `getLicense` | boolean | no | When set to true, this token grants permission to get license metadata. This option is available to global admins only. Constraints: default `false`. | | `getIRPublicKeys` | boolean | no | When set to true, this token grants permission to get IR public keys. This option is available to global admins only. Constraints: default `false`. | | `getUserMetrics` | boolean | no | When set to true, this token grants permission to get user metrics. This option is available to admins only. Constraints: default `false`. | | `createSAMLProvider` | boolean | no | When set to true, this token grants permission to create SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateSAMLProvider` | boolean | no | When set to true, this token grants permission to update SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteSAMLProvider` | boolean | no | When set to true, this token grants permission to delete SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listBucketTransfers` | boolean | no | When set to true, this token grants permission to list user bucket transfers. Constraints: default `false`. | | `createNamespace` | boolean | no | When set to true, this token grants permission to create namespace. This option is available to global admins only. Constraints: default `false`. | | `getNamespace` | boolean | no | When set to true, this token grants permission to get namespace. This option is available to global admins only. Constraints: default `false`. | | `listNamespaces` | boolean | no | When set to true, this token grants permission to list namespaces. This option is available to global admins only. Constraints: default `false`. | | `deleteNamespace` | boolean | no | When set to true, this token grants permission to delete namespace. This option is available to global admins only. Constraints: default `false`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [CreateBearerTokenResponse](schemas.md#createbearertokenresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [CreateBearerTokenResponse](schemas.md#createbearertokenresponse): | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Bearer token. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin/tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tokenName": "string" }' ``` ## GET /v1/users/{user}/tokens/{token} {#get-v1-users-user-tokens-token} Get a user's Bearer token details. The owner or an authorized administrator can view them. Operation ID: `v1GetBearerTokenDetails` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `token` | path | string | yes | Token id. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetBearerTokenDetailsResponse](schemas.md#getbearertokendetailsresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Token not found. | - | - | Body of the `200` response (`application/json`), schema [GetBearerTokenDetailsResponse](schemas.md#getbearertokendetailsresponse): | Field | Type | Required | Description | |---|---|---|---| | `token` | [DetailedBearerTokenInfo](schemas.md#detailedbearertokeninfo) | yes | | | `token.createBucket` | boolean | yes | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `token.deleteBucket` | boolean | yes | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `token.setBucketEACL` | boolean | yes | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `token.expiresAt` | string (date-time) | yes | Estimated time when token will expire in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `token.createdAt` | string (date-time) | yes | Time when token was issued in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `token.name` | string | yes | User-defined token name. | | `token.bucketName` | string | yes | When set to non empty value, it restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `token.get` | boolean | yes | When set to true, this token grants permission for GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `token.head` | boolean | yes | When set to true, this token grants permission for HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `token.put` | boolean | yes | When set to true, this token grants permission for PUT object operation (create objects). | | `token.delete` | boolean | yes | When set to true, this token grants permission for DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `token.search` | boolean | yes | When set to true, this token grants permission for SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. Reflects the requested flag only, SEARCH is also granted if `deleteBucket` is set. | | `token.readContent` | boolean | yes | **Deprecated.** Use Get instead. When set to true, this token grants permission to read objects. Deprecated, use get instead. | | `token.readHeaders` | boolean | yes | **Deprecated.** Use Head and Search instead. When set to true, this token grants permission to read objects headers. Deprecated, use head and search instead. | | `token.create` | boolean | yes | **Deprecated.** Use Put instead. When set to true, this token grants permission to create objects. Deprecated, use put instead. | | `token.registerUser` | boolean | yes | When set to true, this token grants permission to register a new user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.updateUser` | boolean | yes | When set to true, this token grants permission to update an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.deleteUser` | boolean | yes | When set to true, this token grants permission to delete an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.listUser` | boolean | yes | When set to true, this token grants permission to list users. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.setUserQuota` | boolean | yes | When set to true, this token grants permission to set user storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.setDefaultStorageQuota` | boolean | yes | When set to true, this token grants permission to set default storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.getUserPolicies` | boolean | yes | When set to true, this token grants permission to get user storage policies. Constraints: default `false`. | | `token.createUserPolicy` | boolean | yes | When set to true, this token grants permission to create user storage policy. Constraints: default `false`. | | `token.updateUserPolicy` | boolean | yes | When set to true, this token grants permission to update user storage policy. Constraints: default `false`. | | `token.getUserPolicy` | boolean | yes | When set to true, this token grants permission to get user storage policy. Constraints: default `false`. | | `token.deleteUserPolicy` | boolean | yes | When set to true, this token grants permission to delete user storage policy. Constraints: default `false`. | | `token.createSystemPolicy` | boolean | yes | When set to true, this token grants permission to create system storage policy. This option is available to global admins only. Constraints: default `false`. | | `token.updateSystemPolicy` | boolean | yes | When set to true, this token grants permission to update system storage policy. This option is available to global admins only. Constraints: default `false`. | | `token.deleteSystemPolicy` | boolean | yes | When set to true, this token grants permission to delete system storage policy. This option is available to global admins only. Constraints: default `false`. | | `token.s3GetTokens` | boolean | yes | When set to true, this token grants permission to get S3 access tokens. Constraints: default `false`. | | `token.s3CreateToken` | boolean | yes | When set to true, this token grants permission to create S3 access token. Constraints: default `false`. | | `token.s3TokenDetails` | boolean | yes | When set to true, this token grants permission to get S3 access token details. Constraints: default `false`. | | `token.s3RevokeToken` | boolean | yes | When set to true, this token grants permission to revoke S3 access token. Constraints: default `false`. | | `token.getBearerTokens` | boolean | yes | When set to true, this token grants permission to get Bearer tokens. Constraints: default `false`. | | `token.createBearerToken` | boolean | yes | When set to true, this token grants permission to create Bearer token. Constraints: default `false`. | | `token.bearerTokenDetails` | boolean | yes | When set to true, this token grants permission to get Bearer token details. Constraints: default `false`. | | `token.revokeBearerToken` | boolean | yes | When set to true, this token grants permission to revoke Bearer token. Constraints: default `false`. | | `token.createOAuthProvider` | boolean | yes | When set to true, this token grants permission to create OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.updateOAuthProvider` | boolean | yes | When set to true, this token grants permission to update OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.deleteOAuthProvider` | boolean | yes | When set to true, this token grants permission to delete OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.uploadLicense` | boolean | yes | When set to true, this token grants permission to upload license. This option is available to global admins only. Constraints: default `false`. | | `token.getLicense` | boolean | yes | When set to true, this token grants permission to get license metadata. This option is available to global admins only. Constraints: default `false`. | | `token.getIRPublicKeys` | boolean | yes | When set to true, this token grants permission to get IR public keys. This option is available to global admins only. Constraints: default `false`. | | `token.getUserMetrics` | boolean | yes | When set to true, this token grants permission to get user metrics. This option is available to admins only. Constraints: default `false`. | | `token.createSAMLProvider` | boolean | yes | When set to true, this token grants permission to create SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.updateSAMLProvider` | boolean | yes | When set to true, this token grants permission to update SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.deleteSAMLProvider` | boolean | yes | When set to true, this token grants permission to delete SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `token.listBucketTransfers` | boolean | yes | When set to true, this token grants permission to list user bucket transfers. Constraints: default `false`. | | `token.createNamespace` | boolean | yes | When set to true, this token grants permission to create namespace. This option is available to global admins only. Constraints: default `false`. | | `token.getNamespace` | boolean | yes | When set to true, this token grants permission to get namespace. This option is available to global admins only. Constraints: default `false`. | | `token.listNamespaces` | boolean | yes | When set to true, this token grants permission to list namespaces. This option is available to global admins only. Constraints: default `false`. | | `token.deleteNamespace` | boolean | yes | When set to true, this token grants permission to delete namespace. This option is available to global admins only. Constraints: default `false`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/users/{user}/tokens/{token} {#delete-v1-users-user-tokens-token} Revoke Bearer token. Operation ID: `V1RevokeBearerToken` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `token` | path | string | yes | Token id. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | The token has been revoked. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Token not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/users/first-admin/tokens/$TOKEN_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/users {#post-v1-users} Register a new user. This method should also be used to register the first admin. In the case of the first admin, authentication is not required. Operation ID: `v1RegisterUser` **Authentication**: Optional (`BearerAuth`). The specification accepts the request with or without credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1RegisterUserRequest](schemas.md#v1registeruserrequest). | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | User name. Constraints: maximum length 53. Example: `mike`. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | | `password` | string | yes | User's password. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | User successfully registered. | `Location` | - | | `400` | Passed account data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | User with this name already registered. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created user. Example: `/api/v1/users/USER_NAME`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "mike", "role": "user", "password": "string" }' ``` ## GET /v1/users {#get-v1-users} Get user list. Authentication is not required only before the cluster is initialized (if there are no registered users in any namespace). Operation ID: `v1GetUserList` **Authentication**: Optional (`BearerAuth`). The specification accepts the request with or without credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of items in the response. Negative values and values above 100 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 100; default `100`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | List of users in system. | - | [GetUserListResponse](schemas.md#getuserlistresponse) (`application/json`) | | `400` | Bearer token required because the cluster is initialized, or cursor or maxItems is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [GetUserListResponse](schemas.md#getuserlistresponse): | Field | Type | Required | Description | |---|---|---|---| | `users` | array of [User](schemas.md#user) | yes | Users list. | | `users[].name` | string | yes | User name. | | `users[].role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | | `totalCount` | integer (uint64) | yes | Total number of users in the namespace. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/users/{user}/storage-policies {#get-v1-users-user-storage-policies} List a user's storage policies. The owner or an authorized administrator can view them. Operation ID: `v1GetUserStoragePolicies` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Storage policies found. | - | [V1GetUserStoragePoliciesResponse](schemas.md#v1getuserstoragepoliciesresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [V1GetUserStoragePoliciesResponse](schemas.md#v1getuserstoragepoliciesresponse): | Field | Type | Required | Description | |---|---|---|---| | `policies` | array of [NamedStoragePolicy](schemas.md#namedstoragepolicy) | yes | Storage policy list. | | `policies[].policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policies[].policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policies[].policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policies[].policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policies[].policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policies[].policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policies[].policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policies[].policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policies[].policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policies[].policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policies[].policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policies[].policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policies[].policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policies[].policy.filters[].key` | string | yes | Key to filter. | | `policies[].policy.filters[].op` | string | yes | Filtering operation. | | `policies[].policy.filters[].value` | string | yes | Value to match. | | `policies[].policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policies[].policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policies[].policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policies[].policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policies[].policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policies[].policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policies[].policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policies[].policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policies[].policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `policies[].name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `policies[].consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `policies[].default` | boolean | no | The flag indicates if the policy is the default. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/storage-policies" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/users/{user}/storage-policies {#post-v1-users-user-storage-policies} Create storage policy. Operation ID: `v1CreateUserStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1CreateUserStoragePolicyRequest](schemas.md#v1createuserstoragepolicyrequest). | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Storage policy created. | `Location` | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | Storage policy with this name already exists. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created user storage policy. Example: `/api/v1/users/USER_NAME/storage-policies/POLICY_NAME`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin/storage-policies" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "policy": { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [] }, "name": "string" }' ``` ## GET /v1/users/{user}/storage-policies/{policyName} {#get-v1-users-user-storage-policies-policyname} Get a user's storage policy by name. The owner or an authorized administrator can view it. Operation ID: `v1GetUserStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Storage policy found. | - | [V1GetStoragePolicyResponse](schemas.md#v1getstoragepolicyresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Policy not found. | - | - | Body of the `200` response (`application/json`), schema [V1GetStoragePolicyResponse](schemas.md#v1getstoragepolicyresponse): | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/users/{user}/storage-policies/{policyName} {#put-v1-users-user-storage-policies-policyname} Update storage policy. Operation ID: `v1UpdateUserStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1UpdateStoragePolicyRequest](schemas.md#v1updatestoragepolicyrequest). | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Storage policy updated. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/users/first-admin/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "policy": { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [] } }' ``` ## DELETE /v1/users/{user}/storage-policies/{policyName} {#delete-v1-users-user-storage-policies-policyname} Delete storage policy. Operation ID: `v1DeleteUserStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Storage policy deleted. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Storage policy not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/users/first-admin/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/users/{user}/metrics {#get-v1-users-user-metrics} Get user metrics. Operation ID: `v1GetUserMetrics` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK. | - | [GetUserMetricsResponse](schemas.md#getusermetricsresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | User not found. | - | - | Body of the `200` response (`application/json`), schema [GetUserMetricsResponse](schemas.md#getusermetricsresponse): | Field | Type | Required | Description | |---|---|---|---| | `bucketCount` | integer (uint64) | yes | Total number of buckets owned by the user. | | `usedSpace` | integer (uint64) | yes | Used space by user in bytes. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/metrics" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/users/{user}/pending-transfers {#get-v1-users-user-pending-transfers} List pending bucket transfer requests addressed to a user. The recipient or an authorized administrator can view them. Operation ID: `v1ListBucketTransfers` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [ListBucketTransfersResponse](schemas.md#listbuckettransfersresponse) (`application/json`) | | `400` | At least one parameter is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to list bucket transfers. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [ListBucketTransfersResponse](schemas.md#listbuckettransfersresponse): | Field | Type | Required | Description | |---|---|---|---| | `transfers` | array of [BucketTransfer](schemas.md#buckettransfer) | yes | | | `transfers[].id` | string | yes | Transfer ID. Constraints: minimum length 1. Example: `2b5b6d2c-44b5-4b92-8a1f-3b8a03d69c2a`. | | `transfers[].bucket` | string | yes | Bucket name. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `transfers[].senderLogin` | string | yes | Sender user login. Constraints: minimum length 1. Example: `sender`. | | `transfers[].recipientLogin` | string | yes | Recipient user login. Constraints: minimum length 1. Example: `recipient`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/users/first-admin/pending-transfers" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/users/{user}/pending-transfers/{id} {#post-v1-users-user-pending-transfers-id} Apply some action to a pending bucket transfer request by ID. Operation ID: `v1ApplyBucketTransferAction` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | path | string | yes | User name. Constraints: maximum length 53. Example: `mike, admin or any users name.`. | | `id` | path | string | yes | Bucket transfer ID. Constraints: minimum length 1. Example: `2b5b6d2c-44b5-4b92-8a1f-3b8a03d69c2a`. | | `x-morph-transfer-action` | header | string | yes | An action to apply to a bucket transfer. The only available action for now is "accept", which accepts the pending bucket transfer. Example: `accept`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Action applied. | - | - | | `400` | Transfer reference is missing or invalid, or transaction is malformed. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to apply the action. | `WWW-Authenticate` | - | | `404` | Transfer not found. | - | - | | `409` | Action has already been applied or has expired. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/users/first-admin/pending-transfers/$TRANSFER_ID" \ -H "Authorization: Bearer $TOKEN" \ -H "x-morph-transfer-action: accept" ``` --- # Login Operations of the Morph REST API in the group `login`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` | Operation | Summary | |---|---| | [`POST /v1/login`](#post-v1-login) | Login via username and password. | ## POST /v1/login {#post-v1-login} Login via username and password. Operation ID: `v1Login` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1LoginRequest](schemas.md#v1loginrequest). | Field | Type | Required | Description | |---|---|---|---| | `login` | string | yes | Account login. | | `password` | string | yes | Account password. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [V1LoginResponse](schemas.md#v1loginresponse) (`application/json`) | | `400` | Passed data is invalid. | - | - | | `403` | User not found or wrong password. | - | - | Body of the `200` response (`application/json`), schema [V1LoginResponse](schemas.md#v1loginresponse): | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Unified access token. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/login" \ -H "Content-Type: application/json" \ -d '{ "login": "string", "password": "string" }' ``` --- # Buckets Operations of the Morph REST API in the group `buckets`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` - `TOKEN`: bearer token - `FILE`: path of the file to send as the request body | Operation | Summary | |---|---| | [`POST /v1/buckets`](#post-v1-buckets) | Create a new bucket. | | [`GET /v1/buckets`](#get-v1-buckets) | List buckets owned by the requested user. | | [`GET /v1/buckets/{bucket}`](#get-v1-buckets-bucket) | Get bucket information by name. | | [`DELETE /v1/buckets/{bucket}`](#delete-v1-buckets-bucket) | Delete a bucket from the system. | | [`PUT /v1/buckets/{bucket}/eacl`](#put-v1-buckets-bucket-eacl) | Set EACL to the bucket. | | [`GET /v1/buckets/{bucket}/eacl`](#get-v1-buckets-bucket-eacl) | Get bucket EACL. | | [`PUT /v1/buckets/{bucket}/quota`](#put-v1-buckets-bucket-quota) | Set bucket quota. | | [`GET /v1/buckets/{bucket}/quota`](#get-v1-buckets-bucket-quota) | Get bucket quota. | | [`PUT /v1/buckets/{bucket}/timelock`](#put-v1-buckets-bucket-timelock) | Set bucket lock time. | | [`GET /v1/buckets/{bucket}/timelock`](#get-v1-buckets-bucket-timelock) | Get bucket lock time. | | [`POST /v1/buckets/{bucket}/transfer`](#post-v1-buckets-bucket-transfer) | Create a new bucket transfer request addressed to a recipient. | | [`POST /v1/buckets/{bucket}/access-tokens`](#post-v1-buckets-bucket-access-tokens) | Generate an access token which can be used for access sharing. | | [`POST /v1/buckets/{bucket}/objects`](#post-v1-buckets-bucket-objects) | Uploads a new object into the specified bucket. | | [`GET /v1/buckets/{bucket}/objects`](#get-v1-buckets-bucket-objects) | List all objects in the bucket with brief metadata. | | [`POST /v1/buckets/{bucket}/objects/search`](#post-v1-buckets-bucket-objects-search) | Search for objects in the bucket using structured filters. | | [`DELETE /v1/buckets/{bucket}/objects/{object}`](#delete-v1-buckets-bucket-objects-object) | Delete an object from the bucket. | | [`GET /v1/buckets/{bucket}/objects/{object}`](#get-v1-buckets-bucket-objects-object) | Download object data. | | [`HEAD /v1/buckets/{bucket}/objects/{object}`](#head-v1-buckets-bucket-objects-object) | Get object metadata. | ## POST /v1/buckets {#post-v1-buckets} Create a new bucket. Operation ID: `v1CreateBucket` **Authentication**: Required (`BearerAuth`). **Request body** Parameters of the new bucket in JSON. Required only for payload generation request. Media type `application/json`, schema: [CreateBucketRequest](schemas.md#createbucketrequest). | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `placementPolicyName` | string | yes | Placement policy name. The max policy length is 42. Constraints: minimum length 1; maximum length 42. Example: `REP-1`. | | `basicACL` | [BasicACL](schemas.md#basicacl) | yes | | | `basicACL.final` | boolean | no | Flag denying Extended ACL. Access tokens are not applicable to a final basic ACL either. | | `basicACL.disableAccessTokens` | boolean | no | Flag denying access tokens to extend the bucket permissions. Access tokens are allowed by default. Always true for final basic ACL. | | `basicACL.sticky` | boolean | no | **Deprecated.** Flag denying different owners of the request and the object. Deprecated, ignored on bucket creation. | | `basicACL.owner` | [ACLGroup](schemas.md#aclgroup) | no | | | `basicACL.owner.get` | boolean | no | Flag allows GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.owner.head` | boolean | no | Flag allows HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `basicACL.owner.put` | boolean | no | Flag allows PUT object operation (create new objects). | | `basicACL.owner.delete` | boolean | no | Flag allows DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.owner.search` | boolean | no | Flag allows SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. | | `basicACL.owner.readContent` | boolean | no | **Deprecated.** Flag allows to read object payload. Requires readHeaders flag unless any of get, head, put or search is set. Deprecated, use get instead. Merged with get (logical OR) if both are set. | | `basicACL.owner.readHeaders` | boolean | no | **Deprecated.** Flag allows to read headers without object payload. Deprecated, use head and search instead. Merged with head and search (logical OR) if both are set. | | `basicACL.owner.create` | boolean | no | **Deprecated.** Flag allows to create new objects. Deprecated, use put instead. Merged with put (logical OR) if both are set. | | `basicACL.others` | [ACLGroup](schemas.md#aclgroup) | no | | | `basicACL.others.get` | boolean | no | Flag allows GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.others.head` | boolean | no | Flag allows HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `basicACL.others.put` | boolean | no | Flag allows PUT object operation (create new objects). | | `basicACL.others.delete` | boolean | no | Flag allows DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.others.search` | boolean | no | Flag allows SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. | | `basicACL.others.readContent` | boolean | no | **Deprecated.** Flag allows to read object payload. Requires readHeaders flag unless any of get, head, put or search is set. Deprecated, use get instead. Merged with get (logical OR) if both are set. | | `basicACL.others.readHeaders` | boolean | no | **Deprecated.** Flag allows to read headers without object payload. Deprecated, use head and search instead. Merged with head and search (logical OR) if both are set. | | `basicACL.others.create` | boolean | no | **Deprecated.** Flag allows to create new objects. Deprecated, use put instead. Merged with put (logical OR) if both are set. | | `lockUntil` | string (date-time) | no | Optional date until which the bucket cannot be deleted, in RFC 3339 format. This period can be extended, but there is no way to make it expire earlier. Cannot be used with lockHours. Example: `2030-01-01T00:00:00Z`. | | `lockHours` | integer (uint64) | no | **Deprecated.** Deprecated compatibility parameter. Use lockUntil instead. Cannot be used with lockUntil. Constraints: minimum 0. | | `eACL` | [EACL](schemas.md#eacl) | no | Optional initial eACL table for the bucket. Allowed only when basicACL is not final. Requires the setBucketEACL token permission. | | `eACL.records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | The records of the table. `null`, not an empty array, when the table has no records, as for a bucket created without an extended ACL. | | `eACL.records[].operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `eACL.records[].action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `eACL.records[].filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `eACL.records[].filters[].headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `eACL.records[].filters[].matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `eACL.records[].filters[].key` | string | yes | Name of the Header to use. | | `eACL.records[].filters[].value` | string | yes | Expected Header Value or pattern to match. | | `eACL.records[].targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | | `eACL.records[].targets[].role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `eACL.records[].targets[].accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Bucket successfully created. | `Location` | - | | `400` | At least one bucket parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | The storage policy named in `placementPolicyName` does not exist. | - | - | | `409` | Bucket already exists (`Bucket already exists.`), or the storage policy cannot be satisfied by the storage nodes in the network map (`Inapplicable policy.`). | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created bucket. Example: `/api/v1/buckets/BUCKET_NAME`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/buckets" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-bucket", "placementPolicyName": "REP-1", "basicACL": {} }' ``` ## GET /v1/buckets {#get-v1-buckets} List buckets owned by the requested user. Global admins can list buckets across namespaces using the namespace header, while other sessions can list only their own namespace. Operation ID: `v1ListBuckets` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `user` | query | string | yes | User name. | | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of items in the response. Negative values and values above 100 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 100; default `100`. | | `prefix` | query | string | no | Prefix of the object's path (name) to filter for. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [ListBucketsResponse](schemas.md#listbucketsresponse) (`application/json`) | | `400` | Session token is omitted or invalid, or cursor or maxItems is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Requested user is not found | - | - | Body of the `200` response (`application/json`), schema [ListBucketsResponse](schemas.md#listbucketsresponse): | Field | Type | Required | Description | |---|---|---|---| | `buckets` | array of string | yes | Bucket names. | | `totalCount` | integer (uint64) | yes | Total number of buckets owned by the user. Not affected by the prefix filter or by pagination, this is the same value as in the user metrics response. | | `usedSpace` | integer (uint64) | yes | Used space by user in bytes. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets?user=first-admin" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/buckets/{bucket} {#get-v1-buckets-bucket} Get bucket information by name. Global admins can read buckets across namespaces using the namespace header, while other sessions can read only buckets in their own namespace. Operation ID: `v1GetBucket` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetBucketResponse](schemas.md#getbucketresponse) (`application/json`) | | `400` | Bucket reference is missing or invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | User is not authorized to get bucket info. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [GetBucketResponse](schemas.md#getbucketresponse): | Field | Type | Required | Description | |---|---|---|---| | `creationDate` | string (date-time) | yes | Bucket creation date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `name` | string | yes | Bucket name. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `basicACL` | [BasicACL](schemas.md#basicacl) | yes | | | `basicACL.final` | boolean | no | Flag denying Extended ACL. Access tokens are not applicable to a final basic ACL either. | | `basicACL.disableAccessTokens` | boolean | no | Flag denying access tokens to extend the bucket permissions. Access tokens are allowed by default. Always true for final basic ACL. | | `basicACL.sticky` | boolean | no | **Deprecated.** Flag denying different owners of the request and the object. Deprecated, ignored on bucket creation. | | `basicACL.owner` | [ACLGroup](schemas.md#aclgroup) | no | | | `basicACL.owner.get` | boolean | no | Flag allows GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.owner.head` | boolean | no | Flag allows HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `basicACL.owner.put` | boolean | no | Flag allows PUT object operation (create new objects). | | `basicACL.owner.delete` | boolean | no | Flag allows DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.owner.search` | boolean | no | Flag allows SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. | | `basicACL.owner.readContent` | boolean | no | **Deprecated.** Flag allows to read object payload. Requires readHeaders flag unless any of get, head, put or search is set. Deprecated, use get instead. Merged with get (logical OR) if both are set. | | `basicACL.owner.readHeaders` | boolean | no | **Deprecated.** Flag allows to read headers without object payload. Deprecated, use head and search instead. Merged with head and search (logical OR) if both are set. | | `basicACL.owner.create` | boolean | no | **Deprecated.** Flag allows to create new objects. Deprecated, use put instead. Merged with put (logical OR) if both are set. | | `basicACL.others` | [ACLGroup](schemas.md#aclgroup) | no | | | `basicACL.others.get` | boolean | no | Flag allows GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.others.head` | boolean | no | Flag allows HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `basicACL.others.put` | boolean | no | Flag allows PUT object operation (create new objects). | | `basicACL.others.delete` | boolean | no | Flag allows DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `basicACL.others.search` | boolean | no | Flag allows SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. | | `basicACL.others.readContent` | boolean | no | **Deprecated.** Flag allows to read object payload. Requires readHeaders flag unless any of get, head, put or search is set. Deprecated, use get instead. Merged with get (logical OR) if both are set. | | `basicACL.others.readHeaders` | boolean | no | **Deprecated.** Flag allows to read headers without object payload. Deprecated, use head and search instead. Merged with head and search (logical OR) if both are set. | | `basicACL.others.create` | boolean | no | **Deprecated.** Flag allows to create new objects. Deprecated, use put instead. Merged with put (logical OR) if both are set. | | `eACL` | [EACL](schemas.md#eacl) | yes | | | `eACL.records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | The records of the table. `null`, not an empty array, when the table has no records, as for a bucket created without an extended ACL. | | `eACL.records[].operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `eACL.records[].action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `eACL.records[].filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `eACL.records[].filters[].headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `eACL.records[].filters[].matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `eACL.records[].filters[].key` | string | yes | Name of the Header to use. | | `eACL.records[].filters[].value` | string | yes | Expected Header Value or pattern to match. | | `eACL.records[].targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | | `eACL.records[].targets[].role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `eACL.records[].targets[].accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | | `placementPolicy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `placementPolicy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `placementPolicy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `placementPolicy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `placementPolicy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `placementPolicy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `placementPolicy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `placementPolicy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `placementPolicy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `placementPolicy.selectors[].filter` | string | yes | Filter reference to select from. | | `placementPolicy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `placementPolicy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `placementPolicy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `placementPolicy.filters[].key` | string | yes | Key to filter. | | `placementPolicy.filters[].op` | string | yes | Filtering operation. | | `placementPolicy.filters[].value` | string | yes | Value to match. | | `placementPolicy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `placementPolicy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `placementPolicy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `placementPolicy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `placementPolicy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `placementPolicy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `placementPolicy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `placementPolicy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `placementPolicy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `owner` | string | yes | User that owns this bucket. Example: `user@example.org`. | | `usedSpace` | integer (uint64) | yes | Bucket used space in bytes. | | `numberOfObjects` | integer (uint64) | yes | Number of objects in container. | | `metadataConsistency` | [MetadataConsistency](schemas.md#metadataconsistency) | yes | Metadata consistency of the bucket. An empty string when the storage policy of the bucket sets none, which is the case for the seeded policies and for buckets created through S3. Constraints: one of `strict`, `optimistic`. | | `lockUntil` | string (date-time) | no | Date until which the bucket cannot be deleted in RFC 3339 format. Returned in UTC (with “Z”). If omitted or set to a time in the past, the bucket is not locked for deletion. Example: `2022-11-21T07:12:42.68680647Z`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/buckets/{bucket} {#delete-v1-buckets-bucket} Delete a bucket from the system. Bucket owners and admins can delete buckets only in their own namespace. Operation ID: `v1DeleteBucket` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Bucket successfully removed. | - | - | | `400` | Session token is omitted or invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found (not created or already removed). | - | - | | `409` | Bucket locked. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/buckets/my-bucket" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/buckets/{bucket}/eacl {#put-v1-buckets-bucket-eacl} Set EACL to the bucket. Only the bucket owner can set EACL. Operation ID: `v1SetEacl` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Request body** Parameters of the new EACL in JSON. Required only for payload generation request. Media type `application/json`, schema: [SetEaclRequest](schemas.md#seteaclrequest). | Field | Type | Required | Description | |---|---|---|---| | `eACL` | [EACL](schemas.md#eacl) | yes | | | `eACL.records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | The records of the table. `null`, not an empty array, when the table has no records, as for a bucket created without an extended ACL. | | `eACL.records[].operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `eACL.records[].action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `eACL.records[].filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `eACL.records[].filters[].headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `eACL.records[].filters[].matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `eACL.records[].filters[].key` | string | yes | Name of the Header to use. | | `eACL.records[].filters[].value` | string | yes | Expected Header Value or pattern to match. | | `eACL.records[].targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | | `eACL.records[].targets[].role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `eACL.records[].targets[].accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | EACL successfully put. | - | - | | `400` | At least one bucket parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | | `409` | Bucket was changed concurrently. The request should be repeated. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/eacl" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "eACL": { "records": [ { "operation": "GET", "action": "ALLOW", "filters": [], "targets": [ { "role": "OTHERS" } ] } ] } }' ``` ## GET /v1/buckets/{bucket}/eacl {#get-v1-buckets-bucket-eacl} Get bucket EACL. Global admins can read EACL across namespaces using the namespace header, while other sessions can read only buckets in their own namespace. Operation ID: `v1GetEacl` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetEaclResponse](schemas.md#geteaclresponse) (`application/json`) | | `400` | At least one bucket parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [GetEaclResponse](schemas.md#geteaclresponse): | Field | Type | Required | Description | |---|---|---|---| | `eACL` | [EACL](schemas.md#eacl) | yes | | | `eACL.records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | The records of the table. `null`, not an empty array, when the table has no records, as for a bucket created without an extended ACL. | | `eACL.records[].operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `eACL.records[].action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `eACL.records[].filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `eACL.records[].filters[].headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `eACL.records[].filters[].matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `eACL.records[].filters[].key` | string | yes | Name of the Header to use. | | `eACL.records[].filters[].value` | string | yes | Expected Header Value or pattern to match. | | `eACL.records[].targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | | `eACL.records[].targets[].role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `eACL.records[].targets[].accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket/eacl" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/buckets/{bucket}/quota {#put-v1-buckets-bucket-quota} Set bucket quota. Admins can set quota only for buckets in their own namespace. Operation ID: `v1SetBucketQuota` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Request body** Parameters of the new quota in JSON. Required only for payload generation request. Media type `application/json`, schema: [SetStorageQuotaRequest](schemas.md#setstoragequotarequest). | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Quota successfully put. | - | - | | `400` | At least one bucket parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## GET /v1/buckets/{bucket}/quota {#get-v1-buckets-bucket-quota} Get bucket quota. Global admins can read quotas across namespaces using the namespace header, other admins can read quotas only in their own namespace, and non-admin sessions can read only their own buckets. Operation ID: `v1GetBucketQuota` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetStorageQuotaResponse](schemas.md#getstoragequotaresponse) (`application/json`) | | `400` | At least one bucket parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [GetStorageQuotaResponse](schemas.md#getstoragequotaresponse): | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | yes | Default storage soft quota for users in bytes. A zero value means unlimited. | | `hardQuota` | integer (uint64) | yes | Default storage hard quota for users in bytes. A zero value means unlimited. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket/quota" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/buckets/{bucket}/timelock {#put-v1-buckets-bucket-timelock} Set bucket lock time. Only the bucket owner can set timelock. Operation ID: `v1SetBucketTimelock` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Request body** Media type `application/json`, schema: [SetTimelockRequest](schemas.md#settimelockrequest). | Field | Type | Required | Description | |---|---|---|---| | `lockUntil` | string (date-time) | yes | Date until which the bucket cannot be deleted, in RFC 3339 format. This period can be extended, but there is no way to make it expire earlier. Example: `2030-01-01T00:00:00Z`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Lock time successfully put. | - | - | | `400` | At least one parameter is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/buckets/my-bucket/timelock" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "lockUntil": "2030-01-01T00:00:00Z" }' ``` ## GET /v1/buckets/{bucket}/timelock {#get-v1-buckets-bucket-timelock} Get bucket lock time. Global admins can read timelock across namespaces using the namespace header, while other sessions can read only buckets in their own namespace. Operation ID: `v1GetBucketTimelock` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetTimelockResponse](schemas.md#gettimelockresponse) (`application/json`) | | `400` | At least one parameter is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [GetTimelockResponse](schemas.md#gettimelockresponse): | Field | Type | Required | Description | |---|---|---|---| | `lockUntil` | string (date-time) | yes | Date until which the bucket cannot be deleted, in RFC 3339 format. Returned in UTC (with “Z”). If empty or set to a time in the past, the bucket is not locked for deletion. Example: `2022-11-21T07:12:42.68680647Z`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket/timelock" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/buckets/{bucket}/transfer {#post-v1-buckets-bucket-transfer} Create a new bucket transfer request addressed to a recipient. The recipient must accept it later. Both sender and recipient must belong to the same namespace. Operation ID: `v1CreateBucketTransfer` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Request body** Media type `application/json`, schema: [CreateBucketTransferRequest](schemas.md#createbuckettransferrequest). | Field | Type | Required | Description | |---|---|---|---| | `recipientLogin` | string | yes | Recipient user login. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Transfer request successfully created. | - | [CreateBucketTransferResponse](schemas.md#createbuckettransferresponse) (`application/json`) | | `400` | At least one parameter is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to create transfer for this bucket. | `WWW-Authenticate` | - | | `404` | Bucket or user not found. | - | - | Body of the `201` response (`application/json`), schema [CreateBucketTransferResponse](schemas.md#createbuckettransferresponse): | Field | Type | Required | Description | |---|---|---|---| | `transfer` | [BucketTransfer](schemas.md#buckettransfer) | yes | | | `transfer.id` | string | yes | Transfer ID. Constraints: minimum length 1. Example: `2b5b6d2c-44b5-4b92-8a1f-3b8a03d69c2a`. | | `transfer.bucket` | string | yes | Bucket name. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `transfer.senderLogin` | string | yes | Sender user login. Constraints: minimum length 1. Example: `sender`. | | `transfer.recipientLogin` | string | yes | Recipient user login. Constraints: minimum length 1. Example: `recipient`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/buckets/my-bucket/transfer" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "recipientLogin": "string" }' ``` ## POST /v1/buckets/{bucket}/access-tokens {#post-v1-buckets-bucket-access-tokens} Generate an access token which can be used for access sharing. This token follows EACL rules and replaces regular EACL, whatever is allowed by it is allowed by it. Operation ID: `v1CreateAccessToken` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | **Request body** Media type `application/json`, schema: [CreateAccessTokenRequest](schemas.md#createaccesstokenrequest). | Field | Type | Required | Description | |---|---|---|---| | `records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | eACL records of the token. Constraints: at least 1 item. | | `records[].operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `records[].action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `records[].filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `records[].filters[].headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `records[].filters[].matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `records[].filters[].key` | string | yes | Name of the Header to use. | | `records[].filters[].value` | string | yes | Expected Header Value or pattern to match. | | `records[].targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | | `records[].targets[].role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `records[].targets[].accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | | `expiresAt` | string (date-time) | yes | Token expiration date in RFC 3339 format. It is rounded up to the network epoch boundary. | | `owner` | string | no | Login of the user (in the issuer's namespace) the token is bound to. If omitted, the token can be used by anyone. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [CreateAccessTokenResponse](schemas.md#createaccesstokenresponse) (`application/json`) | | `400` | Passed data is invalid or the bucket basic ACL is final, so it can't be extended by the token. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [CreateAccessTokenResponse](schemas.md#createaccesstokenresponse): | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Signed access token in base64 encoding. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/buckets/my-bucket/access-tokens" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "records": [ { "operation": "GET", "action": "ALLOW", "filters": [], "targets": [ { "role": "OTHERS" } ] } ], "expiresAt": "2030-01-01T00:00:00Z" }' ``` ## POST /v1/buckets/{bucket}/objects {#post-v1-buckets-bucket-objects} Uploads a new object into the specified bucket. The request body is the raw object bytes. Requires PUT permission in the bucket ACL or token. Object path (name) should be provided via the X-Morph-Path header (Base64-encoded) or inside X-Attributes (not empty "FilePath" parameter). If omitted or empty, the request is rejected as "Missing object path." FilePath values are not unique. Each successful upload creates an independent object; use the returned `oid` to address that exact object later. Optional expiration can be set via X-Morph-Lifetime, X-Morph-Lifetime-Date or inside X-Attributes. If Content-Type is not provided in X-Attributes, it is detected from the first 512 bytes of the payload ([http.DetectContentType](https://pkg.go.dev/net/http#DetectContentType)). Priority rules: 1) X-Morph-Path overrides "FilePath" in X-Attributes. 2) X-Morph-Lifetime, when greater than 0, overrides "ExpHours" in X-Attributes. 3) X-Morph-Lifetime-Date overrides X-Morph-Lifetime. 4) X-Attributes.Content-Type overrides auto-detection (but must be a valid MIME type, checked by [mime.ParseMediaType](https://pkg.go.dev/mime#ParseMediaType)). 5) X-Attributes value can be Base64-encoded. Raw JSON is accepted as a fallback. Operation ID: `v1CreateObject` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `x-morph-path` | header | string (base64) | no | Object name. It can be a file path or object name, which suits your situation better. The object name encoded in base64. Constraints: minimum length 1. Example: `my-object, cat.png`. | | `x-morph-lifetime` | header | integer (int64) | no | Object lifetime, in hours. The console sets the expiration time of the object to the time of the upload plus this many hours. Zero means that this header sets no expiration. Constraints: minimum 0. Example: `24`. | | `x-morph-lifetime-date` | header | string | no | Exact object expiration date in RFC3339 format (e.g. "2026-12-31T23:59:59Z"). Takes priority over X-Morph-Lifetime. The lifetime in hours is computed from the current time. Must be in the future. Example: `2026-12-31T23:59:59Z`. | | `x-attributes` | header | string | no | User attributes either a Base64-encoded JSON string or a plain JSON string (as a fallback). The server first attempts standard Base64 decoding; if that fails it treats the raw value as JSON. More below the table. | Parameter `x-attributes`: User attributes either a Base64-encoded JSON string or a plain JSON string (as a fallback). The server first attempts standard Base64 decoding; if that fails it treats the raw value as JSON. The following keys are specially handled: - "FilePath": object path (used only if X-Morph-Path is absent). - "ExpHours": expiration in hours (used only if X-Morph-Lifetime is absent or 0). - "Content-Type": MIME type for the object (validated; overrides auto-detection). - "Timestamp": object creation time in RFC 3339 (e.g. "2022-11-21T07:12:42.68680647Z") or HTTP ("Mon, 21 Nov 2022 07:12:42 GMT") date format. This value is returned in object GET/HEAD responses as the "Last-Modified" header. Storage of attributes: - The special keys above are consumed and not stored as custom attributes. - Keys beginning with "__" are reserved and must not be used (will result in 400). - Pairs with an empty key or value are ignored. - All other keys are forwarded as user attributes. Invalid JSON: - If the header value is not valid JSON of the form map[string]string - 400. Body requirements when using x-attributes: - Send the raw object bytes as the request body (content-type application/octet-stream is acceptable). - Payload must be non-empty. Example values of `x-attributes`: | Value | Meaning | |---|---| | `{"FilePath":"readme.txt"}` | Minimal with required FilePath (used as the object name) | | `{"FilePath":"img/pic.jpg","ExpHours":"2","Content-Type":"image/jpeg","X-Label":"diagram"}` | FilePath + ExpHours + Content-Type + custom attribute | | `{"FilePath":"bad", "oops":` | Invalid JSON (will return 400) | | `{"FilePath":"file","ExpHours":"NaN"}` | Non-integer ExpHours (will return 400) | | `{"FilePath":"file","Content-Type":"@bra\|{adabra"}` | Invalid Content-Type (will return 400) | | `eyJGaWxlUGF0aCI6InJlYWRtZS50eHQifQ==` | Base64-encoded JSON | **Request body** Media type `application/octet-stream`, schema: binary. **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Object successfully created. | `Location` | [CreateObjectResponse](schemas.md#createobjectresponse) (`application/json`) | | `400` | At least one object parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to make this action in the bucket. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | | `507` | User doesn't have enough space. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created object. Example: `/api/v1/buckets/BUCKET_NAME/objects/OBJECT_ID`. | Body of the `201` response (`application/json`), schema [CreateObjectResponse](schemas.md#createobjectresponse): | Field | Type | Required | Description | |---|---|---|---| | `oid` | string | yes | Created object id. Example: `2z2ipYCDc5uWfNQTXeuYzv2pAGrLASKkRFXkUpzMsEJu`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" \ -H "X-Morph-Path: $(printf '%s' my-object | base64)" \ -H "Content-Type: application/octet-stream" \ --data-binary "@$FILE" ``` ## GET /v1/buckets/{bucket}/objects {#get-v1-buckets-bucket-objects} List all objects in the bucket with brief metadata. Requires SEARCH permission in the bucket ACL or token. Operation ID: `v1ListObjects` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of objects in the response. Negative values and values above 1000 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 1000; default `100`. | | `prefix` | query | string | no | Prefix of the object's path (name) to filter for. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [ListObjectsResponse](schemas.md#listobjectsresponse) (`application/json`) | | `400` | At least one parameter is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to make this action in the bucket. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [ListObjectsResponse](schemas.md#listobjectsresponse): | Field | Type | Required | Description | |---|---|---|---| | `objects` | array of [Object](schemas.md#object) | yes | Object descriptors. | | `objects[].oid` | string | yes | Object id. Example: `2z2ipYCDc5uWfNQTXeuYzv2pAGrLASKkRFXkUpzMsEJu`. | | `objects[].path` | string | yes | Object file path. Constraints: minimum length 1. Example: `my-object`. | | `objects[].creationDate` | string (date-time) | yes | Creation date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `objects[].size` | integer (uint64) | yes | Data size. Constraints: minimum 0. | | `objects[].contentType` | string | yes | Media type from https://www.iana.org/assignments/media-types/media-types.xhtml. Constraints: default `"application/octet-stream"`. | | `objects[].expirationDate` | string (date-time) | no | Expiration date in RFC 3339 format. Absent if the object doesn't expire. Example: `2022-11-22T07:12:42Z`. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket/objects" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/buckets/{bucket}/objects/search {#post-v1-buckets-bucket-objects-search} Search for objects in the bucket using structured filters. Returns a list of objects with requested attributes. Requires SEARCH permission in the bucket ACL or token. Operation ID: `v1SearchObjects` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `cursor` | query | string | no | Value to continue listing from, the next batch starts right after the last item of the previous response. Take it from the `cursor` field of the previous response as is. It returns the first elements batch if empty value passed. | | `maxItems` | query | integer | no | Limits the number of objects in the response. Negative values and values above 1000 are rejected with 400. Zero or an omitted parameter means the default of 100. Constraints: maximum 1000; default `100`. | **Request body** (required) Media type `application/json`, schema: [SearchObjectsRequest](schemas.md#searchobjectsrequest). | Field | Type | Required | Description | |---|---|---|---| | `filters` | array of [SearchFilter](schemas.md#searchfilter) | no | Optional list of up to 7 object filters. If it is not specified, all objects are returned. Special filter keys starting with "$Object:" can be used to filter by system attributes. The expected value formats are: "$Object:payloadLength" – payload size in bytes, as a decimal uint64 string. "$Object:ownerID" – object creator identifier, as a user ID string. "$Object:payloadHash" – SHA-256 hash of the payload, as a hex-encoded string (64 hex characters, 32 bytes). "$Object:creationEpoch" – object creation epoch, as a decimal uint64 string. Other keys starting from "$Object:*", as well as all reserved attributes starting with "__", lead to a 400 error. Other keys are treated as user-defined object attributes (for example "FilePath"). Constraints: at most 7 items. | | `filters[].key` | string | yes | Name of the attribute to apply the filter to (for example, "FilePath", "Content-Type", or a user-defined attribute key). | | `filters[].value` | string | yes | Numeric filters (MatchNum*) decimal values within the supported 256-bit integer range [-(2^256 - 1), 2^256 - 1]. | | `filters[].match` | [SearchMatch](schemas.md#searchmatch) | yes | Search match type. Constraints: one of `MatchStringEqual`, `MatchStringNotEqual`, `MatchNotPresent`, `MatchCommonPrefix`, `MatchNumGT`, `MatchNumGE`, `MatchNumLT`, `MatchNumLE`. | | `attributes` | array of string | no | Optional list of attributes to be returned for each object. It must contain up to 7 attributes. Basic object metadata can be retrieved by requesting the attributes: "FilePath", "Content-Type" and "Timestamp" as the creation date. You also may request reserved attributes: "$Object:payloadLength", "$Object:ownerID", "$Object:payloadHash", "$Object:creationEpoch". However, any other values starting from "$Object:*", as well as all reserved attributes starting with "__", will result in a 400 error. If this parameter is empty, no attributes will be returned, only object IDs. Constraints: at most 7 items. Example: `["Timestamp","FilePath","UserDefined"]`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Filtered object list. | - | [SearchObjectsResponse](schemas.md#searchobjectsresponse) (`application/json`) | | `400` | At least one parameter is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to search in this bucket. | `WWW-Authenticate` | - | | `404` | Bucket not found. | - | - | Body of the `200` response (`application/json`), schema [SearchObjectsResponse](schemas.md#searchobjectsresponse): | Field | Type | Required | Description | |---|---|---|---| | `objects` | array of [SearchObjects](schemas.md#searchobjects) | yes | | | `objects[].objectId` | string | yes | Example: `8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd`. | | `objects[].attributes` | object (any properties) | yes | Requested attributes. The first filter key is not returned unless it was requested: the console adds it to the search internally and removes it from every result again. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | | `incomplete` | boolean | no | Present if true and omitted if false. It indicates an incomplete success. The search was performed, but not all nodes returned results, so some items may be missing. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/buckets/my-bucket/objects/search" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filters": [ { "key": "FilePath", "value": "some/prefix", "match": "MatchCommonPrefix" }, { "key": "CustomAttributeKey", "value": "attr-value", "match": "MatchStringEqual" } ], "attributes": [ "FilePath", "CustomAttributeKey" ] }' ``` ## DELETE /v1/buckets/{bucket}/objects/{object} {#delete-v1-buckets-bucket-objects-object} Delete an object from the bucket. Requires DELETE permission in the bucket ACL or token, deleting by FilePath additionally requires SEARCH permission to find the object ID. Deleting by FilePath is deprecated and supported only for backward compatibility. Use an object ID to delete a specific object. If multiple objects have the FilePath, the object with the greatest Timestamp is selected, then the greatest object ID. Operation ID: `v1DeleteObject` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `object` | path | string | yes | Object ID or FilePath. When a FilePath matches multiple objects, Morph selects the object with the greatest Timestamp, then the greatest object ID. Use an object ID to address a specific object. Addressing by FilePath requires SEARCH permission in addition to the operation one (GET, HEAD or DELETE) in the bucket ACL or token, addressing by object ID requires the operation permission only. | Example values of `object`: | Value | Meaning | |---|---| | `file.txt` | Object FilePath. | | `53Rk7AKeaTgYEyffuRueEXDQJvTSHxtnxrZZ7o1ho6UR` | Object id. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Object successfully removed. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to make this action in the bucket. | `WWW-Authenticate` | - | | `404` | Bucket or object not found (not created or already removed). | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/buckets/my-bucket/objects/my-object" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/buckets/{bucket}/objects/{object} {#get-v1-buckets-bucket-objects-object} Download object data. No authentication is required for public objects. The namespace header selects bucket location for public access or for global admins reading across namespaces. Use an object ID to download a specific object. Requires GET permission in the bucket ACL or token, downloading by FilePath additionally requires SEARCH permission to find the object ID. The response includes object headers regardless of HEAD permission. Operation ID: `v1DownloadObject` **Authentication**: Optional (`BearerAuth`). The specification accepts the request with or without credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `object` | path | string | yes | Object ID or FilePath. When a FilePath matches multiple objects, Morph selects the object with the greatest Timestamp, then the greatest object ID. Use an object ID to address a specific object. Addressing by FilePath requires SEARCH permission in addition to the operation one (GET, HEAD or DELETE) in the bucket ACL or token, addressing by object ID requires the operation permission only. | | `Range` | header | string | no | Request a specific range of bytes from the object. Supports a single range only. | | `download` | query | boolean | no | Set the Content-Disposition header as attachment in response. This makes the browser download the object as a file instead of showing it on the page. Example: `true`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | | `accessToken` | query | string | no | Access token generated by `POST /v1/buckets/{bucket}/access-tokens`, in standard base64 encoding (URL-encoded in the query). | Example values of `object`: | Value | Meaning | |---|---| | `file.txt` | Object FilePath. | | `53Rk7AKeaTgYEyffuRueEXDQJvTSHxtnxrZZ7o1ho6UR` | Object id. | Example values of `Range`: | Value | Meaning | |---|---| | `bytes=500-999` | Explicit start and end | | `bytes=500-` | From start to EOF | | `bytes=-500` | Last N bytes | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | `X-Object-Id`, `X-Attributes`, `Accept-Ranges`, `Content-Length`, `Content-Type`, `Last-Modified`, `Content-Disposition` | string (binary) (`application/octet-stream`) | | `206` | Partial Content - Successfully retrieved a partial object based on the Range header. | `X-Object-Id`, `X-Attributes`, `Accept-Ranges`, `Content-Length`, `Content-Range`, `Content-Type`, `Last-Modified`, `Content-Disposition` | string (binary) (`*/*`) | | `400` | Bad request. Possible reasons: - invalid parameter, for example, invalid bucket name, download; - invalid access token; - invalid namespace, the namespace doesn't exist or too long. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to make this action in the bucket. | `WWW-Authenticate` | - | | `404` | Bucket or object not found. | - | - | | `416` | Requested range is not satisfiable. | - | - | Headers of the `200` response: | Header | Type | Description | |---|---|---| | `X-Object-Id` | string | Object ID. | | `X-Attributes` | string | Object attributes serialized as a JSON key-value map. | | `Accept-Ranges` | string | | | `Content-Length` | integer (int64) | | | `Content-Type` | string | | | `Last-Modified` | string | HTTP-date per RFC 7231 (e.g., Tue, 15 Nov 1994 12:45:26 GMT). | | `Content-Disposition` | string | `inline`, or `attachment` if the `download` query parameter is set. The base name of the object's `FilePath` (or `FileName` if `FilePath` is absent) is given in the `filename` parameter or, for non-ASCII names, in the percent-encoded `filename*` one (RFC 5987). Example: `attachment; filename=cat.png`. | Headers of the `206` response: | Header | Type | Description | |---|---|---| | `X-Object-Id` | string | Object ID. | | `X-Attributes` | string | Object attributes serialized as a JSON key-value map. | | `Accept-Ranges` | string | | | `Content-Length` | integer (int64) | | | `Content-Range` | string | Indicates the range of bytes being returned in the response. | | `Content-Type` | string | | | `Last-Modified` | string | HTTP-date per RFC 7231 (e.g., Tue, 15 Nov 1994 12:45:26 GMT). | | `Content-Disposition` | string | `inline`, or `attachment` if the `download` query parameter is set. The base name of the object's `FilePath` (or `FileName` if `FilePath` is absent) is given in the `filename` parameter or, for non-ASCII names, in the percent-encoded `filename*` one (RFC 5987). Example: `attachment; filename=cat.png`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/buckets/my-bucket/objects/my-object" \ -H "Authorization: Bearer $TOKEN" ``` ## HEAD /v1/buckets/{bucket}/objects/{object} {#head-v1-buckets-bucket-objects-object} Get object metadata. No authentication is required for public objects. The namespace header selects bucket location for public access or for global admins reading across namespaces. Use an object ID to get a specific object. Requires HEAD permission in the bucket ACL or token, addressing by FilePath additionally requires SEARCH permission to find the object ID. Operation ID: `v1HeadObject` **Authentication**: Optional (`BearerAuth`). The specification accepts the request with or without credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `bucket` | path | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. | | `object` | path | string | yes | Object ID or FilePath. When a FilePath matches multiple objects, Morph selects the object with the greatest Timestamp, then the greatest object ID. Use an object ID to address a specific object. Addressing by FilePath requires SEARCH permission in addition to the operation one (GET, HEAD or DELETE) in the bucket ACL or token, addressing by object ID requires the operation permission only. | | `download` | query | boolean | no | Set the Content-Disposition header as attachment in response. This makes the browser download the object as a file instead of showing it on the page. Example: `true`. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | | `accessToken` | query | string | no | Access token generated by `POST /v1/buckets/{bucket}/access-tokens`, in standard base64 encoding (URL-encoded in the query). | Example values of `object`: | Value | Meaning | |---|---| | `file.txt` | Object FilePath. | | `53Rk7AKeaTgYEyffuRueEXDQJvTSHxtnxrZZ7o1ho6UR` | Object id. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | `X-Object-Id`, `X-Attributes`, `Content-Length`, `Content-Type`, `Last-Modified`, `Content-Disposition` | - | | `400` | Bad request. Possible reasons: - invalid parameter, for example, invalid bucket name, download; - invalid access token; - invalid namespace, the namespace doesn't exist or too long. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | User is not authorized to make this action in the bucket. | `WWW-Authenticate` | - | | `404` | Bucket or object not found. | - | - | Headers of the `200` response: | Header | Type | Description | |---|---|---| | `X-Object-Id` | string | Object ID. | | `X-Attributes` | string | Object attributes serialized as a JSON key-value map. | | `Content-Length` | integer (int64) | | | `Content-Type` | string | | | `Last-Modified` | string | HTTP-date per RFC 7231 (e.g., Tue, 15 Nov 1994 12:45:26 GMT). | | `Content-Disposition` | string | `inline`, or `attachment` if the `download` query parameter is set. The base name of the object's `FilePath` (or `FileName` if `FilePath` is absent) is given in the `filename` parameter or, for non-ASCII names, in the percent-encoded `filename*` one (RFC 5987). Example: `attachment; filename=cat.png`. | **Example** ```shell curl --head "$MORPH_URL/api/v1/buckets/my-bucket/objects/my-object" \ -H "Authorization: Bearer $TOKEN" ``` --- # Cluster Operations of the Morph REST API in the group `cluster`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` - `TOKEN`: bearer token - `ADDRESS`: value of the `address` path parameter - `POLICY_NAME`: value of the `policyName` path parameter - `FILE`: path of the file to send as the request body - `PROVIDER_ID`: value of the `providerID` path parameter - `NAMESPACE`: value of the `namespace` path parameter | Operation | Summary | |---|---| | [`GET /v1/cluster/default-quota`](#get-v1-cluster-default-quota) | Get the default storage quota applied to users created in the selected namespace. | | [`PUT /v1/cluster/default-quota`](#put-v1-cluster-default-quota) | Set the default storage quota applied to users subsequently created in the selected namespace. | | [`POST /v1/cluster/default-quota`](#post-v1-cluster-default-quota) | Deprecated. Use `PUT /v1/cluster/default-quota` instead. | | [`GET /v1/cluster/metrics`](#get-v1-cluster-metrics) | Scrape system metrics. | | [`GET /v1/cluster/storage-nodes`](#get-v1-cluster-storage-nodes) | List storage nodes in the current NetMap snapshot. | | [`POST /v1/cluster/storage-nodes`](#post-v1-cluster-storage-nodes) | Grant a storage node access to become a network candidate. | | [`GET /v1/cluster/gateways`](#get-v1-cluster-gateways) | List registered gateway keys. | | [`POST /v1/cluster/gateways`](#post-v1-cluster-gateways) | Grant access to the gateway account and register its public key for Morph and S3. | | [`DELETE /v1/cluster/storage-nodes/{address}`](#delete-v1-cluster-storage-nodes-address) | Decommission a storage node account. | | [`DELETE /v1/cluster/gateways/{address}`](#delete-v1-cluster-gateways-address) | Decommission a registered gateway account. | | [`POST /v1/cluster/storage-node`](#post-v1-cluster-storage-node) | Deprecated grant endpoint. | | [`GET /v1/cluster/storage-policies`](#get-v1-cluster-storage-policies) | Get system storage policies. | | [`POST /v1/cluster/storage-policies`](#post-v1-cluster-storage-policies) | Create storage policy. | | [`GET /v1/cluster/storage-policies/{policyName}`](#get-v1-cluster-storage-policies-policyname) | Get system storage policy by name. | | [`PUT /v1/cluster/storage-policies/{policyName}`](#put-v1-cluster-storage-policies-policyname) | Update system storage policy. | | [`DELETE /v1/cluster/storage-policies/{policyName}`](#delete-v1-cluster-storage-policies-policyname) | Delete system storage policy. | | [`GET /v1/cluster/ir-keys`](#get-v1-cluster-ir-keys) | Get Inner Ring public keys. | | [`POST /v1/cluster/license`](#post-v1-cluster-license) | Upload license. | | [`GET /v1/cluster/license`](#get-v1-cluster-license) | Get brief license metadata. | | [`POST /v1/cluster/oauth`](#post-v1-cluster-oauth) | Create a new OAuth provider in the selected namespace. | | [`GET /v1/cluster/oauth`](#get-v1-cluster-oauth) | List all OAuth providers in the selected namespace. | | [`PUT /v1/cluster/oauth/{providerID}`](#put-v1-cluster-oauth-providerid) | Update an existing OAuth provider in the selected namespace. | | [`DELETE /v1/cluster/oauth/{providerID}`](#delete-v1-cluster-oauth-providerid) | Delete OAuth provider from the selected namespace. | | [`GET /v1/cluster/oauth/{providerID}`](#get-v1-cluster-oauth-providerid) | Get OAuth provider from the selected namespace. | | [`POST /v1/cluster/saml`](#post-v1-cluster-saml) | Create a new SAML provider in the selected namespace. | | [`GET /v1/cluster/saml`](#get-v1-cluster-saml) | List all SAML providers in the selected namespace. | | [`PUT /v1/cluster/saml/{providerID}`](#put-v1-cluster-saml-providerid) | Update an existing SAML provider in the selected namespace. | | [`DELETE /v1/cluster/saml/{providerID}`](#delete-v1-cluster-saml-providerid) | Delete SAML provider from the selected namespace. | | [`GET /v1/cluster/saml/{providerID}`](#get-v1-cluster-saml-providerid) | Get SAML provider from the selected namespace. | | [`POST /v1/cluster/namespaces`](#post-v1-cluster-namespaces) | Create a new namespace. | | [`GET /v1/cluster/namespaces`](#get-v1-cluster-namespaces) | List all namespaces. | | [`GET /v1/cluster/namespaces/{namespace}`](#get-v1-cluster-namespaces-namespace) | Get information about the namespace by name. | | [`DELETE /v1/cluster/namespaces/{namespace}`](#delete-v1-cluster-namespaces-namespace) | Delete namespace from the system. | ## GET /v1/cluster/default-quota {#get-v1-cluster-default-quota} Get the default storage quota applied to users created in the selected namespace. If `X-Morph-Namespace` is omitted, the authenticated session namespace is used. If it is provided, namespace admins may select only their own namespace, while global admins may select any namespace. A newly created namespace copies the current default-namespace quota. Later changes to that quota do not affect existing namespaces or users. Available to authenticated users in their own namespace and to global admins for any namespace. Operation ID: `v1GetDefaultStorageQuota` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [GetStorageQuotaResponse](schemas.md#getstoragequotaresponse) (`application/json`) | | `400` | Namespace is invalid or does not exist. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | The session cannot access the selected namespace. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [GetStorageQuotaResponse](schemas.md#getstoragequotaresponse): | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | yes | Default storage soft quota for users in bytes. A zero value means unlimited. | | `hardQuota` | integer (uint64) | yes | Default storage hard quota for users in bytes. A zero value means unlimited. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/default-quota" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/cluster/default-quota {#put-v1-cluster-default-quota} Set the default storage quota applied to users subsequently created in the selected namespace. If `X-Morph-Namespace` is omitted, the authenticated session namespace is used. If it is provided, namespace admins may select only their own namespace, while global admins may select any namespace. A zero limit is unlimited, and changing the default quota does not affect existing users. Requires an admin session with the `setDefaultStorageQuota` permission. Operation ID: `v1SetDefaultStorageQuota` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [SetStorageQuotaRequest](schemas.md#setstoragequotarequest). | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Quota changed. | - | - | | `400` | Passed data or namespace is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/cluster/default-quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## POST /v1/cluster/default-quota {#post-v1-cluster-default-quota} **Deprecated.** The specification marks this operation as deprecated. Deprecated. Use `PUT /v1/cluster/default-quota` instead. This method will be removed in a future version. Set default storage quota for a new user. Requires a global admin session. Operation ID: `v1SetDefaultStorageQuotaDeprecated` **Authentication**: Required (`BearerAuth`). **Request body** Media type `application/json`, schema: [SetStorageQuotaRequest](schemas.md#setstoragequotarequest). | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Quota changed. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/default-quota" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## GET /v1/cluster/metrics {#get-v1-cluster-metrics} Scrape system metrics. Requires a global admin session. Operation ID: `v1GetMetrics` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetMetricsResponse](schemas.md#getmetricsresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [GetMetricsResponse](schemas.md#getmetricsresponse): | Field | Type | Required | Description | |---|---|---|---| | `buckets` | integer (uint64) | yes | Total number of buckets in the system. Constraints: minimum 0. | | `objects` | integer (uint64) | yes | Total number of objects in all buckets in the system. Constraints: minimum 0. | | `dataSize` | integer (uint64) | yes | Total amount of object data stored in the system (excl. metadata). Constraints: minimum 0. | | `users` | integer (uint64) | yes | Total number of users in the system, including all namespaces. Constraints: minimum 0. | | `nodes` | array of [MetricsNode](schemas.md#metricsnode) | yes | Listing of nodes' metrics. | | `nodes[].endpoint` | string | yes | Network endpoint of the node server. | | `nodes[].uptime` | integer (uint64) | yes | Time elapsed since node startup in seconds. In this release the bundled console does not compute it and always reports 0. Constraints: minimum 0. | | `nodes[].drives` | array of [MetricsDrive](schemas.md#metricsdrive) | yes | Listing of drives' metrics. | | `nodes[].drives[].mountPoint` | string | yes | Mount point of the drive. In this release the bundled console does not set it and always reports an empty string. | | `nodes[].drives[].totalSpace` | integer (uint64) | yes | Total disk space of the node in bytes. Constraints: minimum 0. | | `nodes[].drives[].usedSpace` | integer (uint64) | yes | Used disk space in bytes. In this release the bundled console does not compute it and always reports 0; only totalSpace (from the node capacity attribute) is filled. Constraints: minimum 0. | | `nodes[].drives[].availSpace` | integer (uint64) | yes | Available disk space in bytes. In this release the bundled console does not compute it and always reports 0. Constraints: minimum 0. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/metrics" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/cluster/storage-nodes {#get-v1-cluster-storage-nodes} List storage nodes in the current NetMap snapshot. Candidates are not included. Requires a global admin session. Operation ID: `v1ListStorageNodes` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Storage nodes found. | - | [ListStorageNodesResponse](schemas.md#liststoragenodesresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [ListStorageNodesResponse](schemas.md#liststoragenodesresponse): | Field | Type | Required | Description | |---|---|---|---| | `nodes` | array of [StorageNode](schemas.md#storagenode) | yes | Storage nodes in the current NetMap snapshot. | | `nodes[].publicKey` | string | yes | Compressed public key announced by the storage node. | | `nodes[].address` | string | yes | Address derived from the storage node public key. | | `nodes[].endpoints` | array of string | yes | Network endpoints announced by the storage node. | | `nodes[].attributes` | map of string to string | yes | Attributes announced by the storage node. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/storage-nodes {#post-v1-cluster-storage-nodes} Grant a storage node access to become a network candidate. Requires a global admin session. Operation ID: `v1GrantStorageNode` **Authentication**: Required (`BearerAuth`). **Request body** Media type `application/json`, schema: [GrantStorageNodeRequest](schemas.md#grantstoragenoderequest). | Field | Type | Required | Description | |---|---|---|---| | `address` | string | yes | Storage node address to grant access to the network. Example: `Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Storage node access granted. | - | - | | `400` | Passed storage node address is invalid or cannot be admitted. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | | `409` | The storage node account is blocked and cannot restored. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/storage-nodes" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn" }' ``` ## GET /v1/cluster/gateways {#get-v1-cluster-gateways} List registered gateway keys. Requires a global admin session. Operation ID: `v1ListGateways` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Registered gateway keys found. | - | [ListGatewaysResponse](schemas.md#listgatewaysresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [ListGatewaysResponse](schemas.md#listgatewaysresponse): | Field | Type | Required | Description | |---|---|---|---| | `gateways` | array of [Gateway](schemas.md#gateway) | yes | Registered gateway keys. | | `gateways[].publicKey` | string | yes | Registered gateway public key. | | `gateways[].address` | string | yes | Address derived from the gateway public key. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/gateways" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/gateways {#post-v1-cluster-gateways} Grant access to the gateway account and register its public key for Morph and S3. Does not use storage node license admission. Requires a global admin session. Operation ID: `v1GrantGateway` **Authentication**: Required (`BearerAuth`). **Request body** Media type `application/json`, schema: [GrantGatewayRequest](schemas.md#grantgatewayrequest). | Field | Type | Required | Description | |---|---|---|---| | `publicKey` | string | yes | Public key to register as a Morph and S3 gateway key, its account is granted access to the network. Example: `03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Gateway access granted. | - | - | | `400` | Passed gateway public key is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | | `409` | The gateway account is blocked and cannot be restored. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/gateways" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "publicKey": "03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b" }' ``` ## DELETE /v1/cluster/storage-nodes/{address} {#delete-v1-cluster-storage-nodes-address} Decommission a storage node account. The address must belong to a current or candidate storage node. The account is blocked, matching registered Morph/S3 public keys are removed, and matching NetMap candidates are removed. Current storage nodes become absent at the next epoch. Available only on an IR-enabled Morph instance. Requires a global admin session. Operation ID: `v1DecommissionStorageNode` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `address` | path | string | yes | Account address. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `202` | Storage node decommissioning accepted. | - | - | | `400` | Address is invalid, protected, or does not belong to a storage node. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | | `501` | Decommissioning is not implemented on this instance. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/storage-nodes/$ADDRESS" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/cluster/gateways/{address} {#delete-v1-cluster-gateways-address} Decommission a registered gateway account. The address must belong to a registered S3 gateway key. The account is blocked, matching registered Morph/S3 public keys are removed, and matching NetMap candidates are removed. Current storage nodes become absent at the next epoch. Available only on an IR-enabled Morph instance. Requires a global admin session. Operation ID: `v1DecommissionGateway` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `address` | path | string | yes | Account address. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Gateway successfully decommissioned. | - | - | | `400` | Address is invalid, protected, or does not belong to a gateway. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | | `501` | Decommissioning is not implemented on this instance. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/gateways/$ADDRESS" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/storage-node {#post-v1-cluster-storage-node} **Deprecated.** The specification marks this operation as deprecated. Deprecated grant endpoint. Use `/v1/cluster/storage-nodes` to grant a storage node, `/v1/cluster/gateways` to grant a gateway, `DELETE /v1/cluster/storage-nodes/{address}` to decommission a storage node, and `DELETE /v1/cluster/gateways/{address}` to decommission a gateway. It remains available for legacy mixed grants and decommissioning. Fields used only by the other action are ignored. Decommissioning is available only on an IR-enabled instance and otherwise returns `501`. Requires a global admin session. Operation ID: `v1ApplySNAction` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `x-morph-action` | header | string | yes | An action to apply to storage node or gateway accounts. "grant-access" with `address` grants a storage node access to become a network candidate. A public-key-only "grant-access" registers and grants access to a Morph/S3 gateway key without storage node admission. "decommission" is retained for legacy requests, use `DELETE /v1/cluster/storage-nodes/{address}` or `DELETE /v1/cluster/gateways/{address}` instead. Fields used only by the other action are ignored. Decommissioning is available only on an IR-enabled Morph instance and otherwise returns `501`. Constraints: one of `grant-access`, `decommission`. Example: `grant-access`. | **Request body** Media type `application/json`, schema: [StorageNodeAddress](schemas.md#storagenodeaddress). | Field | Type | Required | Description | |---|---|---|---| | `address` | string | no | Storage node address for `grant-access`. Optional if publicKey is set. Example: `Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn`. | | `publicKey` | string | no | Optional public key to register as Morph and S3 gateway key for `grant-access`. If address is omitted, its derived address is used as the gateway account. Example: `03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b`. | | `accounts` | array of string | no | Account addresses for legacy batch `decommission`. Each account must be a current or candidate storage node, a registered Morph/S3 gateway, or already blocked. An already blocked account is accepted as a safe retry after a lost `204`. Matching registered Morph/S3 public keys and Netmap candidates are removed, current storage nodes become absent at the next epoch. Constraints: at least 1 item. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Selected action successfully performed. The response has no body. Decommissioning an already blocked account is a safe retry. | - | - | | `400` | The action or its request data is invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights. | `WWW-Authenticate` | - | | `409` | A grant target is blocked and cannot be restored. | - | - | | `500` | Unable to perform requested action. | - | - | | `501` | Decommissioning is not implemented on this instance. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/storage-node" \ -H "Authorization: Bearer $TOKEN" \ -H "x-morph-action: grant-access" \ -H "Content-Type: application/json" \ -d '{ "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", "publicKey": "03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b" }' ``` ## GET /v1/cluster/storage-policies {#get-v1-cluster-storage-policies} Get system storage policies. Available to any authenticated user. Operation ID: `v1GetSystemStoragePolicies` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Storage policies found. | - | [V1GetSystemStoragePoliciesResponse](schemas.md#v1getsystemstoragepoliciesresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [V1GetSystemStoragePoliciesResponse](schemas.md#v1getsystemstoragepoliciesresponse): | Field | Type | Required | Description | |---|---|---|---| | `policies` | array of [NamedStoragePolicy](schemas.md#namedstoragepolicy) | yes | Storage policy list. | | `policies[].policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policies[].policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policies[].policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policies[].policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policies[].policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policies[].policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policies[].policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policies[].policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policies[].policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policies[].policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policies[].policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policies[].policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policies[].policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policies[].policy.filters[].key` | string | yes | Key to filter. | | `policies[].policy.filters[].op` | string | yes | Filtering operation. | | `policies[].policy.filters[].value` | string | yes | Value to match. | | `policies[].policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policies[].policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policies[].policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policies[].policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policies[].policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policies[].policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policies[].policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policies[].policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policies[].policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `policies[].name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `policies[].consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `policies[].default` | boolean | no | The flag indicates if the policy is the default. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/storage-policies" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/storage-policies {#post-v1-cluster-storage-policies} Create storage policy. Requires a global admin session. Operation ID: `v1CreateSystemStoragePolicy` **Authentication**: Required (`BearerAuth`). **Request body** Media type `application/json`, schema: [V1CreateSystemStoragePolicyRequest](schemas.md#v1createsystemstoragepolicyrequest). | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Storage policy created. | `Location` | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | Storage policy with this name already exists. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created system storage policy. Example: `/api/v1/cluster/storage-policies/POLICY_NAME`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/storage-policies" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "policy": { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [] }, "name": "string" }' ``` ## GET /v1/cluster/storage-policies/{policyName} {#get-v1-cluster-storage-policies-policyname} Get system storage policy by name. Available to any authenticated user. Operation ID: `v1GetSystemStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Storage policy found. | - | [V1GetStoragePolicyResponse](schemas.md#v1getstoragepolicyresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `404` | Policy not found. | - | - | Body of the `200` response (`application/json`), schema [V1GetStoragePolicyResponse](schemas.md#v1getstoragepolicyresponse): | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" ``` ## PUT /v1/cluster/storage-policies/{policyName} {#put-v1-cluster-storage-policies-policyname} Update system storage policy. Requires a global admin session. Operation ID: `v1UpdateSystemStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | **Request body** Media type `application/json`, schema: [V1UpdateStoragePolicyRequest](schemas.md#v1updatestoragepolicyrequest). | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `policy.replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `policy.replicas[].count` | integer (uint32) | yes | How many object replicas to put. | | `policy.replicas[].selector` | string | yes | Named selector bucket to put replicas. | | `policy.placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `policy.selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `policy.selectors[].name` | string | yes | Selector name to reference in object placement section. | | `policy.selectors[].count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `policy.selectors[].attribute` | string | yes | Bucket attribute to select from. | | `policy.selectors[].filter` | string | yes | Filter reference to select from. | | `policy.selectors[].clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | | `policy.filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `policy.filters[].name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `policy.filters[].key` | string | yes | Key to filter. | | `policy.filters[].op` | string | yes | Filtering operation. | | `policy.filters[].value` | string | yes | Value to match. | | `policy.filters[].filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | | `policy.ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `policy.ecRules[].selector` | string | no | Name of the corresponding selector to put EC data. | | `policy.ecRules[].dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.ecRules[].parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `policy.initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | | `policy.initialPlacement.replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `policy.initialPlacement.maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `policy.initialPlacement.preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Storage policy updated. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/cluster/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "policy": { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [] } }' ``` ## DELETE /v1/cluster/storage-policies/{policyName} {#delete-v1-cluster-storage-policies-policyname} Delete system storage policy. Requires a global admin session. Operation ID: `v1DeleteSystemStoragePolicy` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `policyName` | path | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. Example: `policy1, policy2, superPolicy.`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Storage policy deleted. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Policy not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/storage-policies/$POLICY_NAME" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/cluster/ir-keys {#get-v1-cluster-ir-keys} Get Inner Ring public keys. Requires a global admin session. Operation ID: `v1GetIRPublicKeys` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK. | - | array of [IRKey](schemas.md#irkey) (`application/json`) | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/ir-keys" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/license {#post-v1-cluster-license} Upload license. Requires a global admin session. Operation ID: `v1UploadLicense` **Authentication**: Required (`BearerAuth`). **Request body** Media type `application/octet-stream`, schema: binary. **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | License successfully uploaded. | - | - | | `400` | Passed data is invalid. | - | - | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `413` | License too large. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/license" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary "@$FILE" ``` ## GET /v1/cluster/license {#get-v1-cluster-license} Get brief license metadata. Requires a global admin session. Operation ID: `v1GetLicense` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK. | - | [LicenseResponse](schemas.md#licenseresponse) (`application/json`) | | `401` | Authentication token is invalid, missing or expired. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | License not found. | - | - | Body of the `200` response (`application/json`), schema [LicenseResponse](schemas.md#licenseresponse): | Field | Type | Required | Description | |---|---|---|---| | `nodeLimit` | integer (uint) | yes | Limit of node count. | | `capacity` | integer (uint64) | yes | Capacity in GB. | | `validFrom` | string (date-time) | yes | License valid-from date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `validUntil` | string (date-time) | yes | License valid-until date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/license" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/oauth {#post-v1-cluster-oauth} Create a new OAuth provider in the selected namespace. Namespace admins can create providers only in their own namespace. Operation ID: `v1ClusterCreateOAuthProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1ClusterCreateOAuthProviderRequest](schemas.md#v1clustercreateoauthproviderrequest). | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | | `clientID` | string | yes | OAuth provider application client id. | | `clientSecret` | string | yes | OAuth provider application client secret. | | `userInfoURL` | string | yes | OAuth provider URL, to get user details. | | `authorizeURL` | string | yes | OAuth provider URL, to authorize user. | | `tokenURL` | string | yes | OAuth provider URL, to exchange token. | | `scope` | array of string | yes | OAuth provider scope required to get user's email. | | `authorizeHeaderPrefix` | string | yes | OAuth provider Authorization header. It is used to get user's info from OAuth provider. Constraints: default `"OAuth"`. | | `emailPath` | array of string | yes | The path to extract email field from user info response. E.g. `["email"]` if the email is located in the `response`->`email`, `["user", "email"]` if it is located in the `response`->`user`->`email`. Example: `[["email"],["user","email"]]`. | | `domains` | array of string | yes | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | | `usePKCE` | boolean | yes | Tells to use PKCE feature with OAuth provider. The feature must be supported by provider. Constraints: default `false`. | | `callbackURL` | string | yes | The OAuth provider redirects users to this URL after authorization. It must exactly match the one configured in your OAuth provider’s dashboard. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | OAuth provider created. | `Location` | - | | `400` | Request is malformed or has invalid provider type. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created OAuth provider resource. Example: `/v1/cluster/oauth/PROVIDER_ID`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/oauth" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "string", "type": "general", "clientID": "string", "clientSecret": "string", "userInfoURL": "string", "authorizeURL": "string", "tokenURL": "string", "scope": [ "string" ], "authorizeHeaderPrefix": "OAuth", "emailPath": [ [ "email" ], [ "user", "email" ] ], "domains": [ "@morphbits.io", "@example.com" ], "usePKCE": false, "callbackURL": "string" }' ``` ## GET /v1/cluster/oauth {#get-v1-cluster-oauth} List all OAuth providers in the selected namespace. Operation ID: `v1ClusterGetOAuthProviders` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [V1ClusterGetOAuthProvidersResponse](schemas.md#v1clustergetoauthprovidersresponse) (`application/json`) | Body of the `200` response (`application/json`), schema [V1ClusterGetOAuthProvidersResponse](schemas.md#v1clustergetoauthprovidersresponse): | Field | Type | Required | Description | |---|---|---|---| | `providers` | array of [OAuthProviderRecord](schemas.md#oauthproviderrecord) | yes | | | `providers[].id` | string | yes | | | `providers[].label` | string | yes | | | `providers[].type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/oauth" ``` ## PUT /v1/cluster/oauth/{providerID} {#put-v1-cluster-oauth-providerid} Update an existing OAuth provider in the selected namespace. Namespace admins can update providers only in their own namespace. Operation ID: `v1ClusterUpdateOAuthProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | OAuth provider id. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1ClusterCreateOAuthProviderRequest](schemas.md#v1clustercreateoauthproviderrequest). | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | | `clientID` | string | yes | OAuth provider application client id. | | `clientSecret` | string | yes | OAuth provider application client secret. | | `userInfoURL` | string | yes | OAuth provider URL, to get user details. | | `authorizeURL` | string | yes | OAuth provider URL, to authorize user. | | `tokenURL` | string | yes | OAuth provider URL, to exchange token. | | `scope` | array of string | yes | OAuth provider scope required to get user's email. | | `authorizeHeaderPrefix` | string | yes | OAuth provider Authorization header. It is used to get user's info from OAuth provider. Constraints: default `"OAuth"`. | | `emailPath` | array of string | yes | The path to extract email field from user info response. E.g. `["email"]` if the email is located in the `response`->`email`, `["user", "email"]` if it is located in the `response`->`user`->`email`. Example: `[["email"],["user","email"]]`. | | `domains` | array of string | yes | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | | `usePKCE` | boolean | yes | Tells to use PKCE feature with OAuth provider. The feature must be supported by provider. Constraints: default `false`. | | `callbackURL` | string | yes | The OAuth provider redirects users to this URL after authorization. It must exactly match the one configured in your OAuth provider’s dashboard. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | OAuth provider updated. | - | - | | `400` | Request is malformed or has invalid provider type. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | OAuth provider not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/cluster/oauth/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "string", "type": "general", "clientID": "string", "clientSecret": "string", "userInfoURL": "string", "authorizeURL": "string", "tokenURL": "string", "scope": [ "string" ], "authorizeHeaderPrefix": "OAuth", "emailPath": [ [ "email" ], [ "user", "email" ] ], "domains": [ "@morphbits.io", "@example.com" ], "usePKCE": false, "callbackURL": "string" }' ``` ## DELETE /v1/cluster/oauth/{providerID} {#delete-v1-cluster-oauth-providerid} Delete OAuth provider from the selected namespace. Namespace admins can delete providers only in their own namespace. Operation ID: `v1ClusterDeleteOAuthProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | OAuth provider id. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | OAuth provider deleted. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | OAuth provider not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/oauth/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/cluster/oauth/{providerID} {#get-v1-cluster-oauth-providerid} Get OAuth provider from the selected namespace. Namespace admins can get providers only in their own namespace. Operation ID: `v1ClusterGetOAuthProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | OAuth provider id. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [V1ClusterGetOAuthProviderResponse](schemas.md#v1clustergetoauthproviderresponse) (`application/json`) | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | OAuth provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/oauth/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/saml {#post-v1-cluster-saml} Create a new SAML provider in the selected namespace. Namespace admins can create providers only in their own namespace. Operation ID: `v1ClusterCreateSAMLProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1ClusterCreateSAMLProviderRequest](schemas.md#v1clustercreatesamlproviderrequest). | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `entityID` | string | yes | Service Provider entity id. | | `idpMetadata` | string (base64) | yes | Identity provider (idp) metadata encoded in base64. | | `rootURL` | string | yes | It is a root URL for the service provider. Example: `https://morphbits.io/`. | | `domains` | array of string | no | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Provider created. | `Location` | - | | `400` | Request is malformed. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | Provider with the same id already registered. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created SAML provider resource. Example: `/v1/cluster/saml/PROVIDER_ID`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/saml" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "string", "entityID": "string", "idpMetadata": "string", "rootURL": "https://morphbits.io/" }' ``` ## GET /v1/cluster/saml {#get-v1-cluster-saml} List all SAML providers in the selected namespace. Operation ID: `v1ClusterListSAMLProviders` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [V1ClusterListSAMLProvidersResponse](schemas.md#v1clusterlistsamlprovidersresponse) (`application/json`) | Body of the `200` response (`application/json`), schema [V1ClusterListSAMLProvidersResponse](schemas.md#v1clusterlistsamlprovidersresponse): | Field | Type | Required | Description | |---|---|---|---| | `providers` | array of [SAMLProviderRecord](schemas.md#samlproviderrecord) | yes | | | `providers[].id` | string | yes | | | `providers[].label` | string | yes | | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/saml" ``` ## PUT /v1/cluster/saml/{providerID} {#put-v1-cluster-saml-providerid} Update an existing SAML provider in the selected namespace. Namespace admins can update providers only in their own namespace. Operation ID: `v1ClusterUpdateSAMLProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Request body** Media type `application/json`, schema: [V1ClusterSAMLProviderInfo](schemas.md#v1clustersamlproviderinfo). | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `entityID` | string | yes | Service Provider entity id. | | `idpMetadata` | string (base64) | yes | Identity provider (idp) metadata encoded in base64. | | `rootURL` | string | yes | It is a root URL for the service provider. Example: `https://morphbits.io/`. | | `metadataPath` | string | yes | Metadata path. It is used to get Service Provider metadata. Example: `` /api/v1/saml/abc123/metadata. Where `abc123` is a provider `id`. ``. | | `acsPath` | string | yes | Assertion Consumer Service URL receives the SAML response. Example: `` /api/v1/saml/abc123/acs. Where `abc123` is a provider `id`. ``. | | `sloPath` | string | no | Logout path. Example: `` /api/v1/saml/abc123/slo. Where `abc123` is a provider `id`. ``. | | `domains` | array of string | no | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Provider updated. | - | - | | `400` | Request is malformed. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X PUT "$MORPH_URL/api/v1/cluster/saml/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "string", "entityID": "string", "idpMetadata": "string", "rootURL": "https://morphbits.io/", "metadataPath": "/api/v1/saml/abc123/metadata. Where `abc123` is a provider `id`.", "acsPath": "/api/v1/saml/abc123/acs. Where `abc123` is a provider `id`." }' ``` ## DELETE /v1/cluster/saml/{providerID} {#delete-v1-cluster-saml-providerid} Delete SAML provider from the selected namespace. Namespace admins can delete providers only in their own namespace. Operation ID: `v1ClusterDeleteSAMLProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Provider deleted. | - | - | | `400` | Request is malformed. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/saml/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/cluster/saml/{providerID} {#get-v1-cluster-saml-providerid} Get SAML provider from the selected namespace. Namespace admins can get providers only in their own namespace. Operation ID: `v1ClusterGetSAMLProvider` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | | `X-Morph-Namespace` | header | string | no | Optional namespace selector for endpoints that support it. If omitted, authenticated resource operations use the token namespace unless the endpoint description says otherwise, while login or public operations use the default namespace "". Cross-namespace use is allowed only where the endpoint grants it, typically for global admins. Other authenticated sessions are limited to their own namespace. For backward compatibility, existing clients may omit this header. Constraints: maximum length 31. Example: `team-a`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | Ok. | - | [V1ClusterGetSAMLProviderResponse](schemas.md#v1clustergetsamlproviderresponse) (`application/json`) | | `400` | Request has invalid provider id length. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/saml/$PROVIDER_ID" \ -H "Authorization: Bearer $TOKEN" ``` ## POST /v1/cluster/namespaces {#post-v1-cluster-namespaces} Create a new namespace. Requires a global admin session. Operation ID: `v1CreateNamespace` **Authentication**: Required (`BearerAuth`). **Request body** Parameters of the new namespace in JSON. Media type `application/json`, schema: [CreateNamespaceRequest](schemas.md#createnamespacerequest). | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Namespace name must be 1 to 31 characters long, start with a lowercase letter, contain only lowercase letters, digits, and hyphens, and not end with a hyphen. Constraints: minimum length 1; maximum length 31. Example: `my-namespace`. | | `description` | string | no | Optional human-readable namespace description. Intended to explain the namespace purpose. Maximum 256 UTF-8 bytes. Constraints: maximum length 256. Example: `accounting production data and service accounts`. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `201` | Namespace successfully created. | `Location` | - | | `400` | At least one namespace parameter is invalid (e.g. required parameter is missing). | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `409` | Namespace already exists. | - | - | Headers of the `201` response: | Header | Type | Description | |---|---|---| | `Location` | string (uri) | URL of the created namespace. Example: `/api/v1/cluster/namespaces/NAMESPACE_ID`. | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/cluster/namespaces" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "my-namespace" }' ``` ## GET /v1/cluster/namespaces {#get-v1-cluster-namespaces} List all namespaces. Requires a global admin session. Operation ID: `v1ListNamespaces` **Authentication**: Required (`BearerAuth`). **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [ListNamespacesResponse](schemas.md#listnamespacesresponse) (`application/json`) | | `400` | Session token is omitted or invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | Body of the `200` response (`application/json`), schema [ListNamespacesResponse](schemas.md#listnamespacesresponse): | Field | Type | Required | Description | |---|---|---|---| | `namespaces` | array of string | yes | Namespace names. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/namespaces" \ -H "Authorization: Bearer $TOKEN" ``` ## GET /v1/cluster/namespaces/{namespace} {#get-v1-cluster-namespaces-namespace} Get information about the namespace by name. Requires a global admin session. Operation ID: `v1GetNamespace` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `namespace` | path | string | yes | Namespace name. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK | - | [GetNamespaceResponse](schemas.md#getnamespaceresponse) (`application/json`) | | `400` | Namespace reference is missing or invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | User is not authorized to get namespace info. | `WWW-Authenticate` | - | | `404` | Namespace not found. | - | - | Body of the `200` response (`application/json`), schema [GetNamespaceResponse](schemas.md#getnamespaceresponse): | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Namespace name. Constraints: minimum length 1; maximum length 31. Example: `my-namespace`. | | `description` | string | no | Optional human-readable namespace description. Intended to explain the namespace purpose. Maximum 256 UTF-8 bytes. Constraints: maximum length 256. Example: `accounting production data and service accounts`. | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/cluster/namespaces/$NAMESPACE" \ -H "Authorization: Bearer $TOKEN" ``` ## DELETE /v1/cluster/namespaces/{namespace} {#delete-v1-cluster-namespaces-namespace} Delete namespace from the system. Requires a global admin session. Operation ID: `v1DeleteNamespace` **Authentication**: Required (`BearerAuth`). **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `namespace` | path | string | yes | Namespace name. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `204` | Namespace successfully removed. | - | - | | `400` | Session token is omitted or invalid. | - | - | | `401` | Token is missing or incorrect. | `WWW-Authenticate` | - | | `403` | Insufficient rights to execute request. | `WWW-Authenticate` | - | | `404` | Namespace not found (not created or already removed). | - | - | | `409` | Namespace removal is not allowed. | - | - | **Example** ```shell curl -X DELETE "$MORPH_URL/api/v1/cluster/namespaces/$NAMESPACE" \ -H "Authorization: Bearer $TOKEN" ``` --- # OAuth Operations of the Morph REST API in the group `oauth`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` - `PROVIDER_ID`: value of the `providerID` path parameter | Operation | Summary | |---|---| | [`GET /v1/oauth/{providerID}/login`](#get-v1-oauth-providerid-login) | Login using OAuth provider. | | [`GET /v1/oauth/callback`](#get-v1-oauth-callback) | OAuth provider callback. | ## GET /v1/oauth/{providerID}/login {#get-v1-oauth-providerid-login} Login using OAuth provider. Operation ID: `v1OAuthLogin` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | OAuth provider id. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `307` | Redirect to auth provider resource. | - | - | | `404` | OAuth provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/oauth/$PROVIDER_ID/login" ``` ## GET /v1/oauth/callback {#get-v1-oauth-callback} OAuth provider callback. Operation ID: `v1OAuthCallback` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `state` | query | string | no | State to identify request. | | `code` | query | string | no | Code to identify request. | | `device_id` | query | string | no | Unique device ID received from OAuth provider. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `307` | Successfully authorized. | - | - | | `400` | Invalid response from OAuth provider or wrong provider configuration. | - | - | | `403` | OAuth provider auth failed. | - | - | | `404` | OAuth provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/oauth/callback" ``` --- # SAML Operations of the Morph REST API in the group `saml`. Conventions that apply to every operation are on the [overview page](index.md). Schemas are on the [schemas page](schemas.md). The examples use these environment variables: - `MORPH_URL`: address of the console, for example `http://localhost:9100` - `PROVIDER_ID`: value of the `providerID` path parameter | Operation | Summary | |---|---| | [`GET /v1/saml/{providerID}/login`](#get-v1-saml-providerid-login) | Login using SAML provider. | | [`POST /v1/saml/{providerID}/acs`](#post-v1-saml-providerid-acs) | ACS route for IDP provider. | | [`GET /v1/saml/{providerID}/metadata`](#get-v1-saml-providerid-metadata) | Get SP metadata. | ## GET /v1/saml/{providerID}/login {#get-v1-saml-providerid-login} Login using SAML provider. Operation ID: `v1SamlLogin` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `302` | Redirect to the SAML identity provider (redirect binding). With the POST binding the console answers `200` with an HTML form that posts the request to the provider. | - | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/saml/$PROVIDER_ID/login" ``` ## POST /v1/saml/{providerID}/acs {#post-v1-saml-providerid-acs} ACS route for IDP provider. It is called by IDP. Operation ID: `v1SamlAcs` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `302` | Access granted. | - | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X POST "$MORPH_URL/api/v1/saml/$PROVIDER_ID/acs" ``` ## GET /v1/saml/{providerID}/metadata {#get-v1-saml-providerid-metadata} Get SP metadata. Operation ID: `v1SamlMetadata` **Authentication**: None. The operation takes no credentials. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `providerID` | path | string | yes | SAML provider id. Constraints: maximum length 63. | **Responses** | Status | Description | Headers | Body | |---|---|---|---| | `200` | OK. The body is the service provider metadata as XML, with the content type `application/samlmetadata+xml`. | - | - | | `404` | Provider not found. | - | - | **Example** ```shell curl -X GET "$MORPH_URL/api/v1/saml/$PROVIDER_ID/metadata" ``` --- # Schemas Every schema under `components.schemas` of the specification, in the order of the specification. The operation pages link here. A field whose type is another schema links to that schema. ## V1GetUserResponse {#v1getuserresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `storageHardQuota` | integer (uint64) | yes | User's storage hard quota for all their buckets, in bytes. A zero value means unlimited. | | `storageSoftQuota` | integer (uint64) | yes | User's storage soft quota for all their buckets, in bytes. A zero value means unlimited. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | ## ListCursor {#listcursor} Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. Type: string. ## GetUserListResponse {#getuserlistresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `users` | array of [User](schemas.md#user) | yes | Users list. | | `totalCount` | integer (uint64) | yes | Total number of users in the namespace. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | ## User {#user} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | User name. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | ## UserRole {#userrole} The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Type: string. Constraints: one of `user`, `admin`. ## V1RegisterUserRequest {#v1registeruserrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | User name. Constraints: maximum length 53. Example: `mike`. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | | `password` | string | yes | User's password. | ## V1UpdateUserRequest {#v1updateuserrequest} Body of the deprecated `POST /v1/users/{user}`, where both fields are required. `PUT /v1/users/{user}` takes the same two fields, both optional. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | | `password` | string | yes | User's new password. | ## GetUserMetricsResponse {#getusermetricsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `bucketCount` | integer (uint64) | yes | Total number of buckets owned by the user. | | `usedSpace` | integer (uint64) | yes | Used space by user in bytes. | ## GrantStorageNodeRequest {#grantstoragenoderequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `address` | string | yes | Storage node address to grant access to the network. Example: `Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn`. | ## GrantGatewayRequest {#grantgatewayrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `publicKey` | string | yes | Public key to register as a Morph and S3 gateway key, its account is granted access to the network. Example: `03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b`. | ## ListStorageNodesResponse {#liststoragenodesresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `nodes` | array of [StorageNode](schemas.md#storagenode) | yes | Storage nodes in the current NetMap snapshot. | ## ListGatewaysResponse {#listgatewaysresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `gateways` | array of [Gateway](schemas.md#gateway) | yes | Registered gateway keys. | ## Gateway {#gateway} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `publicKey` | string | yes | Registered gateway public key. | | `address` | string | yes | Address derived from the gateway public key. | ## StorageNode {#storagenode} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `publicKey` | string | yes | Compressed public key announced by the storage node. | | `address` | string | yes | Address derived from the storage node public key. | | `endpoints` | array of string | yes | Network endpoints announced by the storage node. | | `attributes` | map of string to string | yes | Attributes announced by the storage node. | ## StorageNodeAddress {#storagenodeaddress} Request data for the action selected by the `x-morph-action` header. `grant-access` uses `address` and/or `publicKey`; at least one must be set. An `address` grants a storage node and is subject to storage-node admission. A public-key-only request grants a Morph/S3 gateway without storage-node admission. When both are set, they may identify different wallets. `address` is the storage node wallet and `publicKey` is the gateway/Morph wallet. `decommission` uses account addresses in `accounts`. Fields used only by the other action are ignored. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `address` | string | no | Storage node address for `grant-access`. Optional if publicKey is set. Example: `Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn`. | | `publicKey` | string | no | Optional public key to register as Morph and S3 gateway key for `grant-access`. If address is omitted, its derived address is used as the gateway account. Example: `03b209fd4f06c755b5bf3da6f9b6772542496950571a1734fc4e606c21ce72291b`. | | `accounts` | array of string | no | Account addresses for legacy batch `decommission`. Each account must be a current or candidate storage node, a registered Morph/S3 gateway, or already blocked. An already blocked account is accepted as a safe retry after a lost `204`. Matching registered Morph/S3 public keys and Netmap candidates are removed, current storage nodes become absent at the next epoch. Constraints: at least 1 item. | ## CreateBucketRequest {#createbucketrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Bucket name. Must be 1 to 63 lowercase letters, digits, and hyphens, and must start and end with a lowercase letter or digit. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `placementPolicyName` | string | yes | Placement policy name. The max policy length is 42. Constraints: minimum length 1; maximum length 42. Example: `REP-1`. | | `basicACL` | [BasicACL](schemas.md#basicacl) | yes | | | `lockUntil` | string (date-time) | no | Optional date until which the bucket cannot be deleted, in RFC 3339 format. This period can be extended, but there is no way to make it expire earlier. Cannot be used with lockHours. Example: `2030-01-01T00:00:00Z`. | | `lockHours` | integer (uint64) | no | **Deprecated.** Deprecated compatibility parameter. Use lockUntil instead. Cannot be used with lockUntil. Constraints: minimum 0. | | `eACL` | [EACL](schemas.md#eacl) | no | Optional initial eACL table for the bucket. Allowed only when basicACL is not final. Requires the setBucketEACL token permission. | ## SetEaclRequest {#seteaclrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `eACL` | [EACL](schemas.md#eacl) | yes | | ## GetEaclResponse {#geteaclresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `eACL` | [EACL](schemas.md#eacl) | yes | | ## ListBucketsResponse {#listbucketsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `buckets` | array of string | yes | Bucket names. | | `totalCount` | integer (uint64) | yes | Total number of buckets owned by the user. Not affected by the prefix filter or by pagination, this is the same value as in the user metrics response. | | `usedSpace` | integer (uint64) | yes | Used space by user in bytes. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | ## GetBucketResponse {#getbucketresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `creationDate` | string (date-time) | yes | Bucket creation date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `name` | string | yes | Bucket name. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `basicACL` | [BasicACL](schemas.md#basicacl) | yes | | | `eACL` | [EACL](schemas.md#eacl) | yes | | | `placementPolicy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `owner` | string | yes | User that owns this bucket. Example: `user@example.org`. | | `usedSpace` | integer (uint64) | yes | Bucket used space in bytes. | | `numberOfObjects` | integer (uint64) | yes | Number of objects in container. | | `metadataConsistency` | [MetadataConsistency](schemas.md#metadataconsistency) | yes | Metadata consistency of the bucket. An empty string when the storage policy of the bucket sets none, which is the case for the seeded policies and for buckets created through S3. Constraints: one of `strict`, `optimistic`. | | `lockUntil` | string (date-time) | no | Date until which the bucket cannot be deleted in RFC 3339 format. Returned in UTC (with “Z”). If omitted or set to a time in the past, the bucket is not locked for deletion. Example: `2022-11-21T07:12:42.68680647Z`. | ## CreateBucketTransferRequest {#createbuckettransferrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `recipientLogin` | string | yes | Recipient user login. | ## CreateBucketTransferResponse {#createbuckettransferresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `transfer` | [BucketTransfer](schemas.md#buckettransfer) | yes | | ## ListBucketTransfersResponse {#listbuckettransfersresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `transfers` | array of [BucketTransfer](schemas.md#buckettransfer) | yes | | ## BucketTransfer {#buckettransfer} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | Transfer ID. Constraints: minimum length 1. Example: `2b5b6d2c-44b5-4b92-8a1f-3b8a03d69c2a`. | | `bucket` | string | yes | Bucket name. Constraints: minimum length 1; maximum length 63; pattern `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `my-bucket`. | | `senderLogin` | string | yes | Sender user login. Constraints: minimum length 1. Example: `sender`. | | `recipientLogin` | string | yes | Recipient user login. Constraints: minimum length 1. Example: `recipient`. | ## CreateObjectResponse {#createobjectresponse} Object successfully created. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `oid` | string | yes | Created object id. Example: `2z2ipYCDc5uWfNQTXeuYzv2pAGrLASKkRFXkUpzMsEJu`. | ## ListObjectsResponse {#listobjectsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `objects` | array of [Object](schemas.md#object) | yes | Object descriptors. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | ## Object {#object} Object descriptor. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `oid` | string | yes | Object id. Example: `2z2ipYCDc5uWfNQTXeuYzv2pAGrLASKkRFXkUpzMsEJu`. | | `path` | string | yes | Object file path. Constraints: minimum length 1. Example: `my-object`. | | `creationDate` | string (date-time) | yes | Creation date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `size` | integer (uint64) | yes | Data size. Constraints: minimum 0. | | `contentType` | string | yes | Media type from https://www.iana.org/assignments/media-types/media-types.xhtml. Constraints: default `"application/octet-stream"`. | | `expirationDate` | string (date-time) | no | Expiration date in RFC 3339 format. Absent if the object doesn't expire. Example: `2022-11-22T07:12:42Z`. | ## SearchObjectsRequest {#searchobjectsrequest} List of parameters for the search request. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `filters` | array of [SearchFilter](schemas.md#searchfilter) | no | Optional list of up to 7 object filters. If it is not specified, all objects are returned. Special filter keys starting with "$Object:" can be used to filter by system attributes. The expected value formats are: "$Object:payloadLength" – payload size in bytes, as a decimal uint64 string. "$Object:ownerID" – object creator identifier, as a user ID string. "$Object:payloadHash" – SHA-256 hash of the payload, as a hex-encoded string (64 hex characters, 32 bytes). "$Object:creationEpoch" – object creation epoch, as a decimal uint64 string. Other keys starting from "$Object:*", as well as all reserved attributes starting with "__", lead to a 400 error. Other keys are treated as user-defined object attributes (for example "FilePath"). Constraints: at most 7 items. | | `attributes` | array of string | no | Optional list of attributes to be returned for each object. It must contain up to 7 attributes. Basic object metadata can be retrieved by requesting the attributes: "FilePath", "Content-Type" and "Timestamp" as the creation date. You also may request reserved attributes: "$Object:payloadLength", "$Object:ownerID", "$Object:payloadHash", "$Object:creationEpoch". However, any other values starting from "$Object:*", as well as all reserved attributes starting with "__", will result in a 400 error. If this parameter is empty, no attributes will be returned, only object IDs. Constraints: at most 7 items. Example: `["Timestamp","FilePath","UserDefined"]`. | Example: ```json { "filters": [ { "key": "FilePath", "value": "some/prefix", "match": "MatchCommonPrefix" }, { "key": "CustomAttributeKey", "value": "attr-value", "match": "MatchStringEqual" } ], "attributes": [ "FilePath", "CustomAttributeKey" ] } ``` ## SearchFilter {#searchfilter} Filter used to match object attributes. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `key` | string | yes | Name of the attribute to apply the filter to (for example, "FilePath", "Content-Type", or a user-defined attribute key). | | `value` | string | yes | Numeric filters (MatchNum*) decimal values within the supported 256-bit integer range [-(2^256 - 1), 2^256 - 1]. | | `match` | [SearchMatch](schemas.md#searchmatch) | yes | Search match type. Constraints: one of `MatchStringEqual`, `MatchStringNotEqual`, `MatchNotPresent`, `MatchCommonPrefix`, `MatchNumGT`, `MatchNumGE`, `MatchNumLT`, `MatchNumLE`. | Example: ```json { "key": "FilePath", "value": "some/prefix/object-name", "match": "MatchStringEqual" } ``` ## SearchMatch {#searchmatch} Search match type. Type: string. Constraints: one of `MatchStringEqual`, `MatchStringNotEqual`, `MatchNotPresent`, `MatchCommonPrefix`, `MatchNumGT`, `MatchNumGE`, `MatchNumLT`, `MatchNumLE`. ## SearchObjectsResponse {#searchobjectsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `objects` | array of [SearchObjects](schemas.md#searchobjects) | yes | | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | | `incomplete` | boolean | no | Present if true and omitted if false. It indicates an incomplete success. The search was performed, but not all nodes returned results, so some items may be missing. | ## SearchObjects {#searchobjects} Requested object information. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `objectId` | string | yes | Example: `8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd`. | | `attributes` | object (any properties) | yes | Requested attributes. The first filter key is not returned unless it was requested: the console adds it to the search internally and removes it from every result again. | Example: ```json { "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd", "attributes": { "filePath": "/my/object/name.txt" } } ``` ## GetMetricsResponse {#getmetricsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `buckets` | integer (uint64) | yes | Total number of buckets in the system. Constraints: minimum 0. | | `objects` | integer (uint64) | yes | Total number of objects in all buckets in the system. Constraints: minimum 0. | | `dataSize` | integer (uint64) | yes | Total amount of object data stored in the system (excl. metadata). Constraints: minimum 0. | | `users` | integer (uint64) | yes | Total number of users in the system, including all namespaces. Constraints: minimum 0. | | `nodes` | array of [MetricsNode](schemas.md#metricsnode) | yes | Listing of nodes' metrics. | ## TokenType {#tokentype} Token type. The `session` type is used in user login session tokens and for login via an OAuth provider; the `pat` (Personal Access Token) type is for external apps/services. Type: string. Constraints: one of `session`, `pat`. ## BaseTokenInfo {#basetokeninfo} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | Token ID. | | `name` | string | yes | User-defined token name. | ## S3GetAccessTokensResponse {#s3getaccesstokensresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `tokens` | array of [S3TokenInfo](schemas.md#s3tokeninfo) | yes | Tokens list. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | ## S3TokenInfo {#s3tokeninfo} Type: object. Composed of: [BaseTokenInfo](schemas.md#basetokeninfo). | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | Token ID. | | `name` | string | yes | User-defined token name. | ## S3CreateAccessTokenResponse {#s3createaccesstokenresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `access_key_id` | string | yes | AWS access key ID. | | `secret_access_key` | string | yes | AWS secret access Key. | ## S3GetAccessTokenDetailsResponse {#s3getaccesstokendetailsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `token` | [S3DetailedTokenInfo](schemas.md#s3detailedtokeninfo) | yes | | ## S3DetailedTokenInfo {#s3detailedtokeninfo} Type: object. Composed of: [CommonDetailedTokenInfo](schemas.md#commondetailedtokeninfo), inline fields. | Field | Type | Required | Description | |---|---|---|---| | `createBucket` | boolean | yes | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | yes | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | yes | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `expiresAt` | string (date-time) | yes | Estimated time when token will expire in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `createdAt` | string (date-time) | yes | Time when token was issued in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `name` | string | yes | User-defined token name. | | `bucketName` | string | yes | When set to non empty value, it restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `read` | boolean | yes | Flag allowing to read objects with this token. Constraints: default `true`. | | `modify` | boolean | yes | Flag allowing to create and delete objects with this token. Constraints: default `true`. | | `manageSettings` | boolean | yes | Flag allowing to manage S3 bucket cors, tags, notifications, ownerships and locks with this token. Constraints: default `true`. | ## GetBearerTokenDetailsResponse {#getbearertokendetailsresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `token` | [DetailedBearerTokenInfo](schemas.md#detailedbearertokeninfo) | yes | | ## DetailedBearerTokenInfo {#detailedbearertokeninfo} Type: object. Composed of: [CommonDetailedTokenInfo](schemas.md#commondetailedtokeninfo), inline fields. | Field | Type | Required | Description | |---|---|---|---| | `createBucket` | boolean | yes | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | yes | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | yes | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `expiresAt` | string (date-time) | yes | Estimated time when token will expire in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `createdAt` | string (date-time) | yes | Time when token was issued in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `name` | string | yes | User-defined token name. | | `bucketName` | string | yes | When set to non empty value, it restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `get` | boolean | yes | When set to true, this token grants permission for GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `head` | boolean | yes | When set to true, this token grants permission for HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `put` | boolean | yes | When set to true, this token grants permission for PUT object operation (create objects). | | `delete` | boolean | yes | When set to true, this token grants permission for DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `search` | boolean | yes | When set to true, this token grants permission for SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. Reflects the requested flag only, SEARCH is also granted if `deleteBucket` is set. | | `readContent` | boolean | yes | **Deprecated.** Use Get instead. When set to true, this token grants permission to read objects. Deprecated, use get instead. | | `readHeaders` | boolean | yes | **Deprecated.** Use Head and Search instead. When set to true, this token grants permission to read objects headers. Deprecated, use head and search instead. | | `create` | boolean | yes | **Deprecated.** Use Put instead. When set to true, this token grants permission to create objects. Deprecated, use put instead. | | `registerUser` | boolean | yes | When set to true, this token grants permission to register a new user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateUser` | boolean | yes | When set to true, this token grants permission to update an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteUser` | boolean | yes | When set to true, this token grants permission to delete an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listUser` | boolean | yes | When set to true, this token grants permission to list users. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setUserQuota` | boolean | yes | When set to true, this token grants permission to set user storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setDefaultStorageQuota` | boolean | yes | When set to true, this token grants permission to set default storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `getUserPolicies` | boolean | yes | When set to true, this token grants permission to get user storage policies. Constraints: default `false`. | | `createUserPolicy` | boolean | yes | When set to true, this token grants permission to create user storage policy. Constraints: default `false`. | | `updateUserPolicy` | boolean | yes | When set to true, this token grants permission to update user storage policy. Constraints: default `false`. | | `getUserPolicy` | boolean | yes | When set to true, this token grants permission to get user storage policy. Constraints: default `false`. | | `deleteUserPolicy` | boolean | yes | When set to true, this token grants permission to delete user storage policy. Constraints: default `false`. | | `createSystemPolicy` | boolean | yes | When set to true, this token grants permission to create system storage policy. This option is available to global admins only. Constraints: default `false`. | | `updateSystemPolicy` | boolean | yes | When set to true, this token grants permission to update system storage policy. This option is available to global admins only. Constraints: default `false`. | | `deleteSystemPolicy` | boolean | yes | When set to true, this token grants permission to delete system storage policy. This option is available to global admins only. Constraints: default `false`. | | `s3GetTokens` | boolean | yes | When set to true, this token grants permission to get S3 access tokens. Constraints: default `false`. | | `s3CreateToken` | boolean | yes | When set to true, this token grants permission to create S3 access token. Constraints: default `false`. | | `s3TokenDetails` | boolean | yes | When set to true, this token grants permission to get S3 access token details. Constraints: default `false`. | | `s3RevokeToken` | boolean | yes | When set to true, this token grants permission to revoke S3 access token. Constraints: default `false`. | | `getBearerTokens` | boolean | yes | When set to true, this token grants permission to get Bearer tokens. Constraints: default `false`. | | `createBearerToken` | boolean | yes | When set to true, this token grants permission to create Bearer token. Constraints: default `false`. | | `bearerTokenDetails` | boolean | yes | When set to true, this token grants permission to get Bearer token details. Constraints: default `false`. | | `revokeBearerToken` | boolean | yes | When set to true, this token grants permission to revoke Bearer token. Constraints: default `false`. | | `createOAuthProvider` | boolean | yes | When set to true, this token grants permission to create OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateOAuthProvider` | boolean | yes | When set to true, this token grants permission to update OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteOAuthProvider` | boolean | yes | When set to true, this token grants permission to delete OAuth provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `uploadLicense` | boolean | yes | When set to true, this token grants permission to upload license. This option is available to global admins only. Constraints: default `false`. | | `getLicense` | boolean | yes | When set to true, this token grants permission to get license metadata. This option is available to global admins only. Constraints: default `false`. | | `getIRPublicKeys` | boolean | yes | When set to true, this token grants permission to get IR public keys. This option is available to global admins only. Constraints: default `false`. | | `getUserMetrics` | boolean | yes | When set to true, this token grants permission to get user metrics. This option is available to admins only. Constraints: default `false`. | | `createSAMLProvider` | boolean | yes | When set to true, this token grants permission to create SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateSAMLProvider` | boolean | yes | When set to true, this token grants permission to update SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteSAMLProvider` | boolean | yes | When set to true, this token grants permission to delete SAML provider. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listBucketTransfers` | boolean | yes | When set to true, this token grants permission to list user bucket transfers. Constraints: default `false`. | | `createNamespace` | boolean | yes | When set to true, this token grants permission to create namespace. This option is available to global admins only. Constraints: default `false`. | | `getNamespace` | boolean | yes | When set to true, this token grants permission to get namespace. This option is available to global admins only. Constraints: default `false`. | | `listNamespaces` | boolean | yes | When set to true, this token grants permission to list namespaces. This option is available to global admins only. Constraints: default `false`. | | `deleteNamespace` | boolean | yes | When set to true, this token grants permission to delete namespace. This option is available to global admins only. Constraints: default `false`. | ## CommonDetailedTokenInfo {#commondetailedtokeninfo} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `createBucket` | boolean | yes | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | yes | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | yes | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `expiresAt` | string (date-time) | yes | Estimated time when token will expire in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `createdAt` | string (date-time) | yes | Time when token was issued in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `name` | string | yes | User-defined token name. | | `bucketName` | string | yes | When set to non empty value, it restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | ## CreateBearerTokenResponse {#createbearertokenresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Bearer token. | ## CreateAccessTokenRequest {#createaccesstokenrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | eACL records of the token. Constraints: at least 1 item. | | `expiresAt` | string (date-time) | yes | Token expiration date in RFC 3339 format. It is rounded up to the network epoch boundary. | | `owner` | string | no | Login of the user (in the issuer's namespace) the token is bound to. If omitted, the token can be used by anyone. | ## CreateAccessTokenResponse {#createaccesstokenresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Signed access token in base64 encoding. | ## GetBearerTokensResponse {#getbearertokensresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `tokens` | array of [BearerTokenInfo](schemas.md#bearertokeninfo) | yes | Bearer tokens list. | | `cursor` | [ListCursor](schemas.md#listcursor) | no | Value to pass as `cursor` into the next request to fetch subsequent elements. Omitted if there are no more elements. | ## BearerTokenInfo {#bearertokeninfo} Type: object. Composed of: [BaseTokenInfo](schemas.md#basetokeninfo), inline fields. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | Token ID. | | `name` | string | yes | User-defined token name. | | `type` | [TokenType](schemas.md#tokentype) | no | Token type. Constraints: one of `session`, `pat`. | ## SetStorageQuotaRequest {#setstoragequotarequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | no | Default storage soft quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be less than the hard quota. | | `hardQuota` | integer (uint64) | no | Default storage hard quota for users in bytes. A zero value means unlimited. When both quotas are nonzero, it must be greater than the soft quota. | ## GetStorageQuotaResponse {#getstoragequotaresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `softQuota` | integer (uint64) | yes | Default storage soft quota for users in bytes. A zero value means unlimited. | | `hardQuota` | integer (uint64) | yes | Default storage hard quota for users in bytes. A zero value means unlimited. | ## GetTimelockResponse {#gettimelockresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `lockUntil` | string (date-time) | yes | Date until which the bucket cannot be deleted, in RFC 3339 format. Returned in UTC (with “Z”). If empty or set to a time in the past, the bucket is not locked for deletion. Example: `2022-11-21T07:12:42.68680647Z`. | ## SetTimelockRequest {#settimelockrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `lockUntil` | string (date-time) | yes | Date until which the bucket cannot be deleted, in RFC 3339 format. This period can be extended, but there is no way to make it expire earlier. Example: `2030-01-01T00:00:00Z`. | ## V1LoginRequest {#v1loginrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `login` | string | yes | Account login. | | `password` | string | yes | Account password. | ## V1LoginResponse {#v1loginresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `token` | string | yes | Unified access token. | | `role` | [UserRole](schemas.md#userrole) | yes | The list of possible user roles. Users with the admin role in the default namespace are global admins. Users with the admin role in a non-default namespace are namespace admins and can manage only resources scoped to their namespace. Constraints: one of `user`, `admin`. | ## CommonCreateTokenRequest {#commoncreatetokenrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `ttl` | string | no | The value can be set as a duration or a date. Token lifetime is measured in real time. Constraints: default `"30 days."`. Example: `10m - 10 minutes. 24h - 24 hours. 48h - 2 days. Use format "2024-10-23 15:04:05" to set the date instead of duration.`. | | `createBucket` | boolean | no | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | no | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | no | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `bucketName` | string | no | When set to a non-empty value, this restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `tokenName` | string | yes | User defined token name. It may contain "a-z", "A-Z", "0-9", ".", "-", " ". Constraints: maximum length 256. | ## S3CreateAccessTokenRequest {#s3createaccesstokenrequest} Type: object. Composed of: [CommonCreateTokenRequest](schemas.md#commoncreatetokenrequest), inline fields. | Field | Type | Required | Description | |---|---|---|---| | `ttl` | string | no | The value can be set as a duration or a date. Token lifetime is measured in real time. Constraints: default `"30 days."`. Example: `10m - 10 minutes. 24h - 24 hours. 48h - 2 days. Use format "2024-10-23 15:04:05" to set the date instead of duration.`. | | `createBucket` | boolean | no | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | no | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | no | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `bucketName` | string | no | When set to a non-empty value, this restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `tokenName` | string | yes | User defined token name. It may contain "a-z", "A-Z", "0-9", ".", "-", " ". Constraints: maximum length 256. | | `read` | boolean | no | Flag allowing to read objects with this token. Constraints: default `true`. | | `modify` | boolean | no | Flag allowing to create and delete objects with this token. Constraints: default `true`. | | `manageSettings` | boolean | no | Flag allowing to manage S3 bucket cors, tags, notifications, ownerships and locks with this token. Constraints: default `true`. | ## CreateBearerTokenRequest {#createbearertokenrequest} Type: object. Composed of: [CommonCreateTokenRequest](schemas.md#commoncreatetokenrequest), inline fields. | Field | Type | Required | Description | |---|---|---|---| | `ttl` | string | no | The value can be set as a duration or a date. Token lifetime is measured in real time. Constraints: default `"30 days."`. Example: `10m - 10 minutes. 24h - 24 hours. 48h - 2 days. Use format "2024-10-23 15:04:05" to set the date instead of duration.`. | | `createBucket` | boolean | no | When set to true, this token grants permission to create buckets. For a personal access token this option enables `setBucketEacl` as well. For an S3 credential it does not. Constraints: default `true`. | | `deleteBucket` | boolean | no | When set to true, this token grants permission to delete buckets. Note that this option enables SEARCH object operation as well. Constraints: default `true`. | | `setBucketEACL` | boolean | no | When set to true, this token grants permission to set buckets EACLs. Constraints: default `true`. | | `bucketName` | string | no | When set to a non-empty value, this restricts the token to function exclusively within this bucket. Note, if you set this option, you cannot create a bucket, even if `createBucket` is set to true. | | `tokenName` | string | yes | User defined token name. It may contain "a-z", "A-Z", "0-9", ".", "-", " ". Constraints: maximum length 256. | | `get` | boolean | no | Flag allowing GET object operation (read object payload) with this token. Addressing an object by FilePath additionally requires SEARCH. Constraints: default `true`. | | `head` | boolean | no | Flag allowing HEAD object operation (read object headers) with this token. Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. Constraints: default `true`. | | `put` | boolean | no | Flag allowing PUT object operation (create objects) with this token. Constraints: default `true`. | | `delete` | boolean | no | Flag allowing DELETE object operation with this token. Addressing an object by FilePath additionally requires SEARCH. Constraints: default `true`. | | `search` | boolean | no | Flag allowing SEARCH object operation with this token. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. Note that `deleteBucket` enables this operation as well. Constraints: default `true`. | | `readContent` | boolean | no | **Deprecated.** Use Get instead. Flag allowing to read objects with this token. Deprecated, use get instead. Ignored if get is set. Constraints: default `true`. | | `readHeaders` | boolean | no | **Deprecated.** Use Head and Search instead. Flag allowing to read headers objects with this token. Deprecated, use head and search instead. `head` overrides it for HEAD, `search` overrides it for SEARCH. Constraints: default `true`. | | `create` | boolean | no | **Deprecated.** Use Put instead. Flag allowing to create objects with this token. Deprecated, use put instead. Ignored if put is set. Constraints: default `true`. | | `registerUser` | boolean | no | When set to true, this token grants permission to register a new user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateUser` | boolean | no | When set to true, this token grants permission to update an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteUser` | boolean | no | When set to true, this token grants permission to delete an existing user. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listUser` | boolean | no | When set to true, this token grants permission to list users. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setUserQuota` | boolean | no | When set to true, this token grants permission to set user storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `setDefaultStorageQuota` | boolean | no | When set to true, this token grants permission to set default storage quota. This option is available to admins only. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `getUserPolicies` | boolean | no | When set to true, this token grants permission to get user storage policies. Constraints: default `false`. | | `createUserPolicy` | boolean | no | When set to true, this token grants permission to create user storage policy. Constraints: default `false`. | | `updateUserPolicy` | boolean | no | When set to true, this token grants permission to update user storage policy. Constraints: default `false`. | | `getUserPolicy` | boolean | no | When set to true, this token grants permission to get user storage policy. Constraints: default `false`. | | `deleteUserPolicy` | boolean | no | When set to true, this token grants permission to delete user storage policy. Constraints: default `false`. | | `createSystemPolicy` | boolean | no | When set to true, this token grants permission to create system storage policy. This option is available to global admins only. Constraints: default `false`. | | `updateSystemPolicy` | boolean | no | When set to true, this token grants permission to update system storage policy. This option is available to global admins only. Constraints: default `false`. | | `deleteSystemPolicy` | boolean | no | When set to true, this token grants permission to delete system storage policy. This option is available to global admins only. Constraints: default `false`. | | `s3GetTokens` | boolean | no | When set to true, this token grants permission to get S3 access tokens. Constraints: default `false`. | | `s3CreateToken` | boolean | no | When set to true, this token grants permission to create S3 access token. Constraints: default `false`. | | `s3TokenDetails` | boolean | no | When set to true, this token grants permission to get S3 access token details. Constraints: default `false`. | | `s3RevokeToken` | boolean | no | When set to true, this token grants permission to revoke S3 access token. Constraints: default `false`. | | `getBearerTokens` | boolean | no | When set to true, this token grants permission to get Bearer tokens. Constraints: default `false`. | | `createBearerToken` | boolean | no | When set to true, this token grants permission to create Bearer token. Constraints: default `false`. | | `bearerTokenDetails` | boolean | no | When set to true, this token grants permission to get Bearer token details. Constraints: default `false`. | | `revokeBearerToken` | boolean | no | When set to true, this token grants permission to revoke Bearer token. Constraints: default `false`. | | `createOAuthProvider` | boolean | no | When set to true, this token grants permission to create OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateOAuthProvider` | boolean | no | When set to true, this token grants permission to update OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteOAuthProvider` | boolean | no | When set to true, this token grants permission to delete OAuth providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `uploadLicense` | boolean | no | When set to true, this token grants permission to upload license. This option is available to global admins only. Constraints: default `false`. | | `getLicense` | boolean | no | When set to true, this token grants permission to get license metadata. This option is available to global admins only. Constraints: default `false`. | | `getIRPublicKeys` | boolean | no | When set to true, this token grants permission to get IR public keys. This option is available to global admins only. Constraints: default `false`. | | `getUserMetrics` | boolean | no | When set to true, this token grants permission to get user metrics. This option is available to admins only. Constraints: default `false`. | | `createSAMLProvider` | boolean | no | When set to true, this token grants permission to create SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `updateSAMLProvider` | boolean | no | When set to true, this token grants permission to update SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `deleteSAMLProvider` | boolean | no | When set to true, this token grants permission to delete SAML providers. Namespace admins can use it only in their own namespace. Constraints: default `false`. | | `listBucketTransfers` | boolean | no | When set to true, this token grants permission to list user bucket transfers. Constraints: default `false`. | | `createNamespace` | boolean | no | When set to true, this token grants permission to create namespace. This option is available to global admins only. Constraints: default `false`. | | `getNamespace` | boolean | no | When set to true, this token grants permission to get namespace. This option is available to global admins only. Constraints: default `false`. | | `listNamespaces` | boolean | no | When set to true, this token grants permission to list namespaces. This option is available to global admins only. Constraints: default `false`. | | `deleteNamespace` | boolean | no | When set to true, this token grants permission to delete namespace. This option is available to global admins only. Constraints: default `false`. | ## MetricsNode {#metricsnode} Node metrics. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `endpoint` | string | yes | Network endpoint of the node server. | | `uptime` | integer (uint64) | yes | Time elapsed since node startup in seconds. In this release the bundled console does not compute it and always reports 0. Constraints: minimum 0. | | `drives` | array of [MetricsDrive](schemas.md#metricsdrive) | yes | Listing of drives' metrics. | ## MetricsDrive {#metricsdrive} Drive metrics. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `mountPoint` | string | yes | Mount point of the drive. In this release the bundled console does not set it and always reports an empty string. | | `totalSpace` | integer (uint64) | yes | Total disk space of the node in bytes. Constraints: minimum 0. | | `usedSpace` | integer (uint64) | yes | Used disk space in bytes. In this release the bundled console does not compute it and always reports 0; only totalSpace (from the node capacity attribute) is filled. Constraints: minimum 0. | | `availSpace` | integer (uint64) | yes | Available disk space in bytes. In this release the bundled console does not compute it and always reports 0. Constraints: minimum 0. | ## EACLRecord {#eaclrecord} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `operation` | string ([OperationType](schemas.md#operationtype)) | yes | Request's operation type to match if the rule is applicable to a particular request. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. | | `action` | string ([ActionType](schemas.md#actiontype)) | yes | Rule execution result action. Constraints: one of `ALLOW`, `DENY`. | | `filters` | array of [RecordFilter](schemas.md#recordfilter) | yes | Filters for records. | | `targets` | array of [RecordTarget](schemas.md#recordtarget) | yes | Target to apply ACL rule. Can be a subject's role class or a list of public keys to match. | Example: ```json { "operation": "GET", "action": "ALLOW", "filters": [], "targets": [ { "role": "OTHERS" } ] } ``` ## OperationType {#operationtype} Type: string. Constraints: one of `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH`. ## ActionType {#actiontype} Type: string. Constraints: one of `ALLOW`, `DENY`. ## RecordFilter {#recordfilter} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `headerType` | string ([HeaderType](schemas.md#headertype)) | yes | Define if Object or Request header will be used. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. | | `matchType` | string ([MatchType](schemas.md#matchtype)) | yes | Match operation type. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. | | `key` | string | yes | Name of the Header to use. | | `value` | string | yes | Expected Header Value or pattern to match. | ## HeaderType {#headertype} Type: string. Constraints: one of `REQUEST`, `OBJECT`, `SERVICE`. ## MatchType {#matchtype} Type: string. Constraints: one of `STRING_EQUAL`, `STRING_NOT_EQUAL`. ## Role {#role} Type: string. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. ## RecordTarget {#recordtarget} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `role` | string ([Role](schemas.md#role)) | no | Target subject's role class. Not required if accounts are set. Constraints: one of `USER`, `SYSTEM`, `OTHERS`. | | `accounts` | array of string | no | List of target accounts (from the same namespace as the bucket owner). Not required if the role is set. The account might not be registered yet. | ## StoragePolicy {#storagepolicy} Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `replicas` | array of [Replica](schemas.md#replica) | yes | Rules to set number of object replicas and place each one into a named bucket. | | `placementFactor` | integer (uint32) | yes | Bucket placement factor defines the maximum number of storage nodes (replicas×factor) that will store bucket data. | | `selectors` | array of [Selector](schemas.md#selector) | yes | Set of Selectors to form the bucket's nodes subset. | | `filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | List of named filters to reference in selectors. | | `ecRules` | array of [ECRule](schemas.md#ecrule) | no | List of erasure coding rules for the container. Constraints: at most 4 items. | | `initialPlacement` | [InitialPlacementPolicy](schemas.md#initialplacementpolicy) | no | Controls how objects are placed initially before the full policy is applied. | Example: ```json { "replicas": [ { "count": 1, "selector": "" } ], "placementFactor": 1, "selectors": [], "filters": [] } ``` ## InitialPlacementPolicy {#initialplacementpolicy} Controls how objects are placed initially before the full policy is applied. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `replicaLimits` | array of integer (uint32) | no | Sets replica counts for each REP and EC rule. If used with maxReplicas sets the maximum number of replicas for each rule. | | `maxReplicas` | integer (uint32) | no | Sets max number of object replicas and EC partitions. Zero value means following `replicaLimits` with no additional constraint for overall replica count. | | `preferLocal` | boolean | no | Indicates preference for local (as per node processing the request) storage placement. | ## Replica {#replica} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `count` | integer (uint32) | yes | How many object replicas to put. | | `selector` | string | yes | Named selector bucket to put replicas. | ## Selector {#selector} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Selector name to reference in object placement section. | | `count` | integer (uint32) | yes | How many nodes to select from the bucket. | | `attribute` | string | yes | Bucket attribute to select from. | | `filter` | string | yes | Filter reference to select from. | | `clause` | string | no | Selector modifier showing how to form a bucket. Defaults to DISTINCT. | ## Clause {#clause} Type: string. Constraints: one of `SAME`, `DISTINCT`. ## PlacementFilter {#placementfilter} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter. | | `key` | string | yes | Key to filter. | | `op` | string | yes | Filtering operation. | | `value` | string | yes | Value to match. | | `filters` | array of [PlacementFilter](schemas.md#placementfilter) | yes | | ## ECRule {#ecrule} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `selector` | string | no | Name of the corresponding selector to put EC data. | | `dataParts` | integer (uint32) | yes | Number of data parts. The dataParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | | `parityParts` | integer (uint32) | yes | Number of parity pats. The parityParts value of sum of dataParts+parityParts can't be greater 64. Constraints: maximum 64. | ## Operation {#operation} Type: string. Constraints: one of `EQ`, `NE`, `GT`, `GE`, `LT`, `LE`, `OR`, `AND`. ## EACL {#eacl} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `records` | array of [EACLRecord](schemas.md#eaclrecord) | yes | The records of the table. `null`, not an empty array, when the table has no records, as for a bucket created without an extended ACL. | ## BasicACL {#basicacl} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `final` | boolean | no | Flag denying Extended ACL. Access tokens are not applicable to a final basic ACL either. | | `disableAccessTokens` | boolean | no | Flag denying access tokens to extend the bucket permissions. Access tokens are allowed by default. Always true for final basic ACL. | | `sticky` | boolean | no | **Deprecated.** Flag denying different owners of the request and the object. Deprecated, ignored on bucket creation. | | `owner` | [ACLGroup](schemas.md#aclgroup) | no | | | `others` | [ACLGroup](schemas.md#aclgroup) | no | | ## ACLGroup {#aclgroup} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `get` | boolean | no | Flag allows GET object operation (read object payload). Addressing an object by FilePath additionally requires SEARCH. | | `head` | boolean | no | Flag allows HEAD object operation (read object headers). Addressing an object by FilePath additionally requires SEARCH. Note that GET responses include object headers too, this flag covers HEAD requests only. | | `put` | boolean | no | Flag allows PUT object operation (create new objects). | | `delete` | boolean | no | Flag allows DELETE object operation. Addressing an object by FilePath additionally requires SEARCH. | | `search` | boolean | no | Flag allows SEARCH object operation. Required to list objects and to address objects by FilePath in GET, HEAD and DELETE requests. | | `readContent` | boolean | no | **Deprecated.** Flag allows to read object payload. Requires readHeaders flag unless any of get, head, put or search is set. Deprecated, use get instead. Merged with get (logical OR) if both are set. | | `readHeaders` | boolean | no | **Deprecated.** Flag allows to read headers without object payload. Deprecated, use head and search instead. Merged with head and search (logical OR) if both are set. | | `create` | boolean | no | **Deprecated.** Flag allows to create new objects. Deprecated, use put instead. Merged with put (logical OR) if both are set. | ## NamedStoragePolicy {#namedstoragepolicy} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | ## V1GetUserStoragePoliciesResponse {#v1getuserstoragepoliciesresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policies` | array of [NamedStoragePolicy](schemas.md#namedstoragepolicy) | yes | Storage policy list. | ## V1GetSystemStoragePoliciesResponse {#v1getsystemstoragepoliciesresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policies` | array of [NamedStoragePolicy](schemas.md#namedstoragepolicy) | yes | Storage policy list. | ## V1CreateUserStoragePolicyRequest {#v1createuserstoragepolicyrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | ## V1CreateSystemStoragePolicyRequest {#v1createsystemstoragepolicyrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `name` | string | yes | Storage policy name. Max length must be less or equal 42. Constraints: maximum length 42. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | ## V1UpdateStoragePolicyRequest {#v1updatestoragepolicyrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | ## V1GetStoragePolicyResponse {#v1getstoragepolicyresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `policy` | [StoragePolicy](schemas.md#storagepolicy) | yes | Set of rules to select a subset of nodes from `NetworkMap` able to store bucket's objects. A policy must use either ecRules or replicas. | | `consistency` | [MetadataConsistency](schemas.md#metadataconsistency) | no | Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Constraints: one of `strict`, `optimistic`. | | `default` | boolean | no | The flag indicates if the policy is the default. | ## MetadataConsistency {#metadataconsistency} Experimental setting for consistent object metadata handling. By default object metadata is stored along with objects, using this setting one can gather all metadata for all bucket objects in a single place (currently all bucket storage nodes). Different variations control object put behavior, with "strict" policy metadata is flushed to event chain before returning status to client, while "optimistic" returns the result before waiting for metadata transaction completion. Type: string. Constraints: one of `strict`, `optimistic`. ## V1ClusterCreateOAuthProviderRequest {#v1clustercreateoauthproviderrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | | `clientID` | string | yes | OAuth provider application client id. | | `clientSecret` | string | yes | OAuth provider application client secret. | | `userInfoURL` | string | yes | OAuth provider URL, to get user details. | | `authorizeURL` | string | yes | OAuth provider URL, to authorize user. | | `tokenURL` | string | yes | OAuth provider URL, to exchange token. | | `scope` | array of string | yes | OAuth provider scope required to get user's email. | | `authorizeHeaderPrefix` | string | yes | OAuth provider Authorization header. It is used to get user's info from OAuth provider. Constraints: default `"OAuth"`. | | `emailPath` | array of string | yes | The path to extract email field from user info response. E.g. `["email"]` if the email is located in the `response`->`email`, `["user", "email"]` if it is located in the `response`->`user`->`email`. Example: `[["email"],["user","email"]]`. | | `domains` | array of string | yes | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | | `usePKCE` | boolean | yes | Tells to use PKCE feature with OAuth provider. The feature must be supported by provider. Constraints: default `false`. | | `callbackURL` | string | yes | The OAuth provider redirects users to this URL after authorization. It must exactly match the one configured in your OAuth provider’s dashboard. | ## V1ClusterGetOAuthProviderResponse {#v1clustergetoauthproviderresponse} Same as [V1ClusterCreateOAuthProviderRequest](schemas.md#v1clustercreateoauthproviderrequest). Type: object. | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | | `clientID` | string | yes | OAuth provider application client id. | | `clientSecret` | string | yes | OAuth provider application client secret. | | `userInfoURL` | string | yes | OAuth provider URL, to get user details. | | `authorizeURL` | string | yes | OAuth provider URL, to authorize user. | | `tokenURL` | string | yes | OAuth provider URL, to exchange token. | | `scope` | array of string | yes | OAuth provider scope required to get user's email. | | `authorizeHeaderPrefix` | string | yes | OAuth provider Authorization header. It is used to get user's info from OAuth provider. Constraints: default `"OAuth"`. | | `emailPath` | array of string | yes | The path to extract email field from user info response. E.g. `["email"]` if the email is located in the `response`->`email`, `["user", "email"]` if it is located in the `response`->`user`->`email`. Example: `[["email"],["user","email"]]`. | | `domains` | array of string | yes | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | | `usePKCE` | boolean | yes | Tells to use PKCE feature with OAuth provider. The feature must be supported by provider. Constraints: default `false`. | | `callbackURL` | string | yes | The OAuth provider redirects users to this URL after authorization. It must exactly match the one configured in your OAuth provider’s dashboard. | ## OAuthProviderType {#oauthprovidertype} Type: string. Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. ## V1ClusterGetOAuthProvidersResponse {#v1clustergetoauthprovidersresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `providers` | array of [OAuthProviderRecord](schemas.md#oauthproviderrecord) | yes | | ## OAuthProviderRecord {#oauthproviderrecord} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | | `label` | string | yes | | | `type` | [OAuthProviderType](schemas.md#oauthprovidertype) | yes | Constraints: one of `general`, `github`, `yandex`, `vk`, `google`. | ## V1ClusterCreateSAMLProviderRequest {#v1clustercreatesamlproviderrequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `entityID` | string | yes | Service Provider entity id. | | `idpMetadata` | string (base64) | yes | Identity provider (idp) metadata encoded in base64. | | `rootURL` | string | yes | It is a root URL for the service provider. Example: `https://morphbits.io/`. | | `domains` | array of string | no | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | ## V1ClusterSAMLProviderInfo {#v1clustersamlproviderinfo} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `entityID` | string | yes | Service Provider entity id. | | `idpMetadata` | string (base64) | yes | Identity provider (idp) metadata encoded in base64. | | `rootURL` | string | yes | It is a root URL for the service provider. Example: `https://morphbits.io/`. | | `metadataPath` | string | yes | Metadata path. It is used to get Service Provider metadata. Example: `` /api/v1/saml/abc123/metadata. Where `abc123` is a provider `id`. ``. | | `acsPath` | string | yes | Assertion Consumer Service URL receives the SAML response. Example: `` /api/v1/saml/abc123/acs. Where `abc123` is a provider `id`. ``. | | `sloPath` | string | no | Logout path. Example: `` /api/v1/saml/abc123/slo. Where `abc123` is a provider `id`. ``. | | `domains` | array of string | no | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | ## V1ClusterGetSAMLProviderResponse {#v1clustergetsamlproviderresponse} Same as [V1ClusterSAMLProviderInfo](schemas.md#v1clustersamlproviderinfo). Type: object. | Field | Type | Required | Description | |---|---|---|---| | `label` | string | yes | Label for login button. | | `entityID` | string | yes | Service Provider entity id. | | `idpMetadata` | string (base64) | yes | Identity provider (idp) metadata encoded in base64. | | `rootURL` | string | yes | It is a root URL for the service provider. Example: `https://morphbits.io/`. | | `metadataPath` | string | yes | Metadata path. It is used to get Service Provider metadata. Example: `` /api/v1/saml/abc123/metadata. Where `abc123` is a provider `id`. ``. | | `acsPath` | string | yes | Assertion Consumer Service URL receives the SAML response. Example: `` /api/v1/saml/abc123/acs. Where `abc123` is a provider `id`. ``. | | `sloPath` | string | no | Logout path. Example: `` /api/v1/saml/abc123/slo. Where `abc123` is a provider `id`. ``. | | `domains` | array of string | no | Whitelisted domains. Users from these domains allowed to login. Example: `["@morphbits.io","@example.com"]`. | ## V1ClusterListSAMLProvidersResponse {#v1clusterlistsamlprovidersresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `providers` | array of [SAMLProviderRecord](schemas.md#samlproviderrecord) | yes | | ## SAMLProviderRecord {#samlproviderrecord} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `id` | string | yes | | | `label` | string | yes | | ## LicenseResponse {#licenseresponse} License metadata. Type: object. | Field | Type | Required | Description | |---|---|---|---| | `nodeLimit` | integer (uint) | yes | Limit of node count. | | `capacity` | integer (uint64) | yes | Capacity in GB. | | `validFrom` | string (date-time) | yes | License valid-from date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | | `validUntil` | string (date-time) | yes | License valid-until date in RFC 3339 format. Example: `2022-11-21T07:12:42.68680647Z`. | ## IRKey {#irkey} Type: string. Example: ```json "02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2" ``` ## CreateNamespaceRequest {#createnamespacerequest} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Namespace name must be 1 to 31 characters long, start with a lowercase letter, contain only lowercase letters, digits, and hyphens, and not end with a hyphen. Constraints: minimum length 1; maximum length 31. Example: `my-namespace`. | | `description` | string | no | Optional human-readable namespace description. Intended to explain the namespace purpose. Maximum 256 UTF-8 bytes. Constraints: maximum length 256. Example: `accounting production data and service accounts`. | ## ListNamespacesResponse {#listnamespacesresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `namespaces` | array of string | yes | Namespace names. | ## GetNamespaceResponse {#getnamespaceresponse} Type: object. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | yes | Namespace name. Constraints: minimum length 1; maximum length 31. Example: `my-namespace`. | | `description` | string | no | Optional human-readable namespace description. Intended to explain the namespace purpose. Maximum 256 UTF-8 bytes. Constraints: maximum length 256. Example: `accounting production data and service accounts`. | --- # S3 compatibility This page describes the S3 API of the gateway that Morph bundles (NeoFS S3 gateway 0.48.1) with the configuration that Morph generates. The S3 endpoint listens on port 9080. | Status | Meaning | |---|---| | Supported | The operation works as the S3 API describes, apart from the notes in the row. | | Partial | The operation exists and deviates in the way the note states. | | Unsupported | The operation is absent. The note states what the gateway returns. | Two error responses mark absent operations: - `NotImplemented`: HTTP 501 with the error code `NotImplemented`. - `Not supported`: HTTP 501 with the error code `BadRequest` and the message `Not supported by NeoFS S3 Gateway`. Some operations have no route at all. The gateway then matches the request to the plain operation with the same method and path. The notes name the operation that runs. :::warning Do not send bucket requests with a subresource that the tables below mark as "No route". The gateway ignores the unknown query parameter: - `DELETE /my-bucket?` runs **DeleteBucket**, unless the subresource is `cors`, `website`, `tagging`, `ownershipControls`, `policy`, `lifecycle` or `encryption`. This applies to `?replication`, `?publicAccessBlock`, `?analytics`, `?inventory`, `?metrics` and `?intelligent-tiering`. A bucket without objects is deleted; a bucket with objects returns `BucketNotEmpty`. - `PUT /my-bucket?` for `?replication`, `?website`, `?accelerate`, `?requestPayment`, `?analytics`, `?inventory`, `?metrics` and `?intelligent-tiering` runs **CreateBucket**. With the XML body of these operations it returns `MalformedXML`. Without a body it creates the bucket when the name is free. - `GET /my-bucket?` for `?analytics`, `?inventory`, `?metrics` and `?intelligent-tiering` returns an object listing. ::: ## Service operations | Operation | Status | Notes | |---|---|---| | ListBuckets | Supported | Returns every bucket that the requesting user owns, in one response. `max-buckets`, `continuation-token`, `prefix` and `bucket-region` are ignored. `Owner.ID` and `DisplayName` are taken from the first bucket in the list: the owner's address. With no buckets they hold the zero ID. | | ListDirectoryBuckets, CreateSession | Unsupported | Directory buckets (S3 Express One Zone) do not exist, and the gateway has no routes for these calls. A ListDirectoryBuckets request is a GET of the service path and runs ListBuckets; a CreateSession request is a GET of the bucket and runs ListObjects. Both answer `200` with that operation's result. | | WriteGetObjectResponse | Unsupported | No route. HTTP 400 `UnknownAPIRequest`. | ## Bucket operations ### Basics | Operation | Status | Notes | |---|---|---| | CreateBucket | Supported | The request must be signed. `LocationConstraint` names a storage policy, see [Regions and storage policies](#regions-and-storage-policies). `x-amz-acl` and `x-amz-grant-*` set the initial access rules. `x-amz-bucket-object-lock-enabled: true` enables Object Lock and turns versioning on. `x-amz-object-ownership` is ignored. Bucket names: see [Limits](#limits). | | DeleteBucket | Supported | Fails with `BucketNotEmpty` while the bucket holds objects, versions or delete markers. Parts of unfinished multipart uploads do not block deletion. | | HeadBucket | Supported | Returns `x-amz-bucket-region` with the location constraint of the bucket and `X-Container-Id` with the bucket ID. | | GetBucketLocation | Supported | Returns the `LocationConstraint` that CreateBucket received, or `default` when CreateBucket received none. The value is empty for a bucket that was not created through the S3 API. | | ListObjects | Supported | `Owner` is always returned. `max-keys` defaults to 1000. | | ListObjectsV2 | Supported | `fetch-owner`, `start-after`, `continuation-token`, `delimiter`, `prefix`, `encoding-type=url`. The MinIO extension `metadata=true` returns `NotImplemented`. | | ListObjectVersions | Supported | A response can hold fewer entries than `max-keys` and still be truncated. Follow `IsTruncated` and the markers. | | DeleteObjects | Supported | At most 1000 keys per request (`s3.max_object_to_delete_per_request`), otherwise HTTP 400 `BadRequest`. `Content-Length` is required. `Content-MD5` is not required and not checked. | ### Access control list (ACL) | Operation | Status | Notes | |---|---|---| | GetBucketAcl | Partial | The ACL is derived from the access rules of the bucket. | | PutBucketAcl | Partial | While the bucket ownership setting is `BucketOwnerEnforced`, which is the default, a request with an `x-amz-acl` header other than `private` or `bucket-owner-full-control` is rejected with `AccessControlListNotSupported`. Canned ACLs: `private`, `public-read`, `public-read-write`, `authenticated-read`, `bucket-owner-full-control`. Grantees: a canonical user (user address) and the All Users group. The Authenticated Users group cannot be separated from All Users. Grantees by email address are rejected. | ### Policy | Operation | Status | Notes | |---|---|---| | GetBucketPolicy | Partial | Returns a policy document rebuilt from the access rules of the bucket. It is not the text that was uploaded. | | PutBucketPolicy | Partial | Statements are translated into access rules. One principal per statement: `"*"`, `{"AWS": "*"}` or `{"CanonicalUser": ""}`. Resources name the bucket or one object of it; wildcards in resources are not supported. Actions understood: `s3:GetObject`, `s3:PutObject`, `s3:DeleteObject`, `s3:ListBucket`, `s3:GetObjectTagging`, `s3:PutObjectTagging`. Other actions and `Condition` blocks are ignored, with one exception: a statement that allows `s3:PutObject` to `*` on `/*` with the condition `StringEquals` `s3:x-amz-acl` = `bucket-owner-full-control` is not accepted. The request fails with `InternalError` (`500`) and the bucket stays unchanged. | | DeleteBucketPolicy | Unsupported | `Not supported`. | | GetBucketPolicyStatus | Unsupported | `Not supported`. | ### Public access block | Operation | Status | Notes | |---|---|---| | GetPublicAccessBlock | Unsupported | `Not supported`. | | PutPublicAccessBlock | Unsupported | `Not supported`. | | DeletePublicAccessBlock | Unsupported | No route. The request runs DeleteBucket. | ### Ownership controls | Operation | Status | Notes | |---|---|---| | GetBucketOwnershipControls | Supported | | | PutBucketOwnershipControls | Supported | `BucketOwnerEnforced` (default), `BucketOwnerPreferred`, `ObjectWriter`. The owner of every object is the bucket owner in all three modes. | | DeleteBucketOwnershipControls | Supported | Resets the setting to `BucketOwnerEnforced`. | ### CORS | Operation | Status | Notes | |---|---|---| | GetBucketCors | Supported | | | PutBucketCors | Supported | Allowed methods: `GET`, `HEAD`, `POST`, `PUT`, `DELETE`. A wildcard in `ExposeHeader` is rejected. Without `MaxAgeSeconds` the gateway answers preflight requests with `Access-Control-Max-Age: 600` (`cors.default_max_age`). | | DeleteBucketCors | Supported | | | Preflight (`OPTIONS`) | Supported | Needs the `Origin` and `Access-Control-Request-Method` headers. | ### Lifecycle | Operation | Status | Notes | |---|---|---| | GetBucketLifecycleConfiguration, GetBucketLifecycle | Unsupported | Always HTTP 404 `NoSuchLifecycleConfiguration`. | | PutBucketLifecycleConfiguration, PutBucketLifecycle | Unsupported | `NotImplemented`. | | DeleteBucketLifecycle | Unsupported | `Not supported`. | To expire objects, see [Expire objects](../how-to/buckets-and-objects/expire-objects.md). ### Versioning | Operation | Status | Notes | |---|---|---| | GetBucketVersioning | Supported | | | PutBucketVersioning | Supported | `Enabled` and `Suspended`. Versioning cannot be suspended on a bucket with Object Lock. `MfaDelete` is ignored. | ### Tagging | Operation | Status | Notes | |---|---|---| | GetBucketTagging | Supported | | | PutBucketTagging | Supported | At most 10 tags, otherwise HTTP 400 `BadRequest`. | | DeleteBucketTagging | Supported | | ### Notifications | Operation | Status | Notes | |---|---|---| | GetBucketNotificationConfiguration | Partial | Returns the stored configuration. | | PutBucketNotificationConfiguration | Partial | Stores queue configurations. Topic and Lambda configurations are rejected with `InvalidArgument`. Events are delivered only through a NATS server, and Morph generates the gateway configuration with `nats.enabled: false`, so no events are sent. | | ListenBucketNotification (MinIO extension) | Unsupported | `NotImplemented`. | ### Encryption | Operation | Status | Notes | |---|---|---| | GetBucketEncryption | Unsupported | `NotImplemented`. | | PutBucketEncryption | Unsupported | `NotImplemented`. | | DeleteBucketEncryption | Unsupported | `Not supported`. | ### Object Lock configuration | Operation | Status | Notes | |---|---|---| | GetObjectLockConfiguration | Supported | HTTP 404 `ObjectLockConfigurationNotFoundError` on a bucket created without Object Lock. | | PutObjectLockConfiguration | Supported | Only on a bucket created with `x-amz-bucket-object-lock-enabled: true`. The default retention takes `Days` or `Years`, not both. | ### Replication, logging, website and other bucket configuration | Operation | Status | Notes | |---|---|---| | GetBucketReplication | Unsupported | `NotImplemented`. Morph has no cross-cluster replication. | | PutBucketReplication | Unsupported | No route. The request is treated as CreateBucket. | | DeleteBucketReplication | Unsupported | No route. The request runs DeleteBucket. | | GetBucketLogging | Unsupported | `NotImplemented`. | | PutBucketLogging | Unsupported | `NotImplemented`. | | GetBucketWebsite | Unsupported | `NotImplemented`. | | PutBucketWebsite | Unsupported | No route. The request is treated as CreateBucket. | | DeleteBucketWebsite | Unsupported | `NotImplemented`. | | GetBucketAccelerateConfiguration | Unsupported | `NotImplemented`. | | PutBucketAccelerateConfiguration | Unsupported | No route. The request is treated as CreateBucket. | | GetBucketRequestPayment | Unsupported | `NotImplemented`. | | PutBucketRequestPayment | Unsupported | No route. The request is treated as CreateBucket. | | Analytics, inventory, metrics and Intelligent-Tiering configurations (`Get`, `List`, `Put`, `Delete`) | Unsupported | No route. `GET` returns an object listing (ListObjects), `PUT` is treated as CreateBucket, `DELETE` runs DeleteBucket. | | Any other bucket subresource, for example the S3 Metadata table configurations | Unsupported | No route. `GET`, `PUT` and `DELETE` behave as in the row above. `POST` returns HTTP 400 `UnknownAPIRequest`. | A request that is treated as CreateBucket returns `MalformedXML` when its body is XML with a root element other than `CreateBucketConfiguration`. Without a body it returns `BucketAlreadyOwnedByYou` or `BucketAlreadyExists` for an existing bucket, and creates the bucket when the name is free. ## Object operations ### Basics | Operation | Status | Notes | |---|---|---| | PutObject | Supported | `Content-MD5` is verified and not stored. `If-Match` and `If-None-Match` are evaluated. `x-amz-tagging`, `x-amz-meta-*`, `Content-Type`, `Cache-Control`, `Expires` and the Object Lock retention headers are stored. `Content-Disposition`, `Content-Encoding`, `Content-Language`, `x-amz-storage-class`, `x-amz-website-redirect-location` and `x-amz-server-side-encryption` are ignored. A metadata header with an empty value is rejected with `InvalidArgument`. Without `Content-Type` the gateway derives one from the key extension or the first bytes. The ETag is not an MD5, see [ETag](#etag). | | GetObject | Supported | `Range` with one range (`bytes=a-b`, `bytes=a-`, `bytes=-n`). `versionId`, `partNumber`, conditional headers, and `response-*` query parameters on signed requests. `x-amz-checksum-mode` is ignored. | | HeadObject | Supported | `versionId` and conditional headers as for GetObject. `partNumber`, `Range` and the `response-*` query parameters are ignored. | | DeleteObject | Supported | In a versioned bucket a delete without `versionId` adds a delete marker. Deleting a locked object returns `AccessDenied`. | | CopyObject | Supported | The gateway reads the source and writes the destination; the data passes through the gateway. `x-amz-metadata-directive`, `x-amz-tagging-directive`, `x-amz-copy-source-if-*`, source `versionId`. Copying an object onto itself in an unversioned bucket requires `x-amz-metadata-directive: REPLACE`. | | PostObject (browser form upload) | Supported | Signature Version 4 form fields and a POST policy with `eq`, `starts-with` and `content-length-range` conditions. `success_action_status` and `success_action_redirect` are honored. | | GetObjectAttributes | Partial | `ETag`, `ObjectSize`, `StorageClass` (always `STANDARD`), `ObjectParts` and `Checksum`. `Checksum` holds only `ChecksumSHA256`, as a hexadecimal string. | | RestoreObject | Unsupported | No route. HTTP 400 `UnknownAPIRequest`. There are no storage classes or tiers. | | SelectObjectContent | Unsupported | `NotImplemented`. | | GetObjectTorrent | Unsupported | `Not supported`. | ### Multipart upload | Operation | Status | Notes | |---|---|---| | CreateMultipartUpload | Supported | Stores `x-amz-meta-*`, `Content-Type` and `x-amz-tagging` for the final object. The gateway rejects a request that signs `Content-Length: 0` (see the authentication note below), so this call fails with HTTP 403 `SignatureDoesNotMatch` from the AWS SDK for Java 2.x and from the Hadoop S3A connector, which sign it. Other clients (AWS CLI, boto3, the AWS SDK for Go and for JavaScript) work. | | UploadPart | Supported | Part numbers 1 to 10000. A part holds at most 4 GiB minus 1 byte, otherwise `EntityTooLarge`. `Content-MD5` is not checked. Uploading a part number again replaces the earlier part. | | UploadPartCopy | Supported | Same limits as UploadPart. `x-amz-copy-source-range` and `x-amz-copy-source-if-*`. | | CompleteMultipartUpload | Supported | Parts must be listed in ascending order with the ETags that UploadPart returned. Every part except the last must hold at least 5 MiB, otherwise `EntityTooSmall`. Repeating the request for a finished upload returns the same result. Conditional headers are not evaluated. See [Multipart uploads](../explanation/s3-on-morph.md#multipart-uploads) for the cost of parts uploaded out of order. | | AbortMultipartUpload | Supported | | | ListMultipartUploads | Supported | At most 1000 uploads per response. | | ListParts | Supported | At most 1000 parts per response. | Unfinished uploads are not removed automatically, because lifecycle rules do not exist. Abort them with AbortMultipartUpload. ### Object ACL | Operation | Status | Notes | |---|---|---| | GetObjectAcl | Partial | Always returns one grant: `FULL_CONTROL` for the bucket owner. | | PutObjectAcl | Partial | Accepts the canned ACL `private` and does nothing. Any other value returns `AccessControlListNotSupported`. | ACL headers on PutObject, PostObject, CopyObject and CreateMultipartUpload have no effect on access. While the bucket ownership setting is `BucketOwnerEnforced`, which is the default, an `x-amz-acl` header other than `private` or `bucket-owner-full-control` on these requests is rejected with `AccessControlListNotSupported`. Access is controlled per bucket, see [Control access to a bucket](../how-to/buckets-and-objects/control-access.md). ### Object tagging | Operation | Status | Notes | |---|---|---| | GetObjectTagging | Supported | Returns HTTP 500 `InternalError`, not 404, for a key that does not exist or whose current version is a delete marker. | | PutObjectTagging | Supported | At most 10 tags per object. Returns HTTP 500 `InternalError`, not 404, for a missing key. In this release, tagging the same key several times can leave the object unreadable: a later GetObject or HeadObject returns the tag data in place of the object (`ContentLength` of the tag JSON, `Metadata` `S3-MetaType: tags`). Set the tags once per object. | | DeleteObjectTagging | Supported | | ### Retention and legal hold | Operation | Status | Notes | |---|---|---| | GetObjectRetention | Supported | Only on a bucket with Object Lock. HTTP 404 `NoSuchKey` when the object has no retention. | | PutObjectRetention | Partial | `GOVERNANCE` and `COMPLIANCE`. A retention period can be extended. The gateway rejects a shorter period or another mode for `COMPLIANCE`, and for `GOVERNANCE` unless `x-amz-bypass-governance-retention: true` is sent. A lock cannot be removed, and a locked object cannot be deleted before the lock expires. | | GetObjectLegalHold | Partial | Only on a bucket with Object Lock. Reports `OFF`, because a legal hold cannot be set. | | PutObjectLegalHold | Unsupported | `Not supported`. The header `x-amz-object-lock-legal-hold: ON` on an upload is rejected in the same way. | See [Lock objects against deletion](../how-to/buckets-and-objects/lock-objects.md). ## Authentication | Method | Status | Notes | |---|---|---| | Signature Version 4, `Authorization` header | Supported | Algorithm `AWS4-HMAC-SHA256`. The gateway re-signs the request to verify it and leaves a few headers out of its canonical form, so a signature that covers `User-Agent`, `Expect`, `X-Amzn-Trace-Id`, or `Content-Length` with value `0` is rejected with HTTP 403 `SignatureDoesNotMatch`. The AWS SDK for Java 1.x signs `User-Agent`, so it and the Hadoop 3.3 S3A connector that builds on it cannot authenticate; use a client that does not sign these headers. | | Signature Version 4, presigned URL (query parameters) | Supported | `X-Amz-Expires` up to 604800 seconds (7 days), otherwise `AuthorizationQueryParametersError`. An expired URL returns `AccessDenied`. | | Signature Version 4, POST form | Supported | For PostObject. | | Signature Version 2 | Unsupported | An `Authorization: AWS ...` header returns HTTP 400 `AuthorizationQueryParametersError`. A Version 2 presigned URL is handled as an anonymous request. | | Signature Version 4A (`AWS4-ECDSA-P256-SHA256`) | Unsupported | | | Anonymous requests | Supported | A request without a signature runs as an anonymous user and succeeds where the access rules of the bucket allow it. CreateBucket always needs a signature. | | Temporary credentials (`X-Amz-Security-Token`), STS, IAM | Unsupported | The gateway has no STS or IAM API. Credentials are issued by the console, see [Manage S3 credentials](../how-to/secure/manage-s3-credentials.md). | Payload signing, as given in `x-amz-content-sha256`: | Value | Status | Notes | |---|---|---| | Hexadecimal SHA-256 of the body | Supported | The value is part of the signature. The gateway does not compare it with the body it receives. | | `UNSIGNED-PAYLOAD` | Supported | | | `STREAMING-AWS4-HMAC-SHA256-PAYLOAD` | Supported | `aws-chunked` upload with signed chunks. Chunk signatures are verified. | | `STREAMING-UNSIGNED-PAYLOAD-TRAILER` | Supported | `aws-chunked` upload with a trailing checksum named in `x-amz-trailer`. The checksum is verified. | | `STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER` | Unsupported | Signed chunks with a trailing checksum. The body is not decoded and the upload fails with `IncompleteBody`. A client that sends this form must be set to calculate checksums only when required, see [Use the AWS SDKs](../how-to/integrate/aws-sdks.md). | For chunked uploads the gateway takes the object size from `x-amz-decoded-content-length`, otherwise from `Content-Length`. A body that is shorter or longer than the declared size is rejected with `IncompleteBody`. The region in the credential scope is not checked. Any region name signs correctly. The gateway setting `allowed_access_key_id_prefixes` is empty in Morph's configuration, so every access key ID is accepted. When the gateway is bound to a namespace, it rejects credentials of other namespaces with `AccessDenied`. ## Addressing | Style | Status | Notes | |---|---|---| | Path-style (`http://host:9080/my-bucket/my-object`) | Supported | Use this style. | | Virtual-hosted-style (`http://my-bucket.host/my-object`) | Unsupported | Morph generates `listen_domains: []`, which turns it off. With a domain configured, the gateway still reads the first path segment of a request as the bucket name, so only bucket-level requests with the path `/` reach the bucket named in the host. | Object keys are taken from the decoded request path. `/my-bucket/a%2Fb` and `/my-bucket/a/b` address the same key `a/b`. ## Regions and storage policies The gateway has no regions. Clients can sign with any region name; the examples in this documentation use `us-east-1`. `LocationConstraint` in CreateBucket selects the storage policy of the new bucket. The gateway resolves the value in this order: 1. A name defined in the gateway configuration (`placement_policy.region_mapping` or `placement_policy.locations`). Morph defines none. 2. A policy stored with the S3 credential. 3. The storage policy contract on the FS chain (`placement_policy.contract_name: storagepolicy`): first a policy of the requesting user with that name, then a system policy with that name, for example `REP-3`. A name that resolves nowhere returns HTTP 404 `NoSuchBucketPolicy`. A policy that the current network map cannot satisfy returns HTTP 409 `InvalidLocationConstraint`. Without `LocationConstraint` the bucket gets the default system policy from the contract. If the contract has no default, the gateway falls back to `placement_policy.default` from its configuration file. GetBucketLocation then returns `default`. The storage policy language is described in [Storage policy language](storage-policy-language.md). ## Limits | Item | Limit | Source of the limit | |---|---|---| | Bucket name | 3 to 63 characters; lowercase letters, digits, hyphens and dots; each dot-separated label starts and ends with a letter or digit; no `xn--` prefix, no `-s3alias` suffix, not an IP address | Gateway | | Object size, single PutObject | No limit in the gateway. The storage node splits the payload into pieces of at most 64 MiB. | Network setting `MaxObjectSize` | | Part number | 1 to 10000 | Gateway | | Part size | At most 4 GiB minus 1 byte (4,294,967,295 bytes). At least 5 MiB for every part except the last. | Gateway | | Object key length | No separate limit. The key is stored in the object header. | Object header | | Object header | 16 KiB for the key, `Content-Type`, user metadata, tags sent with the upload and system attributes together | Storage node | | User metadata | No separate limit. Each value must be non-empty. | Gateway | | Tags | 10 per object or bucket; key 1 to 128 bytes, not starting with `aws:`; value up to 256 bytes; letters, digits, spaces and `+ - = . _ : / @` | Gateway | | Keys per DeleteObjects request | 1000 | `s3.max_object_to_delete_per_request` | | Keys per listing page | `max-keys` defaults to 1000 for ListObjects, ListObjectsV2 and ListObjectVersions | Gateway | | Uploads per ListMultipartUploads page | 1000 | Gateway | | Parts per ListParts page | 1000 | Gateway | | Presigned URL lifetime | 7 days | Gateway | | Requests in progress per gateway | 100 (`max_clients_count`). A request that waits longer than 30 s (`max_clients_deadline`) gets HTTP 503 `RequestTimeout`. | Gateway configuration | Cluster-wide limits are listed in [Limits](limits.md). ## Consistency The gateway keeps no state of its own. It finds objects by searching the storage nodes of the bucket for the key, and it keeps short-lived caches. The lifetimes below are the ones in the configuration that Morph generates. | Cache | Lifetime | Entries | Effect on a client | |---|---|---|---| | Bucket information (`cache.buckets`) | 1 min | 500 | A gateway can serve the previous versioning, CORS, tagging, lock and ownership settings, and can still resolve a deleted bucket name, for up to 1 minute after another gateway changed them. | | Bucket access rules (not configurable) | 1 min | 1000 | GetBucketAcl and GetBucketPolicy can return the rules from before a change made through another gateway, for up to 1 minute. PutBucketAcl and PutBucketPolicy merge into that cached copy. Access to objects is decided by the storage nodes, not from this cache. | | Key to object (`cache.names`) | 1 min | 1000 | Holds the current object, its tags and its lock state for GetObject and HeadObject without `versionId`. See the versioned-bucket case below. The tag count and the lock headers of these two operations can lag by up to 1 minute after a change through another gateway. | | Object headers (`cache.objects`) | 300 s | 150 | Entries are keyed by object ID. Stored objects do not change, so entries do not go stale. | | Tags and lock state (`cache.system`) | 2 min | 1000 | Tags and retention set through another gateway can appear up to 2 minutes later in GetObjectTagging, GetObjectRetention and GetObjectLegalHold. | | Credentials (`cache.accessbox`) | 5 min | 10 | A deleted S3 credential keeps working on a gateway that has it cached for up to 5 minutes. | | Access check results (`cache.accesscontrol`) | 1 min | 100000 | Records which user may read which cache entry. | | Listings (`cache.list`) | 1 min | 100 | Not filled by this gateway version. Every listing searches the storage nodes. | What a client can rely on: - **Read after write, same gateway.** A write or delete drops the cached entry for the key on the gateway that handled it. The next GetObject or HeadObject on that gateway searches the storage nodes again. - **Read after overwrite, other gateway, unversioned bucket.** The overwrite deletes the previous object. A gateway that still has the old entry cached notices that the object is gone, drops the entry and looks the key up again. - **Read after overwrite or delete, other gateway, versioned bucket.** The previous version still exists. A gateway that has the key cached returns the previous version for requests without `versionId` for up to 1 minute. Requests with `versionId` are not affected. - **Listing.** Listings are computed for each request from a search on the storage nodes. - **Overwrite in an unversioned bucket.** The gateway writes the new object first and then deletes the earlier objects with the same key. - **Order of versions.** Versions of a key are ordered by creation time with a resolution of one second. `Last-Modified` and the creation time come from the `x-amz-date` of a header-signed request, and from the gateway clock for presigned and anonymous requests. Versions written within the same second are ordered by object ID, which does not reflect the order of the writes. - **Bucket configuration.** Versioning, CORS, tags, notification and lock settings and access rules are stored on the FS chain. Changing them needs a working inner ring quorum, see [Inner ring and FS chain](../explanation/inner-ring-and-fs-chain.md). Durability and the moment a write is acknowledged depend on the storage policy, see [Replication and consistency](../explanation/replication-and-consistency.md). ## Conditional requests | Operation | Headers | Behavior | |---|---|---| | GetObject, HeadObject, GetObjectAttributes | `If-Match` | HTTP 412 `PreconditionFailed` when the value differs from the ETag. | | | `If-None-Match` | HTTP 304 `NotModified` when the value equals the ETag. | | | `If-Modified-Since` | HTTP 304 when the object is older than the date. | | | `If-Unmodified-Since` | HTTP 412 when the object is newer than the date and `If-Match` is absent. | | PutObject | `If-Match`, `If-None-Match` | HTTP 412 when the condition fails. `*` is accepted. `If-None-Match: *` writes only when the key does not exist. The gateway evaluates the condition before it writes the object. | | CopyObject, UploadPartCopy | `x-amz-copy-source-if-match`, `-if-none-match`, `-if-modified-since`, `-if-unmodified-since` | HTTP 412 for every failed condition. | | CompleteMultipartUpload, PostObject, DeleteObject | | Conditional headers are not evaluated. | On GetObject, HeadObject, GetObjectAttributes and the copy operations the gateway compares the header value with the ETag character by character. Send the ETag exactly as the gateway returned it, without added quotes and without a list. PutObject accepts quoted values and comma-separated lists. ## Checksums | Mechanism | Status | Notes | |---|---|---| | `Content-MD5` on PutObject | Supported | A wrong digest returns `BadDigest`, a malformed header `InvalidDigest`. | | `Content-MD5` on other operations | Ignored | | | Trailing checksum (`x-amz-trailer`) with `STREAMING-UNSIGNED-PAYLOAD-TRAILER` | Supported | `x-amz-checksum-crc32`, `x-amz-checksum-crc32c`, `x-amz-checksum-crc64nvme`, `x-amz-checksum-sha1`, `x-amz-checksum-sha256`. The upload fails when the checksum does not match. The checksum is not stored. | | `x-amz-checksum-*` request headers, `x-amz-sdk-checksum-algorithm` | Ignored | Not verified and not stored. | | `x-amz-checksum-mode` and `x-amz-checksum-*` response headers | Unsupported | Responses carry no checksum headers. | | `ChecksumAlgorithm` in CreateMultipartUpload, part checksums in CompleteMultipartUpload | Ignored | | The storage nodes keep a SHA-256 checksum of every stored object. The gateway returns it as the ETag. ## Server-side encryption | Mode | Status | Notes | |---|---|---| | SSE-C (customer-provided key) | Partial | `AES256` with a 256-bit key and its MD5. The gateway accepts SSE-C headers only on a TLS connection that it terminates itself. Morph generates the gateway configuration with TLS off, so requests with SSE-C headers fail with HTTP 500 `InternalError` until TLS is enabled on the gateway listener. A TLS-terminating proxy in front of the gateway does not satisfy the check. | | SSE-S3 (`x-amz-server-side-encryption: AES256`) | Unsupported | The header is ignored. The object is stored without gateway encryption and no error is returned. | | SSE-KMS, DSSE-KMS | Unsupported | The headers are ignored in the same way. There is no KMS integration. | | Bucket default encryption | Unsupported | See [Encryption](#encryption). | See [Encrypt data](../how-to/secure/encrypt-data.md). ## ETag - The ETag of an object written with PutObject, PostObject or CopyObject is the SHA-256 checksum of the stored payload as 64 hexadecimal characters. It is not an MD5 digest. - UploadPart returns the SHA-256 checksum of the part. - The ETag of an object completed from a multipart upload is the SHA-256 checksum of the whole payload. It has no `-` suffix. - ETag values are returned without surrounding double quotes, in headers and in XML. - For an object stored with SSE-C the checksum covers the encrypted payload. Clients that compare the ETag with an MD5 of the data they sent report a mismatch. Turn that comparison off in the client, see [Use other S3 tools](../how-to/integrate/s3-tools.md). ## Error codes Errors use the S3 XML error format with `Code`, `Message`, `Resource`, `RequestId` and `HostId`. Responses to service, bucket and object requests carry `x-amz-request-id`. | HTTP status | Codes | |---|---| | 304 | `NotModified` | | 400 | `AccessControlListNotSupported`, `AuthorizationQueryParametersError`, `BadDigest`, `BadRequest`, `EmptyRequestBody`, `EntityTooLarge`, `EntityTooSmall`, `IllegalVersioningConfigurationException`, `IncompleteBody`, `InvalidArgument`, `InvalidBucketName`, `InvalidDigest`, `InvalidPart`, `InvalidPartOrder`, `InvalidPolicyDocument`, `InvalidRange` (copy source range), `InvalidRequest`, `InvalidTag`, `MalformedPOSTRequest`, `MalformedXML`, `UnknownAPIRequest` | | 403 | `AccessDenied`, `InvalidAccessKeyId`, `PostPolicyInvalidKeyName`, `SignatureDoesNotMatch` | | 404 | `NoSuchBucket`, `NoSuchBucketPolicy`, `NoSuchCORSConfiguration`, `NoSuchKey`, `NoSuchLifecycleConfiguration`, `NoSuchTagSet`, `NoSuchUpload`, `NoSuchVersion`, `ObjectLockConfigurationNotFoundError` | | 409 | `BucketAlreadyExists`, `BucketAlreadyOwnedByYou`, `BucketNotEmpty`, `InvalidBucketState`, `InvalidLocationConstraint`, `OperationAborted` | | 411 | `MissingContentLength` | | 412 | `PreconditionFailed` | | 416 | `InvalidRange` | | 500 | `InternalError` | | 501 | `NotImplemented`, `BadRequest` (operation not supported) | | 503 | `RequestTimeout` | Deviations from the S3 error model: - A request that matches no operation returns HTTP 400 `UnknownAPIRequest`. - An operation that the gateway refuses as unsupported returns HTTP 501 with the code `BadRequest`. - A failure of the storage layer that has no S3 equivalent returns HTTP 500 `InternalError`. This includes a storage policy that the network map cannot satisfy on an existing bucket. - `OperationAborted` (HTTP 409) is returned when the bucket changed on the FS chain while the request was in progress. Repeat the request. - A waiting request that does not get a free slot within `max_clients_deadline` returns HTTP 503 `RequestTimeout`. All status codes of the product are listed in [Errors and status codes](errors.md). --- # Installer configuration The installer configuration file describes where the storage node of a Morph node keeps its data. It is a YAML file. | Property | Value | |---|---| | Path inside the container | `/morph/config/installer.config.yaml`, from `MORPH_PATH_INSTALLER_CONFIG` | | Read by | The `installer` binary, started by the entrypoint as `installer --config ` | | Read when | Once, at the first start of the node. After the installation the file is not read again. | | Used by | Cluster-type and storage-type nodes. A gateway-type node has no storage node. It still decodes the file at the first start and does not use the content. | | Result | The `metadata` and `storage.shards` sections of the generated storage node configuration, `/morph/local_state/config/config-sn.yaml` | | Unknown keys | Rejected. The installer stops with a decoding error. | | Missing or empty file | Rejected in the same way. The file must exist and contain a YAML document; `sn: {}` is the smallest one. | Everything else in the generated configuration files comes from the installation request (see the [installer API](../installer-api.md)) and from values fixed in the installer. ## Keys | Key | Type | Default | Meaning | |---|---|---|---| | `sn.metadata` | string (directory) | none in the code. The file shipped in the image sets `/data/meta`. | Directory for the storage node's metadata chain database. Written to `metadata.path` of the storage node. When the key is absent, the storage node starts with this function turned off. | | `sn.shards` | list | one shard with the defaults below | The shards of the storage node, one entry per drive. | | `sn.shards[].data` | string (directory) | `/data/`, for example `/data/0` | Directory of the shard's object store. | | `sn.shards[].metadata` | string (file) | `/data/meta//metabase.db` | File of the shard's metabase, the index of the shard. | | `sn.shards[].writecache.path` | string (directory) | none | Directory of the shard's write-cache. | | `sn.shards[].writecache.size` | string (size, for example `1GB`) | none | Maximum disk space of the write-cache. Written to `writecache.capacity` of the shard. | | `sn.shards[].combined_writing.enabled` | boolean | detected from the drive | `true` keeps combined writing, which puts several small objects into one file. `false` turns it off. | `` is the position of the shard in the list, starting at 0. ## Rules | Rule | Detail | |---|---| | Write-cache | A shard has a write-cache only when both `writecache.path` and `writecache.size` are set. The file shipped in the image sets `/data/writecache/0` and `1GB`. | | Distinct paths | `data` and `writecache.path` of one shard must differ. The check compares the values as written, so a shard entry that sets neither is rejected. | | Unique write-cache | Two shards must not have the same `writecache.path`. | | No shards | When `sn.shards` is absent or empty, the installer creates one shard: data in `/data/0`, metabase in `/data/meta/0/metabase.db`, no write-cache. | | Combined writing, automatic | When `combined_writing.enabled` is absent, the installer looks up the block device that holds the `data` path, or its nearest existing parent directory, in `/sys`. Rotational device: combined writing stays on. Non-rotational device: combined writing is turned off. | | Combined writing, detection failure | The installer logs `could not detect whether shard storage is rotational, keeping NeoFS combined writing at its default` and leaves combined writing on. | ## Values the installer fixes for every shard These values are written into the generated storage node configuration and cannot be set in the installer configuration file. Their meaning is in [storage node settings](storage-node.md). | Generated setting | Value | |---|---| | `blobstor.type` | `fstree` | | `blobstor.depth` | `3` | | `blobstor.combined_count_limit` | `1` when combined writing is off, otherwise not written | | `metabase.perm` | `0770` | | `gc.remover_batch_size` | `200` | | `gc.remover_sleep_interval` | `10s` | ## The file shipped in the image The file in the image has these keys and values. Its comments are left out here. ```yaml sn: metadata: /data/meta shards: - data: /data/0 metadata: /data/meta/0/metabase.db writecache: path: /data/writecache/0 size: 1GB ``` ## Example with two data drives ```yaml sn: metadata: /data/meta shards: - data: /data/hdd0 metadata: /data/meta/0/metabase.db writecache: path: /data/writecache/0 size: 1GB - data: /data/hdd1 metadata: /data/meta/1/metabase.db writecache: path: /data/writecache/1 size: 1GB ``` For the steps that go with this file, see [Configure drives and shards](../../how-to/deploy/configure-drives.md). --- # Environment variables The Morph image sets the variables below with `ENV`, except those whose default is "not set" and `RESTART_IF_ERROR_LIMIT_REACHED` whose default is in the entrypoint. The entrypoint `morphentry` reads them at every start, and the installer reads them at the first start. Override a variable with `docker run -e NAME=value`. Rules that apply to all of them: - A variable keeps its meaning for the life of the node. Paths and wallet passwords are written into the generated configuration at the first start. Give the container the same values at every later start. - A value must not contain the character `=`. The installer cannot read such a variable, and the installation stops when it is one the installer needs. - The entrypoint starts the bundled processes with the container's environment, so every variable of the container is visible to them. Passing component-internal overrides (`NEOFS_*`, `NEOFS_IR_*`, `S3_GW_*`) is not supported. ## Paths | Variable | Default | Meaning | |---|---|---| | `MORPH_BIN_PATH` | `/morph/bin` | Directory of the bundled binaries: `morphentry`, `installer`, `morph`, `neofs-ir`, `neofs-node`, `neofs-s3-gw`. | | `MORPH_CONFIG_PATH` | `/morph/config` | Directory of the installer configuration file shipped in the image. Read and logged. Setting it on the container moves nothing: the file is found through `MORPH_PATH_INSTALLER_CONFIG`, whose default was fixed when the image was built. | | `MORPH_LOCAL_STATE_DIR` | `/morph/local_state` | Directory for what Morph generates. The generated configuration places the FS chain database (`fschain.bolt`) and the state files of the inner ring (`neofs-ir-state`) and of the storage node (`neofs-storage-state`) directly in it; the processes create these files at their first start, and the entrypoint creates its `config` subdirectory at the first start. The configuration files and wallets go to the paths in the `MORPH_PATH_*` variables, which by default are in that subdirectory and do not follow a change of this variable. Mount it from the host. | | `MORPH_PATH_INSTALLER_CONFIG` | `/morph/config/installer.config.yaml` | The [installer configuration file](installer.md), passed to the installer as `--config`. | | `MORPH_PATH_INSTALLATION_COMPLETED` | `/morph/local_state/config/installation.txt` | Marker file. The installer writes the installation type (`cluster`, `storage` or `gateway`) into it when it finishes. While the file exists, the entrypoint skips the installer and starts the processes of that type. | | `MORPH_PATH_CONFIG_YAML` | `/morph/local_state/config/config.yaml` | Generated console configuration. | | `MORPH_PATH_IR_CONFIG` | `/morph/local_state/config/config-ir.yaml` | Generated inner ring configuration. Cluster-type nodes only. | | `MORPH_PATH_IR_CLI_CONFIG` | `/morph/local_state/config/cli-config-ir.yaml` | Generated command-line configuration (wallet and password) for the inner ring wallet. | | `MORPH_PATH_SN_CONFIG` | `/morph/local_state/config/config-sn.yaml` | Generated storage node configuration. Cluster-type and storage-type nodes. | | `MORPH_PATH_SN_CLI_CONFIG` | `/morph/local_state/config/cli-config-sn.yaml` | Generated command-line configuration (wallet and password) for the storage node wallet. | | `MORPH_PATH_S3_CONFIG` | `/morph/local_state/config/config-s3.yaml` | Generated S3 gateway configuration. | The generated component configuration files (`config.yaml`, `config-ir.yaml`, `config-sn.yaml`, `config-s3.yaml`) are managed by Morph. Manual edits to these files are not supported and can break on upgrades. ## Wallets Each node generates its wallets at the first start and encrypts them with the passwords below. The passwords are also written into the generated configuration files. | Variable | Default | Meaning | |---|---|---| | `MORPH_PATH_IR_WALLET` | `/morph/local_state/config/wallet-ir.json` | Inner ring wallet. Removed on storage-type and gateway-type nodes. | | `MORPH_IR_WALLET_PASS` | `one` | Password of the inner ring wallet and of the copy in `MORPH_PATH_AZ_WALLET`. | | `MORPH_PATH_AZ_WALLET` | `/morph/local_state/config/az.json` | Copy of the inner ring wallet. The console of a cluster-type node uses it for cluster administration, such as funding and decommissioning storage nodes. | | `MORPH_PATH_SN_WALLET` | `/morph/local_state/config/wallet-sn.json` | Storage node wallet. Removed on gateway-type nodes. | | `MORPH_SN_WALLET_PASS` | `second` | Password of the storage node wallet. | | `MORPH_SN_WALLET_LABEL` | `storage-node` | Label of the account in the storage node wallet. | | `MORPH_PATH_GATEWAY_WALLET` | `/morph/local_state/config/wallet-gateway.json` | Wallet shared by the console and the S3 gateway of the node. | | `MORPH_GATEWAY_WALLET_PASS` | `gatewaypassword` | Password of the gateway wallet. | | `MORPH_PATH_S3_WALLET` | not set | Deprecated name of `MORPH_PATH_GATEWAY_WALLET`. Read only when the new name is absent from the environment. | | `MORPH_S3_WALLET_PASS` | not set | Deprecated name of `MORPH_GATEWAY_WALLET_PASS`. Read only when the new name is absent from the environment. | The default passwords are the same in every copy of the image. A password takes effect only when it is set before the first start, because the wallets are created then. ## Ports Only `MORPH_PORT_PROMETHEUS_COLLECTOR` moves a listener. The other variables tell the entrypoint where to find a process whose listen address is fixed in the generated configuration. To expose a service on another port, publish the container port on another host port. See [ports and protocols](../ports-and-protocols.md). | Variable | Default | Meaning | |---|---|---| | `MORPH_PORT_CONSOLE` | `9100` | Port on which the entrypoint probes the console (`HEAD /`). The installer and the console listen on 9100 regardless of this value. | | `MORPH_PORT_IR_RPC` | `30333` | Port on which the entrypoint reaches the FS chain RPC of the local inner ring. The inner ring listens on 30333 regardless of this value. | | `MORPH_PORT_SN` | `8080` | Read and logged. No listener or probe uses it. | | `MORPH_PORT_S3GW` | `9080` | Read and logged. No listener or probe uses it. | | `MORPH_PORT_PROMETHEUS_COLLECTOR` | `5100` | Port of the metrics collector (`/metrics`). Falls back to 5100 when unset or empty. | `MORPH_PORT_CONSOLE`, `MORPH_PORT_IR_RPC`, `MORPH_PORT_SN` and `MORPH_PORT_S3GW` must be integers. The entrypoint exits at start when one of them is missing or not a number. ## Supervision After the processes have started, the entrypoint probes each of them every 10 seconds, with a timeout of 5 seconds per probe. | Variable | Default | Meaning | |---|---|---| | `MORPH_HEALTHCHECK_ERROR_LIMIT` | `3` | Number of consecutive failed probes of one process after which the node counts as unhealthy. Integer, required. | | `RESTART_IF_ERROR_LIMIT_REACHED` | `true` (a default in the entrypoint; the image does not set this variable) | What happens at the limit. `true`: the entrypoint stops all processes and exits with status 1, which stops the container. `false`: the entrypoint logs the failure, resets the counter and continues. Accepted values: `1`, `t`, `true`, `y`, `yes` and `0`, `f`, `false`, `n`, `no`. Any other value means the default. | | `MORPH_SHUTDOWN_TIMEOUT` | `30` | Seconds the entrypoint allows for shutdown. Integer, required. | The entrypoint never restarts the container itself. Whether a stopped container starts again depends on how you run it. ## Installer command line The entrypoint runs the installer as `installer --config $MORPH_PATH_INSTALLER_CONFIG`. | Flag | Meaning | |---|---| | `--config` | Path to the installer configuration file. Required. | | `--version` | Print the installer version and exit. | --- # Storage node settings :::warning Morph manages this configuration file. Manual changes to the file or overrides through component environment variables are not supported. Use the [installer configuration](installer.md), Morph [environment variables](environment-variables.md) or the [REST API](../rest-api/index.md) for supported settings. Upgrades and automatic migrations can change or overwrite this file arbitrarily and break local edits. This page is provided for reference only; change these settings only on advice from Morph support, at your own risk. ::: The storage node (`neofs-node`) runs in cluster-type and storage-type Morph nodes. The installer writes its configuration file once, during installation, and Morph manages it afterwards. This page lists what the installer writes, the upstream defaults that apply, and how Morph migrates the file, for reference only. | Fact | Value | |---|---| | File | the path in `MORPH_PATH_SN_CONFIG`; in the image `/morph/local_state/config/config-sn.yaml` | | File mode | `0640` | | Format | YAML | | Written by | the installer, once, when the installation completes | | Read by | `neofs-node --config `, started by `morphentry` | | Unknown keys | rejected; the node does not start with a key it does not know | Types used below: a *duration* is a number with a unit (`500ms`, `10s`, `1m`). A *size* is a number with an optional unit `k`, `m`, `g` or `t`, with or without a trailing `b`; the units are binary (`1g` and `1GB` are both 1 GiB). A *file mode* is an octal number. ## Generated configuration The values come from the installer's template. "From the installer" means the value is taken from the installation request or from the [installer configuration](installer.md). ### `fschain` | Key | Value | Meaning | |---|---|---| | `fschain.endpoints` | cluster-type node: `ws://localhost:30333/ws`. Storage-type node: the chain addresses given to the installer, each rewritten to a WebSocket URL (`http://host:port` or `host:port` becomes `ws://host:port/ws`, `https://host:port` becomes `wss://host:port/ws`) | Ordered list of FS chain RPC endpoints. The node is connected to one at a time and falls back to the next on a network error. | | `fschain.dial_timeout` | `20s` | Timeout for opening a connection to a chain endpoint. Node default: `1m`. | ### `control` | Key | Value | Meaning | |---|---|---| | `control.grpc.endpoint` | `localhost:16513` | Address of the control service, the interface that `neofs-cli control` uses. It listens on the loopback interface of the Morph container. | `control.authorized_keys` is not set. The control service accepts requests signed with the node's own key, which is the key in the storage node wallet. ### `node` | Key | Value | Meaning | |---|---|---| | `node.wallet.path` | the path in `MORPH_PATH_SN_WALLET`; in the image `/morph/local_state/config/wallet-sn.json` | Wallet that holds the node key. The installer generates it. | | `node.wallet.password` | the value of `MORPH_SN_WALLET_PASS` | Password of the wallet. | | `node.addresses` | from the installer | Addresses the node announces in the network map. Other nodes and gateways connect to these. | | `node.attributes` | from the installer | Node attributes as `key:value` strings. Storage policies select nodes by these attributes. | | `node.persistent_state.path` | `/neofs-storage-state`; in the image `/morph/local_state/neofs-storage-state` | Database for state that must survive a restart, such as the last processed block and session tokens issued by this node. | ### `grpc` | Key | Value | Meaning | |---|---|---| | `grpc[0].endpoint` | `0.0.0.0:8080` | Listener of the public storage node API. | | `grpc[0].tls.enabled` | `true` when every announced address uses `grpcs://`, otherwise `false` | TLS on the public listener. No `certificate` is set, so the node generates a self-signed certificate from its node key. | | `grpc[1].endpoint` | `127.0.0.1:8084`; present only when TLS is enabled on the public listener | Plaintext listener for the console and the S3 gateway in the same Morph container. | | `grpc[1].tls.enabled` | `false` | | The installer rejects an address list that mixes `grpc://` and `grpcs://`. An address without a scheme counts as `grpc://`. ### `logger`, `prometheus`, `pprof` | Key | Value | Meaning | |---|---|---| | `logger.level` | `info` | Log level. One of `debug`, `info`, `warn`, `error`, `dpanic`, `panic`, `fatal`. | | `prometheus.enabled` | `true` | Serves the node's metrics. | | `prometheus.address` | `localhost:6664` | Metrics listener. `morphentry` scrapes it and republishes the metrics on the collector port (see [metrics](../metrics.md)). | | `pprof.enabled` | `false` | Go profiler. | | `pprof.address` | `localhost:6663` | Profiler listener, used only when `pprof.enabled` is `true`. | ### `metadata` | Key | Value | Meaning | |---|---|---| | `metadata.path` | `sn.metadata` of the installer configuration; `/data/meta` in the shipped file. The installer applies no default: without the key the value is empty. | Directory of the metadata service's storage. With an empty value the node starts with the metadata service turned off. | | `metadata.seed_port` | `20334` | Port of the metadata chain's seed nodes. The hosts are those of the FS chain's seed list, which the node reads from the chain. | | `metadata.p2p_addresses` | `0.0.0.0:21334` | Address the metadata service listens on for its peer-to-peer protocol. | ### `storage.shards` One list entry per shard of the installer configuration (`sn.shards`). Without that list the installer writes one shard with the default paths. `` is the position of the shard in the list, starting at 0. | Key | Value | Meaning | |---|---|---| | `metabase.path` | `sn.shards[].metadata`; default `/data/meta//metabase.db` | File of the shard's index. | | `metabase.perm` | `0770` | Mode of the index file. Node default: `0640`. | | `writecache.enabled` | `true`; the whole `writecache` block is written only when both `sn.shards[].writecache.path` and `.size` are set | Enables the write-cache of the shard. | | `writecache.capacity` | `sn.shards[].writecache.size` | Approximate maximum size of the write-cache. When it is full, objects are written to the object store directly. | | `writecache.path` | `sn.shards[].writecache.path` | Directory of the write-cache. | | `blobstor.type` | `fstree` | Type of the object store. `fstree` is the only type the node supports. | | `blobstor.path` | `sn.shards[].data`; default `/data/` | Root directory of the shard's object data. The node identifies a shard by this path. | | `blobstor.depth` | `3` | Nesting depth of the directory tree. Node default: `4`. | | `blobstor.combined_count_limit` | `1`; written only when combined writing is off for the shard | `1` turns combined writing off. Without the key the node default of `128` applies. | | `gc.remover_batch_size` | `200` | Number of objects the garbage collector removes in one batch. Node default: `100`. | | `gc.remover_sleep_interval` | `10s` | Pause between garbage collector runs. Node default: `1m`. | Combined writing puts several small objects into one file. The installer decides per shard: | `sn.shards[].combined_writing.enabled` | Drive under the data path | Result | |---|---|---| | `true` | any | combined writing on (key not written) | | `false` | any | `combined_count_limit: 1` | | not set | rotational | combined writing on (key not written) | | not set | not rotational | `combined_count_limit: 1` | | not set | detection failed | combined writing on (key not written); the installer logs a warning | ## Settings Morph does not set The generated file contains none of the following keys, so the node's upstream defaults apply. They are listed here for reference only; adding or changing them manually is not supported. Defaults are those of the bundled node (see [component versions](../../releases/component-versions.md)). ### `storage` | Key | Type | Default | Meaning | |---|---|---|---| | `storage.shard_ro_error_threshold` | integer | `0` | Number of storage errors on a shard after which the node switches the shard to `degraded-read-only` by itself (to `read-only` if that switch fails). `0` turns the automatic switch off. | | `storage.ignore_uninited_shards` | boolean | `false` | Start the node even when a shard fails to initialize. | | `storage.shard_defaults` | shard | none | Values for keys that an entry of `storage.shards` leaves out. Same format as a shard. | :::warning With `storage.shard_ro_error_threshold` at `0`, a shard on a failed drive stays in `read-write` mode until an operator changes its mode. See [Replace a failed drive](../../how-to/operate/replace-a-failed-drive.md). ::: ### Shard: `storage.shards[]` | Key | Type | Default | Meaning | |---|---|---|---| | `mode` | string | `read-write` | Mode of the shard at start. See the table of modes below. | | `writecache.enabled` | boolean | `false` | Enables the write-cache. | | `writecache.capacity` | size | `1g` (1 GiB) | Approximate maximum size of the write-cache. | | `writecache.no_sync` | boolean | `false` | Turns off write synchronization for the write-cache. Faster; can lose data on power failure. | | `blobstor.perm` | file mode | `0640` | Mode of created files and directories. | | `blobstor.flush_interval` | duration | `10ms` | Interval between batch writes to disk. | | `blobstor.depth` | integer | `4` | Depth of the directory tree. Morph writes `3`. | | `blobstor.allow_depth_change` | boolean | `false` | Allows the node to change the depth of an existing shard at restart. The node moves the files in the background. | | `blobstor.no_sync` | boolean | `false` | Turns off write synchronization for object data. Faster; can lose data on power failure. | | `blobstor.combined_count_limit` | integer | `128` | Maximum number of objects in one combined file. `1` turns combined writing off. `0` or a negative value means the default. | | `blobstor.combined_size_limit` | size | `8m` (8 MiB) | Maximum size of a combined file. | | `blobstor.combined_size_threshold` | size | `128k` (128 KiB) | Objects of this size or larger are never combined. | | `metabase.max_batch_size` | integer | `1000` | Maximum number of write operations in one index transaction. | | `metabase.max_batch_delay` | duration | `10ms` | Maximum delay before a batch starts. | | `metabase.search_iteration_limit` | integer | `10000` | Number of consecutive non-matching objects after which a search stops iterating. `0` means no limit. | Shard modes: | Mode | Writes | Index and write-cache | Use | |---|---|---|---| | `read-write` | allowed | available | Normal operation. | | `read-only` | refused | available | Evacuating a shard that is still readable. | | `degraded` | allowed | not used | Upstream advises against using it. | | `degraded-read-only` | refused | not used | Replacing the drive that holds the index, and a shard whose error counter passed the threshold. When the node cannot open the index at a configuration reload, it switches the shard to this mode by itself. At start it switches the shard to `read-only` instead, and to this mode only if that fails. | | `disabled` | - | - | Configuration file only: the node ignores the shard. | `neofs-cli control shards set-mode` accepts `read-write`, `read-only` and `degraded-read-only` (see [command-line tools](../command-line-tools.md)). ### `policer` The policer restores redundancy in the background. See [failure domains and self-healing](../../explanation/failure-domains-and-self-healing.md). | Key | Type | Default | Meaning | |---|---|---|---| | `policer.head_timeout` | duration | `5s` | Timeout of the request that asks another node whether it holds an object. | | `policer.replication_cooldown` | duration | `1s` | Pause between two batches. | | `policer.object_batch_size` | integer | `10` | Number of objects the policer checks per batch. | | `policer.boost_multiplier` | integer | `3` | Factor applied to `object_batch_size` while the policer repairs missing redundancy. It starts when 5 of the last 8 batches found a shortage and ends when 5 of the last 8 found none. | ### `replicator` | Key | Type | Default | Meaning | |---|---|---|---| | `replicator.put_timeout` | duration | `1m` | Timeout for sending one object to another node. | | `replicator.disable_post_initial_queue` | boolean | `false` | When `true`, a write acknowledged under an initial placement policy does not queue its remaining replicas; the policer alone delivers them. | ### `apiclient` Connections from this node to other storage nodes. | Key | Type | Default | Meaning | |---|---|---|---| | `apiclient.stream_timeout` | duration | `1m` | Timeout of one operation inside a streaming call. | | `apiclient.min_connection_time` | duration | `20s` | Minimum time allowed for opening a connection to another node. | | `apiclient.ping_interval` | duration | `10s` | Interval between pings of a connected node. | | `apiclient.ping_timeout` | duration | `5s` | Timeout of one ping. | ### `fschain` | Key | Type | Default | Meaning | |---|---|---|---| | `fschain.cache_ttl` | duration | `15s` | How long the node caches what it reads from the FS chain: buckets (NeoFS containers), bucket lists and extended access rules. A negative value turns the cache off. | | `fschain.quota_ttl` | duration | `10m` | How long the node caches the used space and quota of a bucket. A negative value turns the cache off. | | `fschain.reconnections_number` | integer | `5` | Passes through the endpoint list before the connection counts as lost. | | `fschain.reconnections_delay` | duration | `5s` | Pause between reconnection attempts. | ### Other keys | Key | Type | Default | Meaning | |---|---|---|---| | `logger.encoding` | string | `console` | `console` or `json`. | | `logger.timestamp` | boolean | `false` | Timestamps in log lines. When the key is absent, they are on if the node runs on a terminal. | | `logger.sampling.enabled` | boolean | `false` | Log sampling. | | `object.delete.tombstone_lifetime` | integer | `5` | Lifetime of the deletion marker of a removed object, in epochs. | | `grpc[].conn_limit` | integer | none | Limit of concurrent connections on a listener. Further connections wait. | | `grpc[].tls.certificate` | string | none | Path of a TLS certificate issued for the node key. Without it the node uses a self-signed certificate. | | `prometheus.shutdown_timeout`, `pprof.shutdown_timeout` | duration | `30s` | Time allowed for the listener to shut down. | ## File lifecycle ### Persistence and migrations The installer runs only while the file named by `MORPH_PATH_INSTALLATION_COMPLETED` does not exist. On every later start `morphentry` starts the node with the existing configuration file from `/morph/local_state`. Morph manages this file, and future upgrades or migrations can modify or overwrite it arbitrarily. `morphentry` modifies the file during configuration migrations. Before it starts the node, it compares the version recorded in the first line of the file (`# configVersion: `) with the migrations it knows and applies the newer ones. | Migration | Change to the storage node configuration | |---|---| | 0.26.0 | Adds `metadata.seed_port: 20334`, `metadata.p2p_addresses` and `metadata.rpc_addresses` where they are missing. | | 0.27.0 | Sets `metadata.p2p_addresses` to `0.0.0.0:21334`, replacing any other value. Removes `metadata.rpc_addresses`. Removes the top-level `object` section with everything in it. | A file without a version line counts as older than every migration. This includes the file as the installer writes it, so the first start applies both migrations to it. A migration keeps all other keys, their order and the comments. It saves the previous file next to the configuration as `config-sn.yaml.pre--migration`. ### Component configuration mechanics Morph does not support manual edits to `config-sn.yaml` or `NEOFS_*` environment variable overrides. The upstream `neofs-node` behavior below is documented for reference only, for example when diagnosing an issue with Morph support. | Mechanism | Applies to | When it takes effect | |---|---|---| | Configuration file | every key | at the next start of `neofs-node` (a restart of the Morph container), or at a reload for the keys listed below | | `NEOFS_*` environment variables on the Morph container | every key. For a shard, a variable for a nested section replaces that whole section (see below) | at the next start of the container | | `neofs-cli control` | shard mode, node status | immediately; a shard mode set this way is not written to the file | **Environment variables.** `morphentry` starts `neofs-node` with the environment of the Morph container, and the node reads every setting from a variable named `NEOFS_` plus the key in upper case with `.` replaced by `_`. A variable takes precedence over the file. | Key | Variable | |---|---| | `storage.shard_ro_error_threshold` | `NEOFS_STORAGE_SHARD_RO_ERROR_THRESHOLD` | | `policer.object_batch_size` | `NEOFS_POLICER_OBJECT_BATCH_SIZE` | | `policer.replication_cooldown` | `NEOFS_POLICER_REPLICATION_COOLDOWN` | | `replicator.put_timeout` | `NEOFS_REPLICATOR_PUT_TIMEOUT` | Entries of a list use their position: `NEOFS_STORAGE_SHARDS_0_MODE` is the mode of the first shard. A variable for a nested section of a shard (`writecache`, `metabase`, `blobstor`, `gc`) replaces that whole section as read from the file. **Reload.** `neofs-node` re-reads its configuration file when the process receives `SIGHUP`. `morphentry` handles `SIGTERM` and interrupt only and does not pass `SIGHUP` on, so the signal only reaches `neofs-node` if sent directly to that process inside the Morph container. A reload applies: | Section | What a reload applies | |---|---| | `logger` | `level` | | `prometheus`, `pprof` | all keys; the listener restarts | | `policer` | `head_timeout`, `replication_cooldown`, `object_batch_size`, `boost_multiplier` | | `storage.shards` | Shards are matched by `blobstor.path`. A shard no longer in the file, or with `mode: disabled`, is closed. A new shard is opened. For a remaining shard the mode and the index path are applied. A change of `blobstor.depth` needs a restart. | | `fschain` | `endpoints` | | `node` | `attributes` | | `grpc` | all keys; the public listeners restart, with a short interruption. Adding, changing or removing a TLS listener without `certificate` needs a restart. The control listener is not affected. | ## Related pages - [Installer configuration](installer.md): the drive layout the installer turns into `storage.shards`. - [Environment variables](environment-variables.md): the `MORPH_*` variables named on this page. - [Ports and protocols](../ports-and-protocols.md). - [Configure drives and shards](../../how-to/deploy/configure-drives.md). --- # Inner ring settings :::warning Morph manages this configuration file. Manual changes to the file or overrides through component environment variables are not supported. Use the [installer configuration](installer.md), Morph [environment variables](environment-variables.md) or the [REST API](../rest-api/index.md) for supported settings. Upgrades and automatic migrations can change or overwrite this file arbitrarily and break local edits. This page is provided for reference only; change these settings only on advice from Morph support, at your own risk. ::: The inner ring (`neofs-ir`) runs in cluster-type Morph nodes only. It runs the FS chain and its consensus. The installer writes the configuration file once, when the installation completes, and Morph manages it afterwards. This page lists every key of that file for reference only. | Fact | Value | |---|---| | File | the path in `MORPH_PATH_IR_CONFIG`; in the image `/morph/local_state/config/config-ir.yaml` | | File mode | `0640` | | First line | `# configVersion: ` | | Written by | the installer, once, on a cluster-type node | | Read by | `neofs-ir --config `, started by `morphentry` | Background: [inner ring and FS chain](../../explanation/inner-ring-and-fs-chain.md). ## Generated configuration ### `logger`, `pprof`, `prometheus` | Key | Value | Meaning | |---|---|---| | `logger.level` | `info` | Log level. One of `debug`, `info`, `warn`, `error`, `dpanic`, `panic`, `fatal`. | | `pprof.enabled` | `false` | Go profiler. | | `pprof.address` | `:6060` | Profiler listener, used only when `pprof.enabled` is `true`. | | `pprof.shutdown_timeout` | `30s` | Time allowed for the profiler listener to shut down. | | `prometheus.enabled` | `true` | Serves the inner ring's metrics. | | `prometheus.address` | `localhost:9090` | Metrics listener. `morphentry` scrapes it and republishes the metrics on the collector port (see [metrics](../metrics.md)). | | `prometheus.shutdown_timeout` | `30s` | Time allowed for the metrics listener to shut down. | ### `wallet` | Key | Value | Meaning | |---|---|---| | `wallet.path` | the path in `MORPH_PATH_IR_WALLET`; in the image `/morph/local_state/config/wallet-ir.json` | Wallet of this inner ring node. The installer generates it. | | `wallet.address` | address of the node's own account in that wallet | Account the inner ring signs with. | | `wallet.password` | the value of `MORPH_IR_WALLET_PASS` | Password of the account. | ### `fschain` | Key | Value | Meaning | |---|---|---| | `fschain.dial_timeout` | `5s` | Timeout for the inner ring's own RPC connection to the chain. | | `fschain.reconnections_number` | `5` | Number of reconnection attempts. | | `fschain.reconnections_delay` | `5s` | Pause between reconnection attempts. | | `fschain.validators` | public keys of all inner ring nodes of the installation, sorted | Keys the node votes for as chain validators at start. | `fschain.endpoints` is not set. Without it the inner ring runs the chain itself, with the settings under `fschain.consensus`. ### `fschain.consensus` | Key | Value | Meaning | |---|---|---| | `magic` | a number derived from the public keys of the inner ring nodes | Network identifier of the chain. Every node of one installation computes the same number. The values `15405`, `860833102` and `894710606` are never used. | | `committee` | public keys of all inner ring nodes, sorted | Initial committee of the chain. Its size is the size of the inner ring. | | `storage.type` | `boltdb` | Storage engine of the chain data. | | `storage.path` | `/fschain.bolt`; in the image `/morph/local_state/fschain.bolt` | File of the chain data. | | `time_per_block` | `50ms` | Minimum time between two blocks. | | `max_time_per_block` | `2s` as written by the installer; `20s` after the first start (see [changes after installation](#changes-after-installation)) | Maximum time between two blocks. With both values set, the block time varies between them. | | `max_traceable_blocks` | `200000` | Length of the chain history that contracts can access. | | `hardforks` | `Gorgon: 0` | Chain protocol changes and the block height at which each becomes active. `0` activates it from the first block, together with all earlier ones. | | `seed_nodes` | `:20333` and the address of every other inner ring node (`external_address:ir_port` as each node gave it to its installer) | Nodes to connect to over the chain's peer-to-peer protocol. | | `rpc.listen` | `:30333` | Listener of the chain RPC. Storage nodes, consoles and S3 gateways connect to it. | | `rpc.max_gas_invoke` | `200` | Maximum GAS one RPC invocation may spend. | | `rpc.max_websocket_clients` | `512` | Maximum number of simultaneous WebSocket clients. | | `rpc.session_pool_size` | `512` | Maximum number of concurrent iterator sessions. | | `p2p.listen` | `:20333` | Listener of the chain's peer-to-peer protocol. | | `p2p.dial_timeout` | `3s` | Maximum duration of one peer dial. | | `p2p.proto_tick_interval` | `2s` | Interval between protocol ticks with each peer. | | `p2p.peers.min` | `0` for 1 inner ring node, `2` for 4, `4` for 7, `1` for any other number | Peers the node needs before consensus starts. | | `p2p.peers.max` | number of inner ring nodes plus 5 | Maximum number of peers. | | `p2p.peers.attempts` | `20` | Peers the node dials when it has fewer than `min`. | | `p2p.ping.interval` | `3s` | Interval between pings of a peer. | | `p2p.ping.timeout` | `9s` | Time to wait for the answer to a ping. | | `p2p_notary_request_payload_pool_size` | `5000` | Size of the memory pool for notary requests. | | `set_roles_in_genesis` | `true` | Gives the committee members the notary and alphabet roles in the first block. | ### Other sections | Key | Value | Meaning | |---|---|---| | `workers.netmap` | `100` | Workers that process network map events in parallel. Upstream default: `10`. | | `workers.container` | `100` | Workers that process bucket (NeoFS container) events in parallel. Upstream default: `10`. | | `nns.system_email` | `ops@nspcc.io` | E-mail recorded for the name service domains that the inner ring registers when it deploys the chain. | | `timers.collect_basic_income.mul`, `.div` | `1`, `2` | Point inside an epoch, as the fraction `mul/div`, at which basic income collection starts. | | `emit.storage.amount` | `1000000000` | GAS, in units of 10^-8, that the inner ring emits to all storage nodes in each emission cycle. | | `control.grpc.endpoint` | `:16512` | Listener of the inner ring's control service (`neofs-cli control healthcheck --ir`). It accepts requests signed with the inner ring node's own key. | | `experimental.allow_ec` | `true` | Allows buckets with erasure coding rules. | | `experimental.chain_meta_data.enabled` | `true` | Allows buckets (NeoFS containers) whose object metadata is handled through the chain. | | `experimental.chain_meta_data.seed_port` | `20334` | Port of the metadata chain's seed nodes. Hosts are those of `fschain.consensus.seed_nodes`. | | `experimental.chain_meta_data.p2p_port` | `20334` | Peer-to-peer port of the metadata chain. Hosts are those of `fschain.consensus.p2p.listen`. | | `experimental.chain_meta_data.rpc_port` | `30334` | RPC port of the metadata chain. Hosts are those of `fschain.consensus.rpc.listen`. | | `node.persistent_state.path` | `/neofs-ir-state`; in the image `/morph/local_state/neofs-ir-state` | File with state that must survive a restart. | ### Settings passed by environment `morphentry` sets two inner ring settings through the environment of the process. They are not in the file. | Variable | Value | Key | Meaning | |---|---|---|---| | `NEOFS_IR_SN_VALIDATOR_ENABLED` | `true` | `sn_validator.enabled` | The inner ring sends the information of a storage node to an external validator service, which answers whether the node is valid. | | `NEOFS_IR_SN_VALIDATOR_URL` | `http://127.0.0.1:8987/verify` | `sn_validator.url` | Address of that service: the `sn-verificator` that runs inside `morphentry` on a cluster-type node. | ## Changes after installation The installer does not run again once the installation is complete, so `morphentry` reuses the file in `/morph/local_state` across restarts and upgrades. `morphentry` also rewrites the file itself in the cases below, and future upgrades can modify it further; manual edits are not supported and can break. Each time `morphentry` changes the file, it saves the previous copy next to the configuration. | When | Change | Backup file suffix | |---|---|---| | After all services have started, on every start of a cluster-type node | Sets `fschain.consensus.max_time_per_block` to `20s` if it has another value, then restarts `neofs-ir`. On a new installation this happens once, after the first start. | `.pre-reconfig` | | Before `neofs-ir` starts, when the file's version is older than a migration (not on the first start) | Migration 0.26.0: turns `experimental.chain_meta_data: true` or `false` into the section with `enabled`, `seed_port`, `p2p_port`, `rpc_port`. Migration 0.27.0: adds `hardforks` with `Faun: 0` when the section is missing, and sets `max_time_per_block` to `20s`. | `.pre--migration` | | When a chain hardfork has been scheduled for the installation | Writes the hardfork and its height into `fschain.consensus.hardforks`, then restarts `neofs-ir` only. See [Hardforks](../../explanation/inner-ring-and-fs-chain.md#hardforks). | `.pre-hardfork` | A value of `max_time_per_block` other than `20s` does not survive a start: `morphentry` writes `20s` again. ## Component configuration mechanics Morph does not support manual edits to `config-ir.yaml` or `NEOFS_IR_*` environment variable overrides. The upstream `neofs-ir` behavior below is documented for reference only. | Mechanism | Notes | |---|---| | Configuration file | Read when `neofs-ir` starts, that is at the next start of the Morph container. Settings under `fschain.consensus` that define the chain (`magic`, `committee`, `hardforks`) must be identical on every inner ring node. | | `NEOFS_IR_*` environment variables on the Morph container | `morphentry` starts `neofs-ir` with the environment of the Morph container. The inner ring reads a setting from the variable `NEOFS_IR_` plus the key in upper case with `.` replaced by `_`, for example `NEOFS_IR_LOGGER_LEVEL`. A variable takes precedence over the file. | `neofs-ir` does not reload its configuration on a signal. It treats `SIGHUP` like `SIGTERM` and shuts down. The number of inner ring nodes is fixed when the installation is created. The generated `committee`, `validators`, `magic` and peer limits all follow from it. ## Related pages - [Environment variables](environment-variables.md): the `MORPH_*` variables named on this page. - [Ports and protocols](../ports-and-protocols.md). - [Installer API](../installer-api.md): the request that supplies the inner ring addresses. - [Command-line tools](../command-line-tools.md): the generated command-line configuration for the inner ring. --- # S3 gateway settings :::warning Morph manages this configuration file. Manual changes to the file or overrides through component environment variables are not supported. Use the [installer configuration](installer.md), Morph [environment variables](environment-variables.md) or the [REST API](../rest-api/index.md) for supported settings. Upgrades and automatic migrations can change or overwrite this file arbitrarily and break local edits. This page is provided for reference only; change these settings only on advice from Morph support, at your own risk. ::: Every Morph node runs the S3 gateway (`neofs-s3-gw` 0.48.1). The installer writes its configuration file once, during the first start of the Morph container, and Morph manages it afterwards. This page documents the file for reference only. ## The file | Property | Value | |---|---| | Path inside the Morph container | `/morph/local_state/config/config-s3.yaml` (environment variable `MORPH_PATH_S3_CONFIG`) | | Format | YAML | | File mode | `0640` | | Written by | The installer, on the first start of the Morph container | | Read by | `neofs-s3-gw --config `, started by the Morph entrypoint | | Gateway wallet | `/morph/local_state/config/wallet-gateway.json` (`MORPH_PATH_GATEWAY_WALLET`), passphrase from `MORPH_GATEWAY_WALLET_PASS` | ## File lifecycle | Event | Effect on the file | |---|---| | Restart of the Morph container | The file is reused from `/morph/local_state`. The installer runs only while the installation marker `/morph/local_state/config/installation.txt` is absent. | | Upgrade to a new Morph image with the same `/morph/local_state` volume | The file is reused from `/morph/local_state`. Releases 0.25.0 to 0.30.1 have no migration for this file, but future upgrades can change or overwrite it arbitrarily, so manual edits are not supported. | | Start without the previous `/morph/local_state` volume | The node is installed again and a new file is generated. | Unless a migration updates it, a generated file is not updated when a later Morph release changes the template. A node installed with an earlier release keeps the values of that release. ### Component configuration mechanics Morph does not support manual edits to `config-s3.yaml` or `S3_GW_*` environment variable overrides. The upstream `neofs-s3-gw` behavior below is documented for reference only. | Mechanism | Behavior | |---|---| | Configuration file on restart | The gateway reads the file when it starts and applies all settings. | | `SIGHUP` to the `neofs-s3-gw` process | The gateway reloads the settings marked "yes" in the reload column below. | | `S3_GW_*` environment variables on the Morph container | The Morph entrypoint starts the gateway with the environment of the container. The variable name is the key with the prefix `S3_GW_`, in upper case, with dots replaced by underscores, for example `S3_GW_LOGGER_LEVEL`. A value in the environment takes precedence over the file. | ## Generated settings The values are the ones in the template of the installer. "Reload" tells whether the gateway applies a change on `SIGHUP`; other settings need a restart of the gateway. ### Wallet and connections | Key | Value Morph sets | Reload | Meaning | |---|---|---|---| | `wallet.path` | Path of the gateway wallet | no | Wallet whose key the gateway uses to sign its requests and to open S3 credentials. | | `wallet.passphrase` | Passphrase of the gateway wallet | no | Decrypts the wallet. | | `wallet.address` | `""` | no | Account to use from the wallet. Empty selects the default account. | | `peers[].address` | Cluster-type and storage-type node: `localhost:8080`, or `127.0.0.1:8084` when public TLS is enabled on the storage node. Gateway-type node: the storage node addresses given at installation. | no | Storage nodes the gateway sends requests to. | | `peers[].priority` | `1` | no | Nodes of a lower-priority group are used only when all nodes with a smaller number are unhealthy. | | `peers[].weight` | `1` | no | Share of requests within a priority group. | | `fschain.endpoints` | Cluster-type node: `http://localhost:30333`. Storage-type and gateway-type node: the chain RPC endpoints of the inner ring nodes given at installation. | partly | FS chain RPC endpoints. The gateway resolves bucket names and storage policies through them. On `SIGHUP` the bucket name resolver and the storage policy lookup switch to the new endpoints; the other chain connections of the gateway change at a restart. | | `connect_timeout` | `10s` | no | Timeout for connecting to a storage node. | | `stream_timeout` | `10111s` | no | Timeout for one operation of a streaming request to a storage node. | | `healthcheck_timeout` | `15s` | no | Timeout of the health check of a storage node. | | `rebalance_interval` | `60s` | no | Interval between health checks. | | `pool_error_threshold` | `100` | no | Number of errors on a connection after which the storage node counts as unhealthy. | ### Listener | Key | Value Morph sets | Reload | Meaning | |---|---|---|---| | `server[0].address` | `:9080` | no | Address of the S3 endpoint. | | `server[0].tls.enabled` | `false` | no | TLS on the S3 endpoint. | | `server[0].tls.cert_file` | `/path/to/cert` (placeholder, unused while TLS is off) | yes, while TLS is on | Certificate file. | | `server[0].tls.key_file` | `/path/to/key` (placeholder, unused while TLS is off) | yes, while TLS is on | Key file. | | `listen_domains` | `[]` | no | Domains for virtual-hosted-style requests. Empty turns the style off. See [Addressing](../s3-compatibility.md#addressing). | | `max_clients_count` | `100` | no | Number of S3 requests the gateway handles at the same time. | | `max_clients_deadline` | `30s` | no | Time a request waits for a free slot before the gateway answers HTTP 503 `RequestTimeout`. | | `allowed_access_key_id_prefixes` | `[]` | no | Access key ID prefixes the gateway accepts. Empty accepts all. | | `namespace` | Gateway-type node: the namespace given at installation. Other nodes: `""`. | no | Binds the gateway to one namespace. Credentials of another namespace are rejected. Empty turns the binding off. See [Use namespaces](../../how-to/buckets-and-objects/use-namespaces.md). | ### Logging, metrics and profiling | Key | Value Morph sets | Reload | Meaning | |---|---|---|---| | `logger.level` | `info` | yes | Log level: `debug`, `info`, `warn`, `error`, `dpanic`, `panic`, `fatal`. | | `prometheus.enabled` | `true` | yes | Prometheus metrics endpoint. | | `prometheus.address` | `localhost:8086` | yes | Address of the metrics endpoint. The Morph metrics collector scrapes `http://localhost:8086/metrics`; the port is fixed in the entrypoint and is not read from this file. The entrypoint decides that the gateway is ready when the collector's own endpoint on port 5100 shows `neofs_s3_gw_state_health 2`. | | `pprof.enabled` | `true` | yes | Go profiling endpoint. | | `pprof.address` | `localhost:8085` | yes | Address of the profiling endpoint. | ### Caches Each cache has a `lifetime` of its entries and a `size` in entries. The effect of each cache on S3 clients is described under [Consistency](../s3-compatibility.md#consistency). | Key | Value Morph sets | Gateway default | Content | |---|---|---|---| | `cache.objects` | `lifetime: 300s`, `size: 150` | `5m`, `1000000` | Object headers by object ID. | | `cache.list` | `lifetime: 1m`, `size: 100` | `60s`, `100000` | Object listings. Not filled by gateway 0.48.1. | | `cache.names` | `lifetime: 1m`, `size: 1000` | `0s` (off), `10000` | Current object, tags and lock state by key, used by GetObject and HeadObject. | | `cache.buckets` | `lifetime: 1m`, `size: 500` | `60s`, `1000` | Bucket information by bucket name. | | `cache.system` | `lifetime: 2m`, `size: 1000` | `5m`, `10000` | Object tags and lock state. | | `cache.accessbox` | `lifetime: 5m`, `size: 10` | `10m`, `100` | S3 credentials by access key ID. | | `cache.accesscontrol` | `lifetime: 1m`, `size: 100000` | `1m`, `100000` | Which user may read which cache entry. | The cache of bucket access rules has a lifetime of 1 minute and 1000 entries and has no setting. ### Buckets and requests | Key | Value Morph sets | Reload | Meaning | |---|---|---|---| | `placement_policy.default` | `REP 1` on a network with one inner ring node, otherwise `REP 3` | yes | Storage policy for CreateBucket without `LocationConstraint`, used only when the storage policy contract has no default policy. | | `placement_policy.contract_name` | `storagepolicy` | yes | Name of the FS chain contract that resolves `LocationConstraint` values and the default policy. See [Regions and storage policies](../s3-compatibility.md#regions-and-storage-policies). | | `cors.default_max_age` | `600` | no | `Access-Control-Max-Age` in seconds for CORS rules without `MaxAgeSeconds`. | | `s3.max_object_to_delete_per_request` | `1000` | no | Largest number of keys in one DeleteObjects request. | | `internal_slicer` | `false` | no | When `true`, the gateway splits large payloads into pieces itself. When `false`, the storage node does. | | `nats.enabled` | `false` | no | Bucket event notifications through a NATS server. | | `nats.endpoint` | `nats://localhost:4222` (unused while NATS is off) | no | NATS endpoint. | | `nats.timeout` | `30s` (unused while NATS is off) | no | Timeout for sending one notification. | | `nats.cert_file`, `nats.key_file`, `nats.root_ca` | Placeholders (unused while NATS is off) | no | Client certificate, client key and root CA for the NATS connection. | | `neofs.set_copies_number` | `0` | no | Present in the template. Gateway 0.48.1 does not read this key. | ## Settings the gateway supports beyond the generated file These keys are supported by upstream `neofs-s3-gw` and are documented here for reference only; Morph does not set them and does not support adding them manually. | Key | Type | Default | Reload | Meaning | |---|---|---|---|---| | `server[n]` | list | one listener | no | Further listeners, each with `address` and `tls`. | | `peers_from_netmap` | bool | `false` | no | Take storage node addresses from the network map on the FS chain; the `peers` list is then not used. The gateway switches to a new connection pool when the network map changes. | | `placement_policy.region_mapping` | string | | yes | Path of a JSON file that maps `LocationConstraint` values to storage policies. | | `placement_policy.locations` | map | | yes | The same mapping inside the configuration file. Entries override the file of `region_mapping`. | | `logger.encoding` | string | `console` | no | `console` or `json`. | | `logger.timestamp` | bool | `false` | no | Timestamps in log lines. Without the setting, timestamps appear only when the output is a terminal. | | `logger.sampling.enabled` | bool | `false` | no | Log sampling. | | `neofs.metadata_policy` | string | | no | Experimental. `strict`, `optimistic` or unset. | Gateway defaults for keys that Morph sets, where they differ from Morph's values: | Key | Gateway default | Morph | |---|---|---| | `logger.level` | `debug` | `info` | | `stream_timeout` | `10s` | `10111s` | | `server[0].address` | `0.0.0.0:8080` | `:9080` | | `prometheus.enabled`, `pprof.enabled` | `false` | `true` | | `placement_policy.contract_name` | empty (contract lookup off) | `storagepolicy` | | `placement_policy.default` | `REP 3` | `REP 1` on a network with one inner ring node, otherwise `REP 3` | Command-line flags of `neofs-s3-gw` exist for a subset of the settings (`--config`, `--wallet`, `--address`, `--listen_address`, `--tls.cert_file`, `--tls.key_file`, `--peers`, `--fschain.endpoints`, `--listen_domains`, `--max_clients_count`, `--max_clients_deadline`, `--connect_timeout`, `--healthcheck_timeout`, `--rebalance_interval`, `--pprof`, `--metrics`). Morph starts the gateway with `--config` only. ## Related pages - [S3 compatibility](../s3-compatibility.md) - [Environment variables](environment-variables.md) - [Ports and protocols](../ports-and-protocols.md) - [Enable TLS](../../how-to/deploy/enable-tls.md) - [How S3 maps onto Morph](../../explanation/s3-on-morph.md) --- # Console settings :::warning Morph manages this configuration file. Manual changes to the file are not supported. Use the [installer configuration](installer.md), Morph [environment variables](environment-variables.md) or the [REST API](../rest-api/index.md) for supported settings. Upgrades and automatic migrations can change or overwrite this file arbitrarily and break local edits. This page is provided for reference only; change these settings only on advice from Morph support, at your own risk. ::: The console is the `morph` process. It serves the REST API and the web interface and runs in every type of Morph node. The installer writes its configuration file once, when the installation completes, and Morph manages it afterwards. This page documents the file for reference only. | Fact | Value | |---|---| | File | the path in `MORPH_PATH_CONFIG_YAML`; in the image `/morph/local_state/config/config.yaml` | | File mode | `0640` | | Format | YAML | | Written by | the installer, once | | Read by | `morph --config `, started by `morphentry` | | Unknown keys | rejected; the console does not start with a key it does not know | | Environment variables | none; the console reads its settings from the file only | A *duration* is a number with a unit, for example `500ms`, `5s`, `60s`, `100h`. ## Keys "Default" is the value the console uses when the key is absent. "Generated" is the value the installer writes. ### `configVersion` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `configVersion` | string | none; a file without the key counts as version 0.24.0 | version of the installer | Version of the configuration format. `morphentry` uses it to decide which [migrations](#migrations) to apply. | ### `api` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `api.listenAddress` | string | `:9100` | `:9100` | Address the REST API and the web interface listen on. | | `api.namespace` | string | empty | absent; on a gateway-type node installed with a namespace, that namespace | Binds this console to one namespace. With a namespace set, the console uses it for every request, rejects the `X-Morph-Namespace` header from clients, and turns the namespace management operations off. | ### `logger` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `logger.level` | string | none; required. The console does not start without it | `info` | Log level. One of `debug`, `info`, `warn`, `error`, `dpanic`, `panic`, `fatal`. | | `logger.sampling.enabled` | boolean | `false` | `false` | Log sampling. When on, repeated log lines within a short time are dropped. | The console writes its log as JSON lines with ISO 8601 timestamps. See [Read logs](../../how-to/observe/read-logs.md). ### `neofs` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `neofs.endpoints` | list of strings | none; required | `grpc://localhost:8080`. `grpc://127.0.0.1:8084` when the storage node's public listener uses TLS. On a gateway-type node, the storage node addresses given to the installer. | Storage node API endpoints the console sends object and bucket requests to. The console does not start with an empty list. | | `neofs.operationTimeout` | duration | none | `5s` | Default time limit of one API operation of the console. Object uploads use their own limit: 120 seconds, or longer for large bodies. | | `neofs.sessionTTL` | duration | `100h` | `100h` | How long a session stays valid. | | `neofs.sidechain.endpoints` | list of strings | none | cluster-type node: `http://localhost:30333`. Other types: the chain addresses given to the installer, as HTTP URLs. | RPC endpoints of the FS chain. | | `neofs.sidechain.contracts.wallet` | string | none | the path in `MORPH_PATH_GATEWAY_WALLET`; in the image `/morph/local_state/config/wallet-gateway.json` | Wallet with the account the console signs its chain transactions with. | | `neofs.sidechain.contracts.address` | string | none | address of the gateway wallet's account | Account in that wallet. The console does not start when the wallet has no such account. | | `neofs.sidechain.contracts.password` | string | none | the value of `MORPH_GATEWAY_WALLET_PASS` | Password of the account. | | `neofs.estimationGetTimeout` | duration | `1m` | `60s` | Interval at which the console refreshes its figures for used space. | | `neofs.epochDuration` | integer | `3600` | `3600` | Epoch duration, in seconds, that the console writes to the network settings. Applied only by a console that has the alphabet wallet. | ### `alphabet` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `alphabet.wallet_path` | string | empty | cluster-type node: the path in `MORPH_PATH_AZ_WALLET`; in the image `/morph/local_state/config/az.json`. Other types: empty. | Wallet of the inner ring node. The console needs it for cluster administration: network settings, GAS for storage nodes, and decommissioning. | | `alphabet.wallet_password` | string | empty | cluster-type node: the value of `MORPH_IR_WALLET_PASS` | Password of that wallet. | A console without the alphabet wallet answers decommissioning requests with status `501`. ### `pprof` and `prometheus` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `pprof.enabled` | boolean | `false` | `true` | Go profiler. | | `pprof.address` | string | none | `localhost:8999` | Profiler listener. | | `prometheus.enabled` | boolean | `false` | `true` | Serves the console's metrics. | | `prometheus.address` | string | none | `localhost:8989` | Metrics listener. `morphentry` scrapes the console at `http://localhost:8989`; this address is fixed in `morphentry`, so another value here removes the console's metrics from the collector output. | ### `s3` | Key | Type | Default | Generated | Meaning | |---|---|---|---|---| | `s3.accessBoxContainerPolicy` | string | none | `REP 1` when the inner ring has one node, otherwise `REP 3` | Storage policy of the bucket (NeoFS container) in which the console stores S3 credentials. | | `s3.accessBoxContainerName` | string | none | `access-box-storage` | Name of that bucket. The console creates it at start if it does not exist. | | `s3.gatePublicKeys` | list of strings | none | cluster-type node: the gateway keys of all nodes that took part in the installation. Other types: this node's gateway key. | Public keys of the S3 gateways, hex-encoded. S3 credentials are encrypted for these keys. | ## Migrations Before `morphentry` starts the console, it compares `configVersion` with the migrations it knows and applies the newer ones. A migration keeps the other keys, their order and the comments, sets `configVersion`, and saves the previous file as `config.yaml.pre--migration`. | Migration | Change | |---|---| | 0.25.0 | `neofs.sessionTTL` given as a plain number (epochs) gets the unit `h`: `100` becomes `100h`. | | 0.29.0 | `neofs.endpoint` becomes the list `neofs.endpoints`, and `neofs.sidechain.endpoint` becomes the list `neofs.sidechain.endpoints`. An existing list wins and the single key is removed. | | 0.30.1 | Removes the top-level `license` section. The console of 0.30.1 does not know the key. | ## File lifecycle Morph manages `config.yaml`, and manual edits are not supported. The installer does not run again once the installation is complete, so `morphentry` reuses the file from `/morph/local_state` across restarts and upgrades, applying any pending migrations before starting `morph`. Future upgrades can modify or overwrite the file arbitrarily. The repository of the console contains two sample files, `config/config.yaml` and `config/config.aio.yaml`. They are for running the console outside the Morph container during development and are not part of the image. ## Related pages - [Environment variables](environment-variables.md): the `MORPH_*` variables named on this page. - [REST API](../rest-api/index.md): the API this process serves. - [Storage node settings](storage-node.md), [S3 gateway settings](s3-gateway.md). - [Use namespaces](../../how-to/buckets-and-objects/use-namespaces.md). --- # Storage policy language A storage policy selects the storage nodes of a bucket and sets the redundancy of its objects. It has two equivalent forms: - **Policy text**, the notation used by `neofs-cli`, by the **Netmap QL** tab of the web console and in this documentation. - **JSON**, the form of the `policy` field in the Morph REST API. Initial placement exists only in the JSON form. ## Grammar ```text policy : rule+ [cbf] select* filter* ; rule : rep | ec ; rep : 'REP' count ['IN' selectorName] ; ec : 'EC' dataParts '/' parityParts ['IN' selectorName] ; cbf : 'CBF' factor ; select : 'SELECT' count ['IN' [clause] attribute] 'FROM' (filterName | '*') ['AS' selectorName] ; clause : 'SAME' | 'DISTINCT' ; filter : 'FILTER' filterExpr 'AS' filterName ; filterExpr : filterExpr 'AND' filterExpr | filterExpr 'OR' filterExpr | '(' filterExpr ')' | '@' filterName | key op value ; op : 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' ; ``` Lexical rules: | Element | Rule | |---|---| | Keywords | Upper case: `REP`, `EC`, `IN`, `AS`, `CBF`, `SELECT`, `FROM`, `FILTER`, `SAME`, `DISTINCT`, `AND`, `OR`, `EQ`, `NE`, `GT`, `GE`, `LT`, `LE`. | | Statement order | All rules, then `CBF`, then all `SELECT` statements, then all `FILTER` statements. | | Identifier | Letters, digits and `_`; does not start with a digit. Used for selector names, filter names and the attribute after `IN`. | | `count`, `dataParts`, `parityParts`, `factor` | A positive integer without a leading zero. | | `key` | An identifier or a quoted string. | | `value` | An identifier, a number or a quoted string. | | Quoted string | Single or double quotes. The text between the quotes is taken as written; escape sequences are not decoded. Needed for keys and values with other characters, for example `"UN-LOCODE"`. | | `AND`, `OR` | `AND` binds tighter than `OR`. Parentheses group. | | White space | Spaces, tabs and line breaks separate tokens. | ## Clauses | Clause | Meaning | |---|---| | `REP n` | Keep `n` replicas of every object on nodes of the rule's candidate set. | | `EC d/p` | Split every object piece into `d` data parts and add `p` parity parts. Each part goes to a different node of the rule's candidate set. | | `IN selectorName` (on a rule) | Take the candidate set from this selector. Without it, see [Rules without a selector](#rules-without-a-selector). | | `CBF f` | The placement factor. It multiplies the number of candidate nodes. Default 3. | | `SELECT n FROM filter` | Choose `n` nodes from the nodes that pass the filter. `*` means all nodes of the network map. | | `SELECT n IN DISTINCT attr FROM filter` | Choose `n` groups of nodes, where a group is all nodes with the same value of `attr`. `DISTINCT` is the default when `IN attr` has no clause. | | `SELECT n IN SAME attr FROM filter` | Choose one group of nodes with the same value of `attr`, and `n` nodes inside it. | | `AS name` | Names the selector or the filter. A filter must have a name. | | `FILTER expr AS name` | Defines a named condition on node attributes. | A policy has `REP` rules or `EC` rules, not both. The inner ring rejects a bucket whose policy mixes them. ## Filter operators | Operator | Matches when | Notes | |---|---|---| | `EQ` | The attribute value equals the filter value as a string. | A node without the attribute has the value `""`. | | `NE` | The attribute value differs from the filter value. | A node without the attribute matches. | | `GT`, `GE`, `LT`, `LE` | The attribute value, read as an unsigned decimal integer, compares to the filter value. | The filter value must be an unsigned decimal integer. A node whose attribute is missing or not a number does not match. `Price` and `Capacity` are the exception: a missing or non-numeric value is read as 0. | | `AND` | All sub-expressions match. | | | `OR` | At least one sub-expression matches. | | | `@name` | The named filter matches. | The named filter must be defined before it is referenced. | The filter name `*` is reserved for "all nodes" and cannot be defined. ## JSON form The REST API takes a policy as the `policy` object of `POST /api/v1/users/{user}/storage-policies`, `POST /api/v1/cluster/storage-policies` and the matching `PUT` requests. `GET /api/v1/buckets/{bucket}` returns the policy of a bucket in the same form as `placementPolicy`. | JSON field | Type | Policy text | Notes | |---|---|---|---| | `replicas` | array | `REP` rules | Required. Send `[]` for an erasure-coded policy. | | `replicas[].count` | integer | `n` in `REP n` | At most 8. Policy text requires at least 1. | | `replicas[].selector` | string | `IN selectorName` | `""` for a rule without a selector. | | `ecRules` | array | `EC` rules | Optional. At most 4. | | `ecRules[].dataParts` | integer | `d` in `EC d/p` | At least 1. | | `ecRules[].parityParts` | integer | `p` in `EC d/p` | At least 1. `d + p` is at most 64. | | `ecRules[].selector` | string | `IN selectorName` | Optional. | | `placementFactor` | integer | `CBF f` | Required. `0` means the default, 3. | | `selectors` | array | `SELECT` statements | Required, may be `[]`. | | `selectors[].name` | string | `AS name` | | | `selectors[].count` | integer | `n` in `SELECT n` | | | `selectors[].clause` | string | `SAME` or `DISTINCT` | Optional. Default `DISTINCT`. | | `selectors[].attribute` | string | The attribute after `IN` | `""` selects single nodes. | | `selectors[].filter` | string | The name after `FROM` | `*` for all nodes. | | `filters` | array | `FILTER` statements | Required, may be `[]`. | | `filters[].name` | string | `AS name` | At the top level: the name of the filter. Inside `filters[].filters`: `""` for an inline sub-expression, or the name of an earlier filter to reference it (`@name`). A reference carries `"op": "EQ"` with empty `key` and `value`; its operator is not evaluated. | | `filters[].key` | string | `key` | Must be `""` when `op` is `AND` or `OR`. | | `filters[].op` | string | Operator | `EQ`, `NE`, `GT`, `GE`, `LT`, `LE`, `AND`, `OR`. | | `filters[].value` | string | `value` | Must be `""` when `op` is `AND` or `OR`. For `GT`, `GE`, `LT`, `LE` it must be a decimal integer. | | `filters[].filters` | array | Sub-expressions of `AND` and `OR` | Must be empty for the other operators. | | `initialPlacement` | object | None | Optional. See [Initial placement](#initial-placement). | A stored policy also carries three settings that are not part of the policy language: | Field (next to `policy`) | Meaning | |---|---| | `name` | Policy name, at most 42 bytes. | | `consistency` | Metadata consistency of buckets created with this policy: `strict`, `optimistic`, or absent. Marked experimental in the API specification. | | `default` | System policies only. Marks the policy as the default system policy. | The API rejects JSON with unknown fields. ### Initial placement `initialPlacement` relaxes the condition under which an upload is acknowledged. The full policy still applies; the storage nodes complete it in the background. | Field | Type | Meaning | |---|---|---| | `replicaLimits` | array of integers | One element per rule, in rule order. For a `REP` rule: the number of replicas to store before the upload is acknowledged, at most the rule's `count`. For an `EC` rule: `1` to apply the rule during the upload, `0` to leave it to the background. | | `maxReplicas` | integer | The total number of replicas and applied EC rules, over all rules, to store before the upload is acknowledged. `0` means no total limit; `replicaLimits` then decides alone. | | `preferLocal` | boolean | Start with the rules whose candidate set contains the node that handles the upload. Requires `maxReplicas` above 0. | Validation rules: - At least one of `replicaLimits` and `maxReplicas` is set. - `replicaLimits` has exactly one element per rule and is not all zeros. - `replicaLimits` without `maxReplicas` must differ from the full policy. - `maxReplicas` is at most the sum of `replicaLimits`, or, without `replicaLimits`, the sum of all `REP` counts plus the number of `EC` rules. - The inner ring rejects a bucket that combines initial placement with a metadata consistency setting. ## Selection algorithm Placement has two stages. The first is computed once per bucket and network map, the second once per object. Both are pure functions of the policy, the network map, the bucket ID and the object ID. Every node computes the same result, and no index of object locations is stored. ### Stage 1: candidate sets of the bucket Let `f` be the placement factor (3 if not set). For each `SELECT n [IN clause attr] FROM filter`: 1. Take the nodes of the network map that pass the filter. 2. Group them. Without `IN attr`, every node is its own group. With `IN attr`, a group is all nodes with the same value of `attr`. Nodes without the attribute form one group with the value `""`. 3. Set the number of groups to choose, `g`, and the number of nodes needed in each group, `k`: `g = n, k = 1` for `DISTINCT` and without `IN`; `g = 1, k = n` for `SAME`. 4. If fewer than `g` groups exist, the selection fails with `not enough nodes to SELECT from`. 5. Sort the nodes inside each group by rendezvous hashing (HRW) with the bucket ID as the seed. 6. Groups with at least `k × f` nodes are *full* and contribute their first `k × f` nodes. Groups with at least `k` but fewer than `k × f` nodes are *short* and contribute all their nodes. Groups with fewer than `k` nodes are dropped. 7. If at least `g` full groups exist, only full groups are used. Otherwise the short groups are added. If the total is still below `g`, the selection fails with `not enough nodes to SELECT from`. 8. Sort the groups by weighted HRW with the bucket ID as the seed and keep the first `g`. 9. Without `IN attr` only: the nodes of the groups that were not kept are added, one by one, to the kept groups until each has `f` nodes. The result of a selector is at most `n × f` nodes. With fewer matching nodes the selector returns what exists, down to a minimum of `n` nodes (`g` groups of `k`). The candidate set of a rule is the list of all nodes of its selector, with the groups flattened into one list. ### Rules without a selector | Policy | Candidate set of the rule | |---|---| | No `SELECT` statements at all | As if `SELECT n FROM *` were written, with `n` the `REP` count or `d + p`. | | `SELECT` statements exist, the rule names none | The nodes of all selectors, concatenated. | ### Stage 2: nodes of one object For each rule, the candidate set is sorted by weighted HRW with the object ID as the seed. - `REP n`: the first `n` nodes of the sorted list hold the replicas. The remaining nodes are reserves. - `EC d/p`: the first `d + p` nodes of the sorted list hold the parts. The remaining nodes are reserves. The weight of a node in HRW is its `Capacity` divided by its `Price`, each taken as at least 1. Without a `Price` attribute the weight is the capacity. The per-object sort works on the flattened candidate set. It does not know the groups of stage 1. Therefore: - With a placement factor of 1, the candidate set has exactly the selected nodes. When the selector selects as many nodes as the rule stores, every object uses all of them and the grouping of the selector holds for every object. When it selects more, the rest are reserves, as with a higher factor. - With a placement factor above 1, the first `n` nodes of an object can come from fewer than `n` groups. `SELECT n IN DISTINCT attr` then does not guarantee `n` distinct values of `attr` per object. To guarantee distinct failure domains with reserves, write one rule per domain. See [Worked examples](#worked-examples). ## Node attributes Filters and the `IN` clause work on the attributes that each storage node announces in the network map. `GET /api/v1/cluster/storage-nodes` lists the nodes with their attributes. | Attribute | Set by | Value | |---|---|---| | Any key | The operator, as `key:value` strings in `sn_attributes` of the installer's `start-node` request, or in `attributes` of the `new-sn` request | Free text. Use it for sites, rooms, racks, hardware classes. | | `Capacity` | The storage node, at start | Total size of the file systems that hold the shards, in GiB, as an integer. | | `Version` | The storage node, at start | Version of the storage node software. | | `Price` | The operator, optional | An unsigned integer. Read as 0 when absent. | | `UN-LOCODE` | The operator | A UN/LOCODE location code. | | `CountryCode`, `Country`, `Location`, `Continent`, `SubDivCode`, `SubDiv` | The storage node, derived from `UN-LOCODE` | Filled only when `UN-LOCODE` is set. A value set by the operator is kept. | Morph defines no attribute names of its own. A policy can only refer to attributes that the operator has set consistently on all nodes. See [Deploy across sites](../how-to/deploy/deploy-across-sites.md). ## Validation limits The console validates a policy when it is saved and again when a bucket is created. | Limit | Value | |---|---| | `REP` rules per policy | 256 | | Replicas per `REP` rule | 8 | | `EC` rules per policy | 4 | | Data parts plus parity parts per `EC` rule | 64 | | Data parts, parity parts | At least 1 each | | Candidate nodes per rule: placement factor × (selector count, or rule count without a named selector) | 64 | | Candidate nodes of all rules together | 512 | | `REP` and `EC` rules in one policy | Not allowed | | Policy name | 42 bytes, no zero byte | | Default placement factor | 3 | The limit of 64 candidate nodes per rule bounds erasure coding together with the placement factor: `(d + p) × f ≤ 64`. With the default factor of 3, `d + p` is at most 21. Saving a policy does not check it against the network map. Creating a bucket does: when the nodes of the current network map cannot satisfy the policy, the request fails with status `409` and the text `Inapplicable policy.` A bucket keeps its policy for life. If the network map later cannot satisfy it, for example because the nodes named by a filter have left the network map, every operation on the bucket fails with `not enough nodes to SELECT from`. Reads fail as well. ## System policies A new cluster has two system policies. Both select from all nodes. | Name | Equivalent policy text | Default when | |---|---|---| | `REP-1` | `REP 1 CBF 3` | The committee has fewer than 3 members. | | `REP-3` | `REP 3 CBF 3` | The committee has 3 or more members. | ## Worked examples The examples use a network map of six nodes. Each node has the operator-defined attributes `site` and `rack`: | Node | `site` | `rack` | |---|---|---| | N1 | `a` | `a1` | | N2 | `a` | `a1` | | N3 | `a` | `a2` | | N4 | `b` | `b1` | | N5 | `b` | `b1` | | N6 | `b` | `b2` | ### Three replicas anywhere ```text REP 3 ``` ```json { "replicas": [{ "count": 3, "selector": "" }], "placementFactor": 3, "selectors": [], "filters": [] } ``` Candidate set: up to 3 × 3 = 9 nodes; the network map has six, so all six. Each object is on the 3 nodes that rank first for its ID. The other three are reserves. The three replicas of an object can all be in one site. ### Two fixed nodes ```text REP 2 CBF 1 ``` Candidate set: 2 × 1 = 2 nodes, chosen by HRW on the bucket ID. Every object of the bucket is on these two nodes. There are no reserves: while one of the two nodes is down, uploads to this bucket fail. ### Erasure coding 4 + 2 ```text EC 4/2 CBF 1 ``` ```json { "replicas": [], "ecRules": [{ "dataParts": 4, "parityParts": 2 }], "placementFactor": 1, "selectors": [], "filters": [] } ``` Candidate set: (4 + 2) × 1 = 6 nodes, all six. Every object piece has one part on each node. There are no reserves, and an upload needs all six nodes. With `CBF 2` the candidate set would be up to 12 nodes; on this network map it is still the six that exist. ### One replica in each site, guaranteed, without reserves ```text REP 2 IN X CBF 1 SELECT 2 IN DISTINCT site FROM * AS X ``` ```json { "replicas": [{ "count": 2, "selector": "X" }], "placementFactor": 1, "selectors": [ { "name": "X", "count": 2, "clause": "DISTINCT", "attribute": "site", "filter": "*" } ], "filters": [] } ``` Stage 1: two groups, `site=a` and `site=b`. Each contributes 1 × 1 = 1 node, chosen by HRW on the bucket ID. Candidate set: two nodes, one per site. Every object has one replica in each site. The two nodes are fixed for the bucket. ### The same selector with placement factor 2: not guaranteed ```text REP 2 IN X CBF 2 SELECT 2 IN DISTINCT site FROM * AS X ``` Stage 1: each site is a full group and contributes 1 × 2 = 2 nodes. Candidate set: four nodes, two per site, in one list. Stage 2: an object is on the first two of these four by HRW on its ID. For some objects both are in the same site. ### One replica in each site, guaranteed, with reserves ```text REP 1 IN A REP 1 IN B CBF 2 SELECT 1 FROM FA AS A SELECT 1 FROM FB AS B FILTER site EQ a AS FA FILTER site EQ b AS FB ``` ```json { "replicas": [ { "count": 1, "selector": "A" }, { "count": 1, "selector": "B" } ], "placementFactor": 2, "selectors": [ { "name": "A", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FA" }, { "name": "B", "count": 1, "clause": "DISTINCT", "attribute": "", "filter": "FB" } ], "filters": [ { "name": "FA", "key": "site", "op": "EQ", "value": "a", "filters": [] }, { "name": "FB", "key": "site", "op": "EQ", "value": "b", "filters": [] } ] } ``` Stage 1: rule 1 has a candidate set of 1 × 2 = 2 nodes of site `a`, rule 2 has two nodes of site `b`. Stage 2: each object has one replica on the first-ranked node of each set; the second node of each set is the reserve in the same site. If all nodes of site `b` leave the network map, filter `FB` matches no node, selector `B` fails, and every operation on the bucket fails until the site is back. ### All replicas inside one named site ```text REP 3 IN X SELECT 3 FROM F AS X FILTER site EQ a AS F ``` Candidate set: up to 3 × 3 = 9 nodes of site `a`; the site has three, so N1, N2, N3. Every object has a replica on each of them. No data of the bucket is stored in site `b`. The policy needs three nodes of site `a` in the network map. ### All replicas inside one site, whichever ```text REP 3 IN X SELECT 3 IN SAME site FROM * AS X ``` Stage 1: one group is needed, with at least 3 nodes. Both sites qualify as short groups. HRW on the bucket ID picks one. Candidate set: the three nodes of that site. Different buckets with this policy can land in different sites. ### Two racks, combined filter ```text REP 2 IN X CBF 1 SELECT 2 IN DISTINCT rack FROM F AS X FILTER site EQ a AND Capacity GE 1000 AS F ``` ```json { "replicas": [{ "count": 2, "selector": "X" }], "placementFactor": 1, "selectors": [ { "name": "X", "count": 2, "clause": "DISTINCT", "attribute": "rack", "filter": "F" } ], "filters": [ { "name": "F", "key": "", "op": "AND", "value": "", "filters": [ { "name": "", "key": "site", "op": "EQ", "value": "a", "filters": [] }, { "name": "", "key": "Capacity", "op": "GE", "value": "1000", "filters": [] } ] } ] } ``` Stage 1: of the nodes in site `a` with at least 1000 GiB, the groups are `rack=a1` and `rack=a2`. Each contributes one node. Candidate set: one node of rack `a1` and N3, if all three nodes are large enough. Every object has one replica in each rack. ## Related - [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md) - [Data placement](../explanation/data-placement.md) - [Erasure coding](../explanation/erasure-coding.md) - [Failure domains and self-healing](../explanation/failure-domains-and-self-healing.md) - [Limits](limits.md) --- # Ports and protocols All ports are TCP. The ports are those inside the Morph container. Which of them a node opens depends on its installation type: a cluster-type node runs all processes, a storage-type node runs no inner ring, a gateway-type node runs neither an inner ring nor a storage node. ## Ports that other machines connect to | Port | Process | Protocol | Node types | Who connects | Reachable from | |---|---|---|---|---|---| | 9100 | `installer` until the node is installed, then the console (`morph`) | HTTP: REST API under `/api`, web UI, API description at `/api/docs` | all | Users and applications. During installation, the installers of the other inner ring nodes. | Clients. Other inner ring nodes during installation. | | 9080 | S3 gateway (`neofs-s3-gw`) | HTTP: S3 API | all | S3 clients | Clients | | 8080 | Storage node (`neofs-node`) | gRPC: NeoFS API. Plaintext, or TLS when the node announces `grpcs://` addresses. | cluster, storage | Other storage nodes. The console and the S3 gateway of gateway-type nodes, which need the plaintext mode. The console and the S3 gateway of the same node when TLS is off. | Other nodes | | 20333 | Inner ring (`neofs-ir`) | FS chain consensus P2P | cluster | The other inner ring nodes | Other inner ring nodes | | 30333 | Inner ring (`neofs-ir`) | FS chain RPC: JSON-RPC over HTTP, WebSocket at `/ws` | cluster | The storage node, the console and the S3 gateway of the same node. The same three processes of every storage-type node and the console and S3 gateway of every gateway-type node that were given this node as chain endpoint. | Other nodes | | 20334 | Inner ring (`neofs-ir`) | Metadata chain P2P | cluster | Inner ring nodes and storage nodes. They take the seed addresses of the FS chain and replace the port with 20334. | Other nodes | | 21334 | Storage node (`neofs-node`) | Metadata chain P2P | cluster, storage | Peers of the metadata chain | Other nodes | | 5100 | Entrypoint (`morphentry`) | HTTP: Prometheus metrics of all processes at `/metrics` | all | The monitoring system. The entrypoint's own health probes. | Monitoring | The storage node gRPC API on port 8080 is the protocol between nodes and between gateways and nodes. It is not intended for client applications. Clients use S3 or the REST API. ## Ports for use inside the container | Port | Bind address | Process | Purpose | Node types | |---|---|---|---|---| | 8084 | `127.0.0.1` | Storage node | Plaintext gRPC listener for the console and the S3 gateway of the same node. Exists only when the public listener on 8080 uses TLS. | cluster, storage | | 16513 | `localhost` | Storage node | Control service (gRPC), used by `neofs-cli control` | cluster, storage | | 16512 | all interfaces | Inner ring | Control service (gRPC) | cluster | | 30334 | all interfaces | Inner ring | Metadata chain RPC. No generated configuration of another node refers to it. | cluster | | 8987 | `127.0.0.1` | Entrypoint (`sn-verificator`) | HTTP: `/verify` is called by the inner ring of the same node to validate storage nodes, `/health` by the entrypoint | cluster | | 9090 | `localhost` | Inner ring | Prometheus metrics, scraped by the collector on 5100 | cluster | | 6664 | `localhost` | Storage node | Prometheus metrics, scraped by the collector on 5100 | cluster, storage | | 8086 | `localhost` | S3 gateway | Prometheus metrics, scraped by the collector on 5100 | all | | 8989 | `localhost` | Console | Prometheus metrics, scraped by the collector on 5100 | all | | 8085 | `localhost` | S3 gateway | pprof profiler | all | | 8999 | `localhost` | Console | pprof profiler | all | The inner ring control service on 16512 and the metadata chain RPC on 30334 bind to all interfaces of the container. They stay private as long as you do not publish them with `docker run -p`. The profilers of the inner ring (`:6060`) and of the storage node (`localhost:6663`) are disabled in the generated configuration. ## Transport security | Listener | TLS | |---|---| | Storage node gRPC, 8080 | Optional. Enabled when the node is installed with `grpcs://` addresses. See [Enable TLS](../how-to/deploy/enable-tls.md). | | S3, 9080 | None. The installer writes the listener with TLS disabled. | | Console, 9100 | None. The console configuration has no TLS setting. | | FS chain RPC, 30333 | None in the generated configuration. | | Installer to installer, 9100 | None. The installers call each other over `http://`. | To serve S3 and the console over HTTPS, terminate TLS on a [load balancer](../how-to/deploy/put-a-load-balancer-in-front.md). ## Changing ports The listen addresses are written into the generated configuration files and are the same on every node. The supported way to use other port numbers is Docker port publishing: publish the container port on another host port, and give the other nodes the host port. | Container port | Where you announce the published port | |---|---| | 9100 | `installers_addresses` of `POST /api/v1/start-node` on every inner ring node | | 8080 | `sn_addresses` of `start-node`, or `addresses` of `POST /api/v1/new-sn`. A gateway-type node has no storage node; it is given the storage nodes to use in `grpc_addresses` of `POST /api/v1/new-gateway` | | 20333 | `ir_port` of `start-node` | | 30333 | `side_chain_ws_addresses` of `new-sn`, `rpc_addresses` of `POST /api/v1/new-gateway` | | 9080, 5100 | Nowhere inside Morph. Tell your clients, load balancer and monitoring system. | The metadata chain ports are derived and cannot be announced: peers dial the hosts of the FS chain seed list on port 20334, and a storage node announces port 21334 to its peers. Both are reachable only when they are published under the same numbers. One port can be moved inside the container: the metrics collector listens on the port in `MORPH_PORT_PROMETHEUS_COLLECTOR`. The other `MORPH_PORT_*` variables do not move a listener. See [environment variables](configuration/environment-variables.md). --- # Installer API The installer is the program that runs in a Morph container that has not been installed yet. It serves a web interface and the HTTP API on this page, waits for one request that tells it which type of node to become, writes the configuration files, and exits. The installer's web interface uses the same API. | Fact | Value | |---|---| | Listener | port `9100`, all interfaces, HTTP without TLS. The port is fixed in the installer. | | Base path | `/api` | | Authentication | none; no route takes credentials | | Available | only while the node is not installed: from the first start of the container until the installer stops serving HTTP. It stops right after it accepts `new-sn` or `new-gateway`, and after the exchange between the installers that follows `start-node`. | | After installation | The installer does not run again. Port `9100` is then served by the console, whose [REST API](rest-api/index.md) does not contain these routes. | | Specification | The routes are not part of the console's OpenAPI specification. | A node counts as installed when the file named by `MORPH_PATH_INSTALLATION_COMPLETED` exists (in the image `/morph/local_state/config/installation.txt`). The installer writes it last. It contains the installation type: `cluster`, `storage` or `gateway`. ## Routes | Method | Path | Purpose | Caller | |---|---|---|---| | `POST` | [`/api/v1/start-node`](#start-node) | Install a cluster-type node | operator | | `GET` | [`/api/v1/sn-address`](#sn-address) | Read the storage node's account address | operator | | `POST` | [`/api/v1/new-sn`](#new-sn) | Install a storage-type node | operator | | `GET` | [`/api/v1/gateway-address`](#gateway-address) | Read the gateway's account address and public key | operator | | `POST` | [`/api/v1/new-gateway`](#new-gateway) | Install a gateway-type node | operator | | `GET` | [`/api/v1/node-info`](#node-info) | Read this node's inner ring address and keys | other installers | | `POST` | [`/api/v1/confirmation`](#confirmation) | Confirm that another installer has read this node's information | other installers | | `GET` | `/` | Redirects to `/setup` with status `307` | browser | | `GET` | `/setup` | The installer's web interface | browser | | `GET` | `/assets/*`, `/img/*`, `/locales/*` | Files of the web interface | browser | A request for any other path returns the web interface's page with status `404`. The three `POST` routes for operators decide the installation type. The installer accepts one of them, once. The examples use these environment variables: ```shell export MORPH_URL=http://localhost:9100 # the installer of the node being installed export NODE_HOST=192.0.2.10 # address under which other nodes reach this node export CLUSTER_HOST=192.0.2.1 # a cluster-type node of the existing cluster ``` ## Errors | Status | Body | When | |---|---|---| | `400` | JSON object with one field, `message` | A field failed validation. The message names the reason. | | `409` | text | `start-node` was sent to an installer that already accepted it. | | `417` | empty | `confirmation` for a key the installer does not know yet. | | `500` | JSON object with the field `message` | Any other failure, including a request body that is not valid JSON and a missing chain address list in `new-sn`. | ## POST /api/v1/start-node {#start-node} Installs the node as a cluster-type node: inner ring, storage node, console and S3 gateway. Send the request to the installer of every node that is to form the inner ring, with the same `installers_addresses` list. Request body, JSON: | Field | Type | Required | Meaning | |---|---|---|---| | `sn_attributes` | array of strings | no | Attributes of this node's storage node, each as `key:value`. Storage policies select nodes by them. | | `sn_addresses` | array of strings | yes | Addresses the storage node announces. Each is `host:port`, `grpc://host:port` or `grpcs://host:port`. All must use the same scheme; `grpcs://` turns TLS on for the storage node's public listener. An address without a scheme counts as `grpc://`. | | `external_address` | string | yes | Host name or IP address under which the other nodes reach this node. | | `ir_port` | integer | yes | Port of this node's inner ring peer-to-peer listener as the other nodes reach it. The listener inside the container is `20333`. The installer applies no default. | | `installers_addresses` | array of strings | yes | The installers of all nodes of the inner ring, each as `host:port`, this node included. | | `installer_port` | integer | no | Accepted and not used by the installer. | Responses: | Status | Meaning | |---|---| | `204` | Accepted. The installation continues in the background. | | `400` | `installers_addresses` is empty, or `sn_addresses` is empty, malformed or mixes schemes. | | `409` | The installer already accepted a `start-node` request. | After `204` the installer does the following, retrying each step every second without a time limit: 1. It requests `GET http://
/api/v1/node-info` from every entry of `installers_addresses` until each one returns an inner ring address. An installer returns that address only after it has received its own `start-node` request. 2. It sends `POST http://
/api/v1/confirmation` to every entry until each answers `204`. 3. It waits until every other installer has confirmed in the same way. 4. It stops serving HTTP, writes the wallets and configuration files, and exits. The services of the node then start. The installers talk to each other over HTTP on the addresses in `installers_addresses`. The number of entries is the size of the inner ring, which cannot be changed later. Example for a single node, from the console's README: ```shell curl -X POST "$MORPH_URL/api/v1/start-node" \ -H "Content-Type: application/json;charset=UTF-8" \ -d @- < # Command-line tools :::warning The Morph image does not contain `neofs-cli`. Every guide that uses `neofs-cli control` (maintenance mode, shard modes, evacuation, health check) needs the `neofs-cli` program copied into the Morph container first. See [Tools that are not in the image](#tools-that-are-not-in-the-image). ::: ## Programs in the image The image is built from `alpine` with CA certificates added. Six programs are copied to `/morph/bin` (`MORPH_BIN_PATH`). | Program | Role | Started by | Flags | |---|---|---|---| | `morphentry` | Entry point of the Morph container. Runs the installer on the first start, then starts and supervises the other processes, and serves the metrics collector. The storage node verificator of a cluster-type node runs inside this process. | Docker | none; it is configured through `MORPH_*` environment variables | | `installer` | Serves the [installer API](installer-api.md) and writes wallets and configuration files. | `morphentry`, when the node is not installed | `--config `: the [installer configuration](configuration/installer.md). `--version` | | `morph` | The console: REST API and web interface. | `morphentry`, on every node | `--config `: the [console settings](configuration/console.md). `--version` | | `neofs-node` | The storage node. | `morphentry`, on cluster-type and storage-type nodes | `--config `: the [storage node settings](configuration/storage-node.md). `--check`: validate the configuration and exit. `--version` | | `neofs-ir` | The inner ring. | `morphentry`, on cluster-type nodes | `--config `: the [inner ring settings](configuration/inner-ring.md). `--version` | | `neofs-s3-gw` | The S3 gateway. | `morphentry`, on every node | `--config `: the [S3 gateway settings](configuration/s3-gateway.md). `-v`, `--version` | The versions of the three NeoFS programs are on the [component versions](../releases/component-versions.md) page. Run a program inside the Morph container with `docker exec`. The examples on this page use these environment variables: ```shell export MORPH_CONTAINER=morphcluster # name of the Morph container ``` Print the version of the console: ```shell docker exec "$MORPH_CONTAINER" /morph/bin/morph --version ``` Validate the storage node configuration without starting a node: ```shell docker exec "$MORPH_CONTAINER" /morph/bin/neofs-node --config /morph/local_state/config/config-sn.yaml --check ``` ## Tools that are not in the image | Tool | In the image | What it is | |---|---|---| | `neofs-cli` | no | NeoFS command-line client. Its `control` commands talk to the control service of a storage node or inner ring node. | | `neofs-lancet` | no | NeoFS tool for inspecting a storage node's data files offline. | What this means for operation: - The storage node's control service listens on `localhost:16513`, the loopback interface of the Morph container's network. Publishing port `16513` does not make it reachable from outside the container. `neofs-cli` therefore has to run inside the Morph container. - The programs are published with each NeoFS node release at `https://github.com/nspcc-dev/neofs-node/releases`. Use the release that matches the bundled node version. `neofs-cli` is versioned together with the node. - `neofs-cli` can be brought into the container in this way: copy the program to `/morph/local_state` with `docker cp`, make it executable, and run it with `docker exec`. - `/morph/local_state` is the directory that holds the generated files. A program copied to a path that is not on a volume is gone when the container is created anew, for example at an upgrade. Copy a downloaded `neofs-cli` into the container and make it executable: ```shell docker cp neofs-cli-linux-amd64 "$MORPH_CONTAINER":/morph/local_state/neofs-cli docker exec "$MORPH_CONTAINER" chmod +x /morph/local_state/neofs-cli docker exec "$MORPH_CONTAINER" /morph/local_state/neofs-cli --version ``` ## Generated command-line configuration The installer writes a `neofs-cli` configuration file next to each node configuration. `morphentry` does not use these files; they exist for the operator. | File | Variable | Written on | Content | |---|---|---|---| | `/morph/local_state/config/cli-config-sn.yaml` | `MORPH_PATH_SN_CLI_CONFIG` | cluster-type and storage-type nodes | `wallet`: path of the storage node wallet. `password`: its password. | | `/morph/local_state/config/cli-config-ir.yaml` | `MORPH_PATH_IR_CLI_CONFIG` | cluster-type nodes | `wallet`: path of the inner ring wallet. `password`: its password. | Both files have mode `0640`. Pass one to `neofs-cli` with `-c`. The control services accept requests signed with the key of the node they belong to, so the storage node's file is the one for the storage node's control service and the inner ring's file is the one for the inner ring's. Control endpoints: | Service | Endpoint | Reachable from | |---|---|---| | Storage node control | `localhost:16513` | the loopback interface of the Morph container's network | | Inner ring control | `:16512` | all interfaces of the Morph container | ## neofs-cli control `neofs-cli control` operates on one node through its control service. NeoFS tools call a bucket a container; an object address is `/`. Flags common to all commands below: | Flag | Meaning | |---|---| | `-c`, `--config ` | Configuration file. Default `$HOME/.config/neofs-cli/config.yaml`. | | `--endpoint
` | Address of the control service. | | `-w`, `--wallet ` | Path of the wallet, if not taken from the configuration file. | | `--address
` | Account in the wallet. | | `-t`, `--timeout ` | Timeout of the operation. Default `15s`. | | `-v`, `--verbose` | Verbose output. | The commands on this page have this form: ```shell docker exec "$MORPH_CONTAINER" /morph/local_state/neofs-cli control healthcheck \ -c /morph/local_state/config/cli-config-sn.yaml --endpoint localhost:16513 ``` ### Commands | Command | Purpose | Flags of its own | |---|---|---| | `control healthcheck` | Health check of the node. Checks a storage node unless `--ir` is given. | `--ir`: talk to an inner ring node | | `control set-status` | Sets the status of the storage node in the network map. | `--status `: `online`, `offline` or `maintenance` | | `control shards list` | Lists the shards of the storage node: ID, mode, paths of the index and the object store, and error count. The text output prints the path of the index in its `Write-cache:` line; only the JSON output has the real write-cache path. | `--json`: print as a JSON array | | `control shards set-mode` | Sets the mode of shards. | `--mode `: `read-write`, `read-only` or `degraded-read-only`. `--id `: shard IDs in base58. `--all`: all shards. `--clear-errors`: set the shard's error count to 0 | | `control shards evacuate` | Moves the objects of shards to the other shards of the same node. The shards being evacuated must be in `read-only` mode. | `--id `, `--all`. `--no-errors`: skip objects that are invalid or cannot be read | | `control shards flush-cache` | Writes the objects in the write-cache to the shard's object store. | `--id `, `--all` | | `control object status` | Shows the state of one object on this node. | `--object
` | | `control object revive` | Removes the removal marks of one object from the shards' indexes. | `--object
` | | `control drop-objects` | Removes objects from this node's local storage. Other nodes are not affected. | `-o`, `--objects `: list of object addresses | Further `control` commands exist in `neofs-cli`: `shards dump`, `shards restore`, `object list`, and `notary list`, `notary request`, `notary sign`. Health check of the inner ring of a cluster-type node: ```shell docker exec "$MORPH_CONTAINER" /morph/local_state/neofs-cli control healthcheck --ir \ -c /morph/local_state/config/cli-config-ir.yaml --endpoint localhost:16512 ``` List the shards of the storage node: ```shell docker exec "$MORPH_CONTAINER" /morph/local_state/neofs-cli control shards list \ -c /morph/local_state/config/cli-config-sn.yaml --endpoint localhost:16513 ``` ### Exit codes | Code | Meaning | |---|---| | `0` | Success. | | `1` | Internal error or unspecified failure. | | `2` | Object access denied. | | `3` | A wait for a condition timed out. | | `4` | Object already removed. | | `5` | Incomplete success. | | `6` | Busy; the command can be repeated later. | ## Related pages - [Use maintenance mode](../how-to/operate/use-maintenance-mode.md), [Replace a failed drive](../how-to/operate/replace-a-failed-drive.md), [Check cluster health](../how-to/observe/check-cluster-health.md): the procedures that use these commands. - [Storage node settings](configuration/storage-node.md): shard modes. - [Environment variables](configuration/environment-variables.md): the `MORPH_*` variables named on this page. --- # Metrics This page lists the Prometheus metrics that the processes inside the Morph container define. To scrape the metrics, see [Collect metrics](../how-to/observe/collect-metrics.md). ## Names on the collector endpoint The Morph entrypoint serves one endpoint, `/metrics` on port 5100 (environment variable `MORPH_PORT_PROMETHEUS_COLLECTOR`). On each request it reads the Prometheus endpoint of every process that the installation type runs and returns the combined result. | Process | Internal endpoint | Name prefixes passed through unchanged | Value of the `process` label on all other metrics | Read timeout | |---|---|---|---|---| | Inner ring | `http://localhost:9090` | `neogo`, `neofs_ir` | `ir` | 1 s | | Storage node | `http://localhost:6664` | `neofs_node` | `neofs` | 1 s | | Console | `http://localhost:8989` | `morph` | `morph` | 1 s | | S3 gateway | `http://localhost:8086` | `neofs_s3` | `s3` | 1 s | - The collector does not rename metrics and adds no prefix. - A metric family whose name starts with one of the prefixes of its process is returned as it is. Every other family of that process gets the label `process` with the value from the table. This applies to the Go runtime and process metrics of each component (`go_*`, `process_*`, `promhttp_*`). - A process that does not answer within the read timeout is left out of that response. The response still has status 200. - A histogram appears as three series: `_bucket` (with the label `le`), `_sum` and `_count`. ## Storage node - Histograms whose name ends in `_time` observe seconds. - `neofs_node_engine_capacity` is the total size in bytes of the file system that holds the object data of the shard. The storage node sets it once at start. - `neofs_node_object_readonly` is 1 when the shard is in any mode other than read-write, and 0 in read-write mode. - The `type` label of `neofs_node_object_counter` takes the values `phy`, `root`, `ts`, `lock`, `link` and `gc`. - The labels of `neofs_node_state_policer_object_count` take the values `processed`, `replicated`, `deleted` and `relocated` for `action`, and `replica`, `ec` and `physical` for `mode`. - `neofs_node_state_policer_consistency_state` is set to 0 when the policer starts and whenever it finds an object with too few replicas or a missing part. It returns to 1 when a full pass over the local objects ends without such a finding. ### No subsystem | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_version` | gauge | `version` | | ### `engine` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_engine_capacity` | gauge | `shard` | Contains the shard's capacity | | `neofs_node_engine_container_size` | gauge | `cid` | Accumulated size of all objects in a container | | `neofs_node_engine_delete_time` | histogram | | Engine 'delete' operations handling time | | `neofs_node_engine_drop_time` | histogram | | Engine 'drop' operations handling time | | `neofs_node_engine_estimate_container_size_time` | histogram | | Engine 'container size' operations handling time | | `neofs_node_engine_exists_time` | histogram | | Engine 'exists' operations handling time | | `neofs_node_engine_fstree_reshape_progress` | gauge | `shard` | Percentage of FSTree layout reshape progress; 100 means no reshape is pending or it has completed. | | `neofs_node_engine_get_ec_part__range_time` | histogram | | Engine 'get EC part range' operations handling time | | `neofs_node_engine_get_ec_part_time` | histogram | | Engine 'get EC part' operations handling time | | `neofs_node_engine_get_range_stream_time` | histogram | | Engine 'get range stream' operations handling time | | `neofs_node_engine_get_stream_time` | histogram | | Engine 'get stream' operations handling time | | `neofs_node_engine_get_time` | histogram | | Engine 'get' operations handling time | | `neofs_node_engine_head_ec_part_time` | histogram | | Engine 'head EC part' operations handling time | | `neofs_node_engine_head_time` | histogram | | Engine 'head' operations handling time | | `neofs_node_engine_inhume_time` | histogram | | Engine 'inhume' operations handling time | | `neofs_node_engine_list_containers_time` | histogram | | Engine 'list containers' operations handling time | | `neofs_node_engine_list_objects_time` | histogram | | Engine 'list objects' operations handling time | | `neofs_node_engine_payload_size` | gauge | `shard` | Accumulated size of all objects in a shard | | `neofs_node_engine_put_time` | histogram | | Engine 'put' operations handling time | | `neofs_node_engine_range_time` | histogram | | Engine 'range' operations handling time | | `neofs_node_engine_read_ec_part_header_time` | histogram | | Engine 'read EC part header' operations handling time | | `neofs_node_engine_read_ec_part_range_time` | histogram | | Engine 'read EC part range' operations handling time | | `neofs_node_engine_read_ec_part_time` | histogram | | Engine 'read EC part' operations handling time | | `neofs_node_engine_read_header_time` | histogram | | Engine 'read header' operations handling time | | `neofs_node_engine_read_object_time` | histogram | | Engine 'read object' operations handling time | | `neofs_node_engine_read_payload_range_time` | histogram | | Engine 'read payload range' operations handling time | | `neofs_node_engine_search_time` | histogram | | Engine 'search' operations handling time | | `neofs_node_engine_streaming_put_time` | histogram | | Engine streaming 'put' operations handling time | ### `metadata_chain` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_metadata_chain_new_block_fetch_time` | histogram | | Time to receive new block after the previous one, seconds | | `neofs_node_metadata_chain_obj_accept_blocks` | histogram | | Number of blocks b/w object is sent to chain and transaction with it is received, blocks | | `neofs_node_metadata_chain_obj_accept_time` | histogram | | Time b/w object is sent to chain and transaction with it is received, seconds | ### `object` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_object_counter` | gauge | `shard`, `type` | Objects counters per shards | | `neofs_node_object_delete_req_count` | counter | | Total number of delete requests processed | | `neofs_node_object_delete_req_count_success` | counter | | The number of successful delete requests processed | | `neofs_node_object_get_payload` | counter | | Accumulated payload size at object get method | | `neofs_node_object_get_req_count` | counter | | Total number of get requests processed | | `neofs_node_object_get_req_count_success` | counter | | The number of successful get requests processed | | `neofs_node_object_head_req_count` | counter | | Total number of head requests processed | | `neofs_node_object_head_req_count_success` | counter | | The number of successful head requests processed | | `neofs_node_object_put_payload` | counter | | Accumulated payload size at object put method | | `neofs_node_object_put_req_count` | counter | | Total number of put requests processed | | `neofs_node_object_put_req_count_success` | counter | | The number of successful put requests processed | | `neofs_node_object_readonly` | gauge | `shard` | Shard state | | `neofs_node_object_rpc_delete_time` | histogram | | RPC 'delete' request handling time | | `neofs_node_object_rpc_get_time` | histogram | | RPC 'get' request handling time | | `neofs_node_object_rpc_head_time` | histogram | | RPC 'head' request handling time | | `neofs_node_object_rpc_put_time` | histogram | | RPC 'put' request handling time | | `neofs_node_object_rpc_search_time` | histogram | | RPC 'search' request handling time | | `neofs_node_object_search_req_count` | counter | | Total number of search requests processed | | `neofs_node_object_search_req_count_success` | counter | | The number of successful search requests processed | ### `state` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_state_epoch` | gauge | | Current epoch as seen by NeoFS node. | | `neofs_node_state_health` | gauge | | Current Node state | | `neofs_node_state_policer_consistency_state` | gauge | | Current Policer's consistency state. 0 for inconsistent/unknown state; 1 for synchronized | | `neofs_node_state_policer_cycle_count` | counter | | Number of completed Policer local storage cycles | | `neofs_node_state_policer_object_count` | counter | `action`, `mode` | Number of objects processed by Policer grouped by action and mode | | `neofs_node_state_policer_optimal_placement` | gauge | | Current Policer's optimal placement state. 0 for non-optimal/unknown placement; 1 for optimal placement | ### `writecache` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_node_writecache_flush_batch_time` | histogram | `shard` | Writecache 'flush batch' operations handling time | | `neofs_node_writecache_flush_single_time` | histogram | `shard` | Writecache 'flush single' operations handling time | | `neofs_node_writecache_object_count` | gauge | `shard` | Number of objects in the writecache | | `neofs_node_writecache_put_time` | histogram | `shard` | Writecache 'put' operations handling time | | `neofs_node_writecache_size` | gauge | `shard` | Size of the writecache | | `neofs_node_writecache_streaming_put_time` | histogram | `shard` | Writecache streaming 'put' operations handling time | ## Inner ring ### No subsystem | Name | Type | Labels | Description | |---|---|---|---| | `neofs_ir_version` | gauge | `version` | | ### `state` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_ir_state_epoch` | gauge | | Current epoch as seen by inner-ring node. | | `neofs_ir_state_health` | gauge | | Current ir state | ## S3 gateway - `neofs_s3_request_seconds` and the `neofs_s3_pool_*` histograms observe seconds. - `neofs_s3_errors_total` counts every response whose status code is outside 200 to 299, so it includes client errors such as a missing key. - `neofs_s3_tx_bytes_total` reports the bytes of request bodies that the gateway read, and `neofs_s3_rx_bytes_total` the bytes of responses that it wrote. - `neofs_s3_gw_state_health` is computed on every scrape: 2 when the gateway has a healthy connection to a storage node, 0 when it has none. ### No subsystem | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_request_seconds` | histogram | `api` | Time taken by requests served by current NeoFS S3 Gate instance | | `neofs_s3_version` | gauge | `version` | Version of current NeoFS S3 Gate instance | ### `errors` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_errors_total` | counter | `api` | Total number of s3 errors in current NeoFS S3 Gate instance | ### `pool` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_pool_balance_get` | histogram | | Balance get request handling time | | `neofs_s3_pool_container_delete` | histogram | | Container delete request handling time | | `neofs_s3_pool_container_eacl` | histogram | | Container eacl request handling time | | `neofs_s3_pool_container_get` | histogram | | Container get request handling time | | `neofs_s3_pool_container_list` | histogram | | Container list request handling time | | `neofs_s3_pool_container_put` | histogram | | Container put request handling time | | `neofs_s3_pool_container_set_eacl` | histogram | | Container set eacl request handling time | | `neofs_s3_pool_endpoint_info` | histogram | | Endpoint info request handling time | | `neofs_s3_pool_netmap_snapshot` | histogram | | Netmap snapshot request handling time | | `neofs_s3_pool_network_info` | histogram | | Network info request handling time | | `neofs_s3_pool_object_delete` | histogram | | Object delete request handling time | | `neofs_s3_pool_object_get_init` | histogram | | Object get init request handling time | | `neofs_s3_pool_object_get_stream` | histogram | | Object get stream request handling time | | `neofs_s3_pool_object_head` | histogram | | Object head request handling time | | `neofs_s3_pool_object_put_init` | histogram | | Object put init request handling time | | `neofs_s3_pool_object_put_stream` | histogram | | Object put stream request handling time | | `neofs_s3_pool_object_range_init` | histogram | | Object range init request handling time | | `neofs_s3_pool_object_range_stream` | histogram | | Object range stream request handling time | | `neofs_s3_pool_object_search_stream` | histogram | | Object search stream request handling time | | `neofs_s3_pool_object_search_v2` | histogram | | Object search v2 request handling time | | `neofs_s3_pool_overall_errors` | counter | `endpoint`, `method` | Overall errors for endpoint method | | `neofs_s3_pool_search_objects` | histogram | | Search objects request handling time | | `neofs_s3_pool_session_create` | histogram | | Session create request handling time | ### `requests` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_requests_current` | counter | `api` | Total number of running s3 requests in current NeoFS S3 Gate instance | | `neofs_s3_requests_total` | counter | `api` | Total number of s3 requests in current NeoFS S3 Gate instance | ### `rx` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_rx_bytes_total` | counter | | Total number of bytes received by current NeoFS S3 Gate instance | ### `state` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_gw_state_health` | gauge | | Current S3 gateway state | ### `tx` | Name | Type | Labels | Description | |---|---|---|---| | `neofs_s3_tx_bytes_total` | counter | | Total number of bytes sent by current NeoFS S3 Gate instance | ## Console - The `morph_console_engine_*` histograms observe seconds. - `morph_console_pool_avg_request_duration` holds nanoseconds. - The console registers its metrics only when `prometheus.enabled` is true in its configuration. ### No subsystem | Name | Type | Labels | Description | |---|---|---|---| | `morph_console_up` | gauge | | Morph gateway is up and running | | `morph_console_version` | gauge | `version` | Gateway version | ### `engine` | Name | Type | Labels | Description | |---|---|---|---| | `morph_console_engine_create_bucket_time` | histogram | | Engine 'create bucket' operations handling time | | `morph_console_engine_create_namespace_time` | histogram | | Engine 'create namespace' operations handling time | | `morph_console_engine_create_object_time` | histogram | | Engine 'create object' operations handling time | | `morph_console_engine_create_session_time` | histogram | | Engine 'create session' operations handling time | | `morph_console_engine_create_system_storage_policies` | histogram | | Engine 'create system storage policies' operations handling time | | `morph_console_engine_create_user_storage_policies` | histogram | | Engine 'create user storage policies' operations handling time | | `morph_console_engine_decommission_accounts_time` | histogram | | Engine 'decommission accounts' operations handling time | | `morph_console_engine_decommission_gateway_time` | histogram | | Engine 'decommission gateway' operations handling time | | `morph_console_engine_decommission_storage_node_time` | histogram | | Engine 'decommission storage node' operations handling time | | `morph_console_engine_delete_bucket_time` | histogram | | Engine 'delete bucket' operations handling time | | `morph_console_engine_delete_namespace_time` | histogram | | Engine 'delete namespace' operations handling time | | `morph_console_engine_delete_object_time` | histogram | | Engine 'delete object' operations handling time | | `morph_console_engine_delete_system_storage_policies` | histogram | | Engine 'delete system storage policies' operations handling time | | `morph_console_engine_delete_user_storage_policies` | histogram | | Engine 'delete user storage policies' operations handling time | | `morph_console_engine_delete_user_time` | histogram | | Engine 'delete user' operations handling time | | `morph_console_engine_download_object_data_time` | histogram | | Engine 'download object data' operations handling time | | `morph_console_engine_get_bucket_time` | histogram | | Engine 'get bucket' operations handling time | | `morph_console_engine_get_default_storage_quota_time` | histogram | | Engine 'get default storage quota' operations handling time | | `morph_console_engine_get_ir_public_keys` | histogram | | Engine 'get IR public keys' operations handling time | | `morph_console_engine_get_license` | histogram | | Engine 'get license' operations handling time | | `morph_console_engine_get_metrics_time` | histogram | | Engine 'get metrics' operations handling time | | `morph_console_engine_get_namespace_time` | histogram | | Engine 'get namespace' operations handling time | | `morph_console_engine_get_system_storage_policies` | histogram | | Engine 'get system storage policies' operations handling time | | `morph_console_engine_get_system_storage_policy` | histogram | | Engine 'get system storage policy' operations handling time | | `morph_console_engine_get_user_by_address_time` | histogram | | Engine 'get user by address' operations handling time | | `morph_console_engine_get_user_list_time` | histogram | | Engine 'get user list' operations handling time | | `morph_console_engine_get_user_metrics` | histogram | | Engine 'get user metrics' operations handling time | | `morph_console_engine_get_user_storage_policies` | histogram | | Engine 'get user storage policies' operations handling time | | `morph_console_engine_get_user_storage_policy` | histogram | | Engine 'get user storage policy' operations handling time | | `morph_console_engine_get_user_time` | histogram | | Engine 'get user' operations handling time | | `morph_console_engine_grant_gateway_time` | histogram | | Engine 'grant gateway' operations handling time | | `morph_console_engine_grant_storage_node_time` | histogram | | Engine 'grant storage node' operations handling time | | `morph_console_engine_head_object_time` | histogram | | Engine 'head object' operations handling time | | `morph_console_engine_list_buckets_time` | histogram | | Engine 'list buckets' operations handling time | | `morph_console_engine_list_gateways_time` | histogram | | Engine 'list gateways' operations handling time | | `morph_console_engine_list_namespaces_time` | histogram | | Engine 'list namespaces' operations handling time | | `morph_console_engine_list_objects_time` | histogram | | Engine 'list objects' operations handling time | | `morph_console_engine_list_storage_nodes_time` | histogram | | Engine 'list storage nodes' operations handling time | | `morph_console_engine_save_user_time` | histogram | | Engine 'save user' operations handling time | | `morph_console_engine_search_objects_time` | histogram | | Engine 'search objects' operations handling time | | `morph_console_engine_set_default_storage_quota_time` | histogram | | Engine 'set default storage quota' operations handling time | | `morph_console_engine_set_eacl_time` | histogram | | Engine 'set eACL' operations handling time | | `morph_console_engine_set_storage_quota_time` | histogram | | Engine 'set storage quota' operations handling time | | `morph_console_engine_store_session_time` | histogram | | Engine 'store session' operations handling time | | `morph_console_engine_top_up_storage_node_time` | histogram | | Engine 'top up storage node' operations handling time | | `morph_console_engine_update_system_storage_policies` | histogram | | Engine 'update system storage policies' operations handling time | | `morph_console_engine_update_user_storage_policies` | histogram | | Engine 'update user storage policies' operations handling time | | `morph_console_engine_upload_license` | histogram | | Engine 'upload license' operations handling time | | `morph_console_engine_v1_apply_bucket_transfer_action` | histogram | | Engine 'v1 apply bucket transfer action' operations handling time | | `morph_console_engine_v1_cluster_create_oauth_provider` | histogram | | Engine 'v1 create oauth provider' operations handling time | | `morph_console_engine_v1_cluster_create_saml_provider` | histogram | | Engine 'v1 create saml provider' operations handling time | | `morph_console_engine_v1_cluster_delete_oauth_provider` | histogram | | Engine 'v1 delete oauth provider' operations handling time | | `morph_console_engine_v1_cluster_delete_saml_provider` | histogram | | Engine 'v1 delete saml provider' operations handling time | | `morph_console_engine_v1_cluster_get_oauth_provider` | histogram | | Engine 'v1 get oauth provider' operations handling time | | `morph_console_engine_v1_cluster_get_oauth_providers` | histogram | | Engine 'v1 get oauth providers' operations handling time | | `morph_console_engine_v1_cluster_get_saml_provider` | histogram | | Engine 'v1 get saml provider' operations handling time | | `morph_console_engine_v1_cluster_list_saml_providers` | histogram | | Engine 'v1 list saml providers' operations handling time | | `morph_console_engine_v1_cluster_update_saml_provider` | histogram | | Engine 'v1 update saml provider' operations handling time | | `morph_console_engine_v1_create_access_token` | histogram | | Engine 'v1 create neofs bearer token' operations handling time | | `morph_console_engine_v1_create_bucket_transfer` | histogram | | Engine 'v1 create bucket transfer' operations handling time | | `morph_console_engine_v1_get_bucket_quota` | histogram | | Engine 'v1 get bucket quota' operations handling time | | `morph_console_engine_v1_get_bucket_timelock` | histogram | | Engine 'v1 get bucket timelock' operations handling time | | `morph_console_engine_v1_list_bucket_transfers` | histogram | | Engine 'v1 list bucket transfers' operations handling time | | `morph_console_engine_v1_login` | histogram | | Engine 'v1 login' operations handling time | | `morph_console_engine_v1_oauth_callback` | histogram | | Engine 'v1 oauth callback' operations handling time | | `morph_console_engine_v1_oauth_login` | histogram | | Engine 'v1 oauth login' operations handling time | | `morph_console_engine_v1_saml_acs` | histogram | | Engine 'v1 saml acs' operations handling time | | `morph_console_engine_v1_saml_login` | histogram | | Engine 'v1 saml login' operations handling time | | `morph_console_engine_v1_saml_metadata` | histogram | | Engine 'v1 saml metadata' operations handling time | | `morph_console_engine_v1_set_bucket_quota` | histogram | | Engine 'v1 set bucket quota' operations handling time | | `morph_console_engine_v1_set_bucket_timelock` | histogram | | Engine 'v1 set bucket timelock' operations handling time | ### `pool` | Name | Type | Labels | Description | |---|---|---|---| | `morph_console_pool_avg_request_duration` | gauge | `node`, `method` | Average request duration (in milliseconds) for specific method on node in pool (The value is in nanoseconds; the help text is as written in the source.) | | `morph_console_pool_current_errors` | gauge | `node` | Number of errors on current connections that will be reset after the threshold | | `morph_console_pool_overall_errors` | gauge | | Total number of errors in pool | | `morph_console_pool_overall_node_errors` | gauge | `node` | Total number of errors for connection in pool | | `morph_console_pool_overall_node_requests` | gauge | `node` | Total number of requests to specific node in pool | ### `startup` | Name | Type | Labels | Description | |---|---|---|---| | `morph_console_startup_status` | gauge | `status` | Current startup status of the service, 'OK' is the final one | ## Chain (neo-go) The inner ring and the storage node both embed neo-go, the chain node library, and both expose its metrics. The definitions are global to a process. From the inner ring the names arrive without a `process` label. From the storage node the same names arrive with `process="neofs"`. With the configuration that Morph generates (`experimental.chain_meta_data.enabled: true`) the inner ring runs the FS chain and a metadata chain in one process, and both chains write the same gauges. | Name | Type | Labels | Description | |---|---|---|---| | `neogo_block_height` | gauge | | Index of processed block | | `neogo_block_queue_length` | gauge | | Block queue length | | `neogo_estimated_persist_velocity` | gauge | | Estimation of persist velocity per cycle (1s by default) | | `neogo_header_height` | gauge | | Header height | | `neogo_mempool_unsorted_tx` | gauge | | Mempool unsorted transactions | | `neogo_network_size` | gauge | | Estimated network size | | `neogo_notarypool_unsorted_tx` | gauge | | Notary request pool fallback txs | | `neogo_p2p_commands_time` | histogram | `command` | P2P command handling time | | `neogo_peers_connected` | gauge | | Number of connected peers | | `neogo_persisted_height` | gauge | | Persisted block count | | `neogo_pool_count` | gauge | | Number of available node addresses | | `neogo_rpc_notification_subscriber_cnt` | gauge | `client_address`, `event_id` | The number of WS RPC notification subsystem subscribers | | `neogo_rpc_requests_time` | histogram | `api` | RPC request handling time | | `neogo_server_id` | gauge | `server_id` | network server ID | | `neogo_verified_state_height` | gauge | | Verified state height | | `neogo_wsconnections_count` | gauge | `client_type` | WS connections count (the number of local and remote WS clients) | ## Values of the state gauges ### `neofs_node_state_health` | Value | Name | |---|---| | 0 | `HEALTH_STATUS_UNDEFINED` | | 1 | `STARTING` | | 2 | `READY` | | 3 | `SHUTTING_DOWN` | ### `neofs_ir_state_health` | Value | Name | |---|---| | 0 | `HEALTH_STATUS_UNDEFINED` | | 1 | `STARTING` | | 2 | `READY` | | 3 | `SHUTTING_DOWN` | | 4 | `INITIALIZING_NETWORK` | ### `neofs_s3_gw_state_health` | Value | Name | |---|---| | 0 | `healthStatusUnhealthy` | | 1 | `healthStatusStaring` | | 2 | `healthStatusReady` | --- # Errors and status codes Morph reports errors at three levels: the console REST API, the storage layer below it, and the S3 gateway. ## Console REST API ### Error format | Property | Value | |---|---| | Status | An HTTP status code from the table below. | | Body of an error produced by an API handler | Plain text, one sentence, `Content-Type: text/plain; charset=UTF-8`. Example: `Bucket not found.` | | Body of an error produced before a handler runs | JSON object with one field, `message`. Example: `{"message":"Invalid format for parameter maxItems: ..."}`. This covers a path or query parameter that cannot be parsed and a path that does not exist under `/api`. | | `WWW-Authenticate` header | Sent with `401` and with part of the `403` responses. Form: `Bearer realm="morph" error="" error_description=""`. | | `Location` header | Sent with `201`, except for a bucket transfer. The path of the created resource. | A successful `201` response to a user, bucket, policy, namespace or provider creation also carries a short plain-text body, for example `Registration completed.` Values of `error` in the `WWW-Authenticate` header: | `error` | Sent with | Meaning | |---|---|---| | (absent) | `401` | A token is required and none was sent. Returned by `POST /api/v1/users` once a user exists. | | `invalid_token` | `401` | The token is missing, malformed, unknown or revoked, or the `Authorization` header is longer than 256 characters. | | `expired_token` | `401` | The token has passed its expiry time. | | `access_denied` | `403` | The token is valid, but the user or the token lacks the right for the operation. | | `forbidden_action` | `403` | The operation would demote the only administrator. | ### HTTP status codes | Code | Meaning in the Morph API | |---|---| | `200 OK` | The request succeeded and the body holds the result. | | `201 Created` | A user, bucket, object, storage policy, namespace, bucket transfer or single sign-on provider was created. | | `202 Accepted` | The decommissioning of a storage node was accepted and continues in the background. | | `204 No Content` | The change, deletion or revocation succeeded. No body. | | `206 Partial Content` | The requested byte range of an object. | | `302 Found` | SAML sign-in: redirect to the identity provider at the start, when the provider offers the HTTP redirect binding, and to the console after an accepted assertion. | | `307 Temporary Redirect` | OAuth sign-in: redirect to the identity provider at the start, and back to the console after the callback. | | `400 Bad Request` | The request is malformed: invalid JSON, an unknown JSON field, a missing or invalid parameter, an invalid name, cursor, storage policy or token setting. Also returned by `GET /api/v1/users` without a token once a user exists (`Session token required.`), and when a namespace header is sent to a console that is bound to one namespace. | | `401 Unauthorized` | No valid token: missing, malformed, unknown, revoked or expired. See the `WWW-Authenticate` header for the case. | | `403 Forbidden` | The token is valid but does not allow the operation: the role is insufficient, the token lacks the permission, the token is limited to another bucket, the resource belongs to another user or namespace, or the access rules of the bucket deny the operation. `POST /api/v1/login` returns `403` with `Login failed.` for an unknown user and for a wrong password. Single sign-on returns `403` when the provider returns no email address or the email domain is not allowed. | | `404 Not Found` | The user, bucket, object, token, storage policy, namespace, provider, license or transfer does not exist. A repeated revocation of a token returns `204` or `404`. Accepting a bucket transfer that was already accepted or has expired returns `404` (`notary transaction not found`). | | `409 Conflict` | The name is already taken (user, bucket, policy, namespace); the bucket is locked against deletion; the bucket was changed concurrently and the request should be repeated; the user still owns buckets; the namespace is not empty; a bucket transfer can no longer be applied because the bucket changed owner; the account of a storage node or gateway that should be admitted was blocked by an earlier decommissioning. | | `413 Content Too Large` | The uploaded license is too large. | | `416 Range Not Satisfiable` | The requested byte range lies outside the object. | | `500 Internal Server Error` | The console could not complete the request. The body often carries the underlying error, for example `Internal error: .`, which can contain a storage status from the next section. Typical causes: the storage node or the FS chain is unreachable, or the inner ring has no quorum for a change. | | `501 Not Implemented` | Decommissioning was requested from a Morph node without an inner ring. Send the request to a cluster-type node. | | `507 Insufficient Storage` | The upload would exceed the storage quota of the user or the bucket. | The exact set of codes per operation is in the [REST API reference](rest-api/index.md). ### Frequent error bodies | Status | Body | Cause | |---|---|---| | `401` | `Token is missing or invalid.` or `Missing or invalid token.` | No `Authorization: Bearer` header, a malformed token, or a token that was revoked or has been removed after its expiry. | | `401` | `Token has expired.` or `Token expired.` | The token is past its expiry time. Log in again or create a new token. | | `401` | `Bearer token is required.` | Registration without a token after the first administrator exists. | | `401` | `Unauthorized access.` | The token could not be resolved to a session. | | `403` | `Insufficient rights.` | Role or token permission is missing, or the target is in another namespace. | | `403` | `Login failed.` | Unknown user or wrong password. | | `403` | `User is not authorized to make this action in the bucket.` | The storage node denied the object operation (status `2048`). | | `403` | `Token is not applied to the bucket.` | The token is limited to another bucket. | | `403` | `Modifying system container is not possible.` | A bucket deletion addressed the system bucket `access-box-storage`. | | `403` | `Cannot delete the only admin.` / `Cannot reduce the only admin.` | The user is the only administrator of the default namespace. | | `403` | `Namespace management is disabled for this gateway.` | The console is bound to one namespace. | | `400` | `Malformed json payload.` | The body is not valid JSON or contains a field the API does not know. | | `400` | `Validation error: .` | A token or credential request is invalid, for example an administrator flag set by a non-administrator, or a bucket that the user does not own. | | `409` | `User removal is not allowed. User has buckets` | Delete or transfer the user's buckets first. | | `409` | `Bucket locked.` | The bucket has a lock time in the future. | | `409` | `Bucket was changed concurrently, try again.` | Another change to the bucket was recorded first. | | `507` | `User doesn't have enough space.` | A hard quota is reached. | ## Storage layer status codes Storage nodes answer every request with a status of the NeoFS API. The console and the S3 gateway translate these statuses into their own errors. The numeric codes appear in the logs of the console, the S3 gateway and the storage node, and inside the body of `500` responses, in the form: ```text status: code = 2049 message = object not found ``` A code is `section × 1024 + number`. Section 0 is success, 1 common failures, 2 object, 3 container (bucket), 4 session. | Code | Name | Default message | Meaning | |---|---|---|---| | 0 | OK | | Success. | | 1 | Incomplete | | Partial success: part of the work was done. The message says what is missing. | | 1024 | Internal server error | | The storage node failed to process the request. The message is informative only. | | 1025 | Wrong network magic | | The request was made for another network. | | 1026 | Signature verification failure | `signature verification failed` | A signature of the request or of a token is invalid. | | 1027 | Node under maintenance | `node is under maintenance` | The storage node is in maintenance mode and refuses object operations. See [Use maintenance mode](../how-to/operate/use-maintenance-mode.md). | | 1028 | Bad request | `bad request` | The request does not follow the protocol. | | 1029 | Busy | `busy, retry later` | The node cannot serve the request now. Retry later. | | 1030 | Request expired | `request has expired` | The validity time of the request has passed. Check the clocks of the hosts. | | 2048 | Object access denied | `access to object operation denied` | The basic ACL, the eACL or a token does not allow the operation. The message carries the reason. | | 2049 | Object not found | `object not found` | No object with this ID is available in the bucket. | | 2050 | Object locked | `object is locked` | The object is under a lock and cannot be deleted. | | 2051 | Lock non-regular object | `locking non-regular object is forbidden` | A lock was requested for an object that cannot be locked. | | 2052 | Object already removed | `object already removed` | The object was deleted. | | 2053 | Out of range | `out of range` | The requested byte range lies outside the object. | | 2054 | Quota exceeded | `size quota limits are exceeded` | A storage quota of the user or the bucket is reached. | | 3072 | Container not found | `container not found` | The bucket does not exist. | | 3073 | eACL not found | `eACL not found` | The bucket has no extended access rules. | | 3074 | Container locked | `container is locked` | The bucket is locked against deletion. | | 3075 | Container await timeout | `container transaction await timeout` | The change to the bucket was not confirmed on the FS chain in time. | | 3076 | Container revision mismatch | `container revision does not match` | The bucket was changed by another request in the meantime. | | 4096 | Session token not found | `session token not found` | The session referred to by the request is unknown. | | 4097 | Session token expired | `expired session token` | The session token is past its lifetime. | NeoFS tools and logs call a bucket a container. ### How the console maps storage statuses | Storage status | Console response | |---|---| | 2048 Object access denied | `403`, `User is not authorized to make this action in the bucket.` | | 2049 Object not found | `404`, `Object not found.` | | 2052 Object already removed | `404`, `Object not found.` | | 2053 Out of range | `416`, `Requested range is not satisfiable.` | | 2054 Quota exceeded | `507`, `User doesn't have enough space.` | | 3072 Container not found | `404`, `Bucket not found.` | | 3074 Container locked | `409`, `Bucket locked.` | | 3076 Container revision mismatch | `409`, `Bucket was changed concurrently, try again.` | | 4097 Session token expired | `401`, `Token expired.` | | Any other failure | `500`, `Internal error: .` | ## S3 errors The S3 gateway answers with S3 error documents in XML and S3 error codes such as `AccessDenied`, `NoSuchBucket` and `NoSuchKey`. They are listed in [S3 compatibility](s3-compatibility.md). --- # Limits The limits on this page are enforced by the software of the bundled versions. Limits that depend on hardware, such as capacity or throughput, are not listed here. ## Names and identifiers | Item | Limit | |---|---| | Bucket name, through the REST API | 1 to 63 characters; lowercase letters, digits, hyphens; starts and ends with a letter or digit (`^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`) | | Bucket name, through S3 | 3 to 63 characters; dots are allowed. See [S3 compatibility](s3-compatibility.md#limits). A name with a dot cannot be addressed through the REST API, and a name of 1 or 2 characters cannot be used through S3 | | Bucket name uniqueness | Unique within a namespace | | User name | 1 to 53 characters from `a-z`, `A-Z`, `0-9`, `@`, `.`, `-`, `+`, `=`, `_`, `~` | | Namespace name | 1 to 31 characters; lowercase letters, digits, hyphens; starts with a letter; does not end with a hyphen | | Namespace description | At most 256 bytes | | Storage policy name | At most 42 bytes; no zero byte | | Token name | 1 to 256 characters from `a-z`, `A-Z`, `0-9`, `.`, `-` and space | | SAML provider ID | At most 63 characters | | OAuth provider ID | No length check | ## REST API requests | Item | Limit | |---|---| | `Authorization` header | At most 256 characters, including `Bearer ` | | JSON request body | 4 MiB are read; unknown fields are rejected. Exceptions: `POST /v1/login` is read without this limit, and the requests that create an access token for sharing, create or update an OAuth or SAML provider, or apply an action to a storage node are read without the limit and ignore unknown fields, so a misspelled field is dropped without an error | | `maxItems` for users, buckets, API tokens and S3 credentials | Default 100, maximum 100; a larger or negative value returns status `400` | | `maxItems` for object list and search | Default 100, maximum 1000; a larger or negative value returns status `400` | | Search filters per request | 7 | | Search attributes per request | 7 | | Numeric search value | Decimal integer from −(2²⁵⁶ − 1) to 2²⁵⁶ − 1 | | Search keys | Keys starting with `__`, and keys starting with `$Object:` other than `payloadLength`, `payloadHash`, `ownerID`, `creationEpoch`, are rejected | | `Range` header | One range per request | | Namespace header | At most 31 characters; must name an existing namespace | ## Objects | Item | Limit | |---|---| | Size of one stored piece | 64 MiB. A larger upload is split by the storage node into pieces of at most this size plus a link object. | | Empty object through the REST API | Not accepted; the upload returns status `400` | | Object header, all attributes together | 16 KiB in binary form | | Attribute keys | A key starting with `__` is rejected; pairs with an empty key or value are dropped | | Attributes after upload | Cannot be changed | | Object path | Required and not empty; not unique within a bucket | | REST upload duration | 120 seconds, or the declared `Content-Length` divided by 2 MiB per second if that is longer | | Lifetime | Whole hours, 0 or more; 0 means no expiration, a negative value is rejected; a date is rounded up to the next hour | | Content type detection | From the first 512 bytes when no `Content-Type` attribute is sent | ## Storage policies | Item | Limit | |---|---| | `REP` rules per policy | 256 | | Replicas per `REP` rule | 8 | | `EC` rules per policy | 4 | | Data parts plus parity parts per `EC` rule | 64; each at least 1 | | Candidate nodes per rule (placement factor × nodes of the rule) | 64 | | Candidate nodes of a policy, all rules | 512 | | `REP` and `EC` rules in the same policy | Not allowed | | Initial placement together with metadata consistency | Not allowed for a bucket | | Default placement factor | 3 | | Storage policy of an existing bucket | Cannot be changed | | Default system policy | Cannot be deleted | With the default placement factor of 3, the limit of 64 candidate nodes per rule allows at most 21 parts in an `EC` rule. See [Storage policy language](storage-policy-language.md). ## Buckets and access rules | Item | Limit | |---|---| | Basic ACL of an existing bucket, including `final` and `disableAccessTokens` | Cannot be changed | | Operations in the basic ACL and the extended ACL | `GET`, `HEAD`, `PUT`, `DELETE`, `SEARCH` | | Extended ACL match types | `STRING_EQUAL`, `STRING_NOT_EQUAL` | | Extended ACL target role `SYSTEM` | Rejected | | Extended ACL with a final basic ACL | Not available | | Extended ACL change, time to take effect on a storage node | Up to 15 seconds (cache of the storage node) | | Bucket lock | Resolution of 1 second; can only be moved later; cannot be removed | | Bucket transfer | Within one namespace; the only action is `accept`; an unaccepted request expires (the web console states up to 5 minutes) | | Namespace deletion | Only when the namespace has no users | ## Tokens | Item | Limit | |---|---| | Session from `/api/v1/login` | 100 hours by default (`neofs.sessionTTL` in the console settings) | | API token `ttl` | Default 30 days | | Bucket access token `expiresAt` | Required; in the future; converted to whole network epochs, rounded up, and valid until the last of them has ended (up to two epochs past the date) | | Bucket access token revocation | Not possible | | Bucket access token use | `accessToken` is read on `GET` and `HEAD` of an object only | | Bucket access token issuer | The current bucket owner only | ## Quotas | Item | Limit | |---|---| | Quota value | Bytes as an unsigned 64-bit integer; `0` means unlimited | | Soft and hard limit | When both are set, the soft limit must be lower than the hard limit | | What is counted | Space on the storage nodes, all replicas and parts included | | Time for a quota change or freed space to take effect | Up to 10 minutes of cache on each storage node, plus the interval of the size reports (three per epoch) | ## Cluster | Item | Limit | |---|---| | Inner ring size | Fixed for the life of the network. Recommended: 1 for tests, 4 or 7 in production. The installer does not reject other sizes; 5 or 6 nodes tolerate no more failures than 4 | | Inner ring quorum | 3 of 4, 5 of 7. Below quorum no bucket, access rule, user or network map change is possible. | | Epoch duration | 3600 seconds by default | | Storage node removal from the network map | After more than 3 epochs without a heartbeat | | Nodes and capacity allowed by the license | Set by the license in use; read with `GET /api/v1/cluster/license` | | Garbage collection per shard | Up to 200 objects every 10 seconds | | Policer | One batch of 10 objects per second and node, three times that while it finds shortages | ## Related - [Storage policy language](storage-policy-language.md) - [REST API reference](rest-api/index.md) - [S3 compatibility](s3-compatibility.md) - [Errors and status codes](errors.md) - [Design trade-offs and limitations](../explanation/design-trade-offs.md) --- # Resilience tests This section records the functional resilience test suite run against a deployed Morph `0.30.1` cluster. Every scenario writes reference objects, injects a node, disk, or network fault on one or more machines, verifies service during the fault where the policy or consensus tolerates it, and checks every acknowledged object, delete, and bucket listing afterward. Throughput and latency are not part of this record. | Property | Value | |---|---| | Morph version | `v0.30.1` | | Pipeline | `8831` | | Run timestamp | `2026-12-01 23:08 UTC` | | Cluster topology | 7 cluster-type nodes (`IR1`-`IR7`), 2 storage-type nodes (`SN1`-`SN2`), 1 gateway-type node (`GW1`) | | Scenarios | 33 / 33 passed | ## System under test The deployment runs one virtual machine per Morph node and one Morph container (`morph`) per machine. Each Morph container starts with `--restart=always`, so scenarios that kill or stop a Morph container first change its restart policy to `no`. Each cluster-type node (`IR1`-`IR7`) runs the inner ring and the storage node process using the same storage package as the storage-type nodes (`SN1`, `SN2`). Storage placement uses all 9 storage-bearing nodes, so a fault can hit any holder and rebuilt copies or erasure-coded parts have nodes to land on. The gateway-type node (`GW1`) runs the S3 gateway without local storage volumes. Scenarios refer to the nodes in deployment order: - `IR1`-`IR7`: cluster-type nodes (inner ring and storage) - `SN1`, `SN2`: storage-type nodes (storage only) - `GW1`: gateway-type node (standalone S3 gateway) Unless a scenario names another endpoint, the test client addresses `IR1` (REST on port `80`, S3 on port `7130`, FS chain RPC on port `7112`). These port numbers, together with storage gRPC on `7120` and metrics on `7140`, are the test deployment's published host ports mapped to the Morph container's ports; see [Ports and protocols](../ports-and-protocols.md) for the default Morph container ports (`9100`, `9080`, `30333`, `8080`, and `5100`). Every cluster-type node serves the same API. ## Cluster topology ```mermaid flowchart TB client(["Test clients"]) subgraph gw["Gateway-type node (c6i.large)"] GW1["GW1 · 192.168.42.98"] end subgraph ir["Cluster-type nodes: inner ring and storage (7 x c6id.large)"] IR1["IR1 · 192.168.43.122"] IR2["IR2 · 192.168.43.145"] IR3["IR3 · 192.168.43.33"] IR4["IR4 · 192.168.42.231"] IR5["IR5 · 192.168.43.143"] IR6["IR6 · 192.168.43.225"] IR7["IR7 · 192.168.42.248"] end subgraph sn["Storage-type nodes: storage only (2 x c6id.large)"] SN1["SN1 · 192.168.42.157"] SN2["SN2 · 192.168.43.139"] end client -- "S3 :7130" --> gw client -- "REST :80, S3 :7130" --> ir client -. "FS chain RPC :7112" .-> ir gw -- "gRPC storage :7120" --> ir gw -- "gRPC storage :7120" --> sn gw -. "FS chain RPC" .-> ir ir <-- "gRPC storage :7120" --> sn sn -. "FS chain RPC" .-> ir ``` Solid arrows carry client API requests and gRPC object traffic. Dotted arrows carry FS chain RPC traffic. Cluster-type nodes also exchange dBFT consensus messages among themselves; with 7 inner ring nodes, consensus requires 5 nodes and tolerates 2 failures. ## Test environment The host parameters below were collected from each machine at the start of the run. All 10 nodes share the same operating system, kernel, processor family, memory size, and Morph container image. | Property | Value | |---|---| | Operating system | Ubuntu 24.04.4 LTS | | Architecture | `x86_64` | | Kernel | `6.17.0-1010-aws` | | Processor | Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz, 2 CPU | | Memory | 3.7 GiB | | Morph image ID | `sha256:ee097527a70c8501ba9912a4a7070cf60a4d983b07d6028b3544c50dbfd94cc5` | | AWS instance types | `c6id.large` (`IR1`-`IR7`, `SN1`-`SN2`), `c6i.large` (`GW1`) | | Data storage (`IR1`-`IR7`, `SN1`-`SN2`) | `/mnt/data/data_1` (`xfs`, `/dev/nvme1n1`), 110 GiB (used 2.1 GiB, free 108 GiB) | | Metadata storage (`IR1`-`IR7`, `SN1`-`SN2`) | `/mnt/metadata/metadata_1` (`xfs`, `/dev/nvme1n1`), 110 GiB (used 2.1 GiB, free 108 GiB) | | Service metadata (`IR1`-`IR7`, `SN1`-`SN2`) | `/mnt/local_meta` (`xfs`, `/dev/nvme1n1`), 110 GiB (used 2.1 GiB, free 108 GiB) | | Gateway storage (`GW1`) | No data or metadata volumes mounted | ### Node inventory | Label | Node type | Private IP | Hostname | AWS instance type | CPU / Memory | Storage volumes | |---|---|---|---|---|---|---| | `IR1` | cluster-type (inner ring, storage) | `192.168.43.122` | `m00-8831ir7-ft-ir-1` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR2` | cluster-type (inner ring, storage) | `192.168.43.145` | `m00-8831ir7-ft-ir-2` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR3` | cluster-type (inner ring, storage) | `192.168.43.33` | `m00-8831ir7-ft-ir-3` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR4` | cluster-type (inner ring, storage) | `192.168.42.231` | `m00-8831ir7-ft-ir-4` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR5` | cluster-type (inner ring, storage) | `192.168.43.143` | `m00-8831ir7-ft-ir-5` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR6` | cluster-type (inner ring, storage) | `192.168.43.225` | `m00-8831ir7-ft-ir-6` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `IR7` | cluster-type (inner ring, storage) | `192.168.42.248` | `m00-8831ir7-ft-ir-7` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `SN1` | storage-type (storage only) | `192.168.42.157` | `m00-8831ir7-ft-sn-1` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `SN2` | storage-type (storage only) | `192.168.43.139` | `m00-8831ir7-ft-sn-2` | `c6id.large` | 2 CPU, 3.7 GiB | 110 GiB XFS NVMe (`/dev/nvme1n1`) | | `GW1` | gateway-type (S3 gateway) | `192.168.42.98` | `m00-8831ir7-ft-gw-1` | `c6i.large` | 2 CPU, 3.7 GiB | None | ## Pass criteria Every scenario ran against these ten criteria: 1. A read that returns different bytes fails immediately. 2. After the fault is removed, two not-found answers for a live object mean the object was lost. 3. While a node is down, a not-found answer is retried until the deadline. Failover is not treated as loss. 4. A deleted object that is readable again is a failure. 5. The bucket listing has to name every acknowledged object and no deleted key. 6. While a fault the cluster is built to survive is held, reads, writes, and deletes are repeated until they succeed. A request that does not succeed within the limit the scenario states fails it, and the time it took is recorded. 7. With client traffic running across a fault, no kind of request may keep failing for longer than the limit the scenario states. A request that failed has an unknown outcome: its object has to be exact or absent. 8. Restored redundancy is not taken from what the nodes report alone: the files are counted on the disks, or other holders are then lost and the objects are read. 9. A shard is wiped only after the surviving nodes report two further policer passes and full redundancy. 10. With one inner ring node stopped, the FS chain must produce a new block. Below quorum, the height must stay put. ## Scenarios All 33 scenarios completed and met the pass criteria. Scenarios are grouped across six thematic pages, with verbatim host commands and responses collapsed inside each scenario. | # | Scenario | Group | Result | |---|---|---|---| | 5.1 | [Full cluster restart](node-availability.md#51-full-cluster-restart) | [Node availability](node-availability.md) | Passed | | 5.2 | [Partial loss of storage nodes](node-availability.md#52-partial-loss-of-storage-nodes) | [Node availability](node-availability.md) | Passed | | 5.3 | [One inner ring node and one storage node down together](node-availability.md#53-one-inner-ring-node-and-one-storage-node-down-together) | [Node availability](node-availability.md) | Passed | | 5.4 | [Storage node returns with empty drives, replication of 3 copies](disk-and-shard-faults.md#54-storage-node-returns-with-empty-drives-replication-of-3-copies) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.5 | [Storage node returns with empty drives, erasure coding 6+2](disk-and-shard-faults.md#55-storage-node-returns-with-empty-drives-erasure-coding-62) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.6 | [Metadata wiped on a storage node; the data files stay](disk-and-shard-faults.md#56-metadata-wiped-on-a-storage-node-the-data-files-stay) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.7 | [A deleted object stays gone after the node that held a copy returns](disk-and-shard-faults.md#57-a-deleted-object-stays-gone-after-the-node-that-held-a-copy-returns) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.8 | [Data files wiped on a stopped storage node are restored](disk-and-shard-faults.md#58-data-files-wiped-on-a-stopped-storage-node-are-restored) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.9 | [Data files wiped on a running storage node are restored](disk-and-shard-faults.md#59-data-files-wiped-on-a-running-storage-node-are-restored) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.10 | [Read-only disk on a running node](disk-and-shard-faults.md#510-read-only-disk-on-a-running-node) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.11 | [Full disk on a storage node](disk-and-shard-faults.md#511-full-disk-on-a-storage-node) | [Disk and shard faults](disk-and-shard-faults.md) | Passed | | 5.12 | [Erasure-coded object stays readable after part-holders are lost, and the parts are rebuilt](erasure-coding-and-rebuild.md#512-erasure-coded-object-stays-readable-after-part-holders-are-lost-and-the-parts-are-rebuilt) | [Erasure coding and rebuild](erasure-coding-and-rebuild.md) | Passed | | 5.13 | [Write and delete while an erasure-coding part-holder is down](erasure-coding-and-rebuild.md#513-write-and-delete-while-an-erasure-coding-part-holder-is-down) | [Erasure coding and rebuild](erasure-coding-and-rebuild.md) | Passed | | 5.14 | [Losing one more erasure-coding part than the policy can rebuild](erasure-coding-and-rebuild.md#514-losing-one-more-erasure-coding-part-than-the-policy-can-rebuild) | [Erasure coding and rebuild](erasure-coding-and-rebuild.md) | Passed | | 5.15 | [One inner ring node down, a slow link, isolation from storage, and a lost quorum](inner-ring-faults.md#515-one-inner-ring-node-down-a-slow-link-isolation-from-storage-and-a-lost-quorum) | [Inner ring faults](inner-ring-faults.md) | Passed | | 5.16 | [The inner ring node the client is using goes down](inner-ring-faults.md#516-the-inner-ring-node-the-client-is-using-goes-down) | [Inner ring faults](inner-ring-faults.md) | Passed | | 5.17 | [Network split of the inner ring: the majority keeps serving](inner-ring-faults.md#517-network-split-of-the-inner-ring-the-majority-keeps-serving) | [Inner ring faults](inner-ring-faults.md) | Passed | | 5.18 | [Inner ring node rejoins after its chain database is wiped](inner-ring-faults.md#518-inner-ring-node-rejoins-after-its-chain-database-is-wiped) | [Inner ring faults](inner-ring-faults.md) | Passed | | 5.19 | [Traffic across a fault: SIGKILL of a storage node, replication of 3 copies](traffic-and-operations.md#519-traffic-across-a-fault-sigkill-of-a-storage-node-replication-of-3-copies) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.20 | [Traffic across a fault: a frozen storage node (docker pause), replication of 3 copies](traffic-and-operations.md#520-traffic-across-a-fault-a-frozen-storage-node-docker-pause-replication-of-3-copies) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.21 | [Traffic across a fault: SIGKILL of the inner ring node the clients are connected to, replication of 3 copies](traffic-and-operations.md#521-traffic-across-a-fault-sigkill-of-the-inner-ring-node-the-clients-are-connected-to-replication-of-3-copies) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.22 | [Traffic across a fault: SIGKILL of a storage node, erasure coding 6+2](traffic-and-operations.md#522-traffic-across-a-fault-sigkill-of-a-storage-node-erasure-coding-62) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.23 | [Rolling restart under load](traffic-and-operations.md#523-rolling-restart-under-load) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.24 | [Flapping storage node under load](traffic-and-operations.md#524-flapping-storage-node-under-load) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.25 | [Storage port blocked on one node; the other copies keep serving](traffic-and-operations.md#525-storage-port-blocked-on-one-node-the-other-copies-keep-serving) | [Traffic and operations](traffic-and-operations.md) | Passed | | 5.26 | [Objects written while a storage node is already down](node-availability.md#526-objects-written-while-a-storage-node-is-already-down) | [Node availability](node-availability.md) | Passed | | 5.27 | [Permanent loss of a storage node; redundancy is rebuilt, replication of 3 copies](erasure-coding-and-rebuild.md#527-permanent-loss-of-a-storage-node-redundancy-is-rebuilt-replication-of-3-copies) | [Erasure coding and rebuild](erasure-coding-and-rebuild.md) | Passed | | 5.28 | [Permanent loss of a storage node; redundancy is rebuilt, erasure coding 6+2](erasure-coding-and-rebuild.md#528-permanent-loss-of-a-storage-node-redundancy-is-rebuilt-erasure-coding-62) | [Erasure coding and rebuild](erasure-coding-and-rebuild.md) | Passed | | 5.29 | [S3 keeps serving while storage nodes and S3 endpoints are lost](s3-gateway-and-large-objects.md#529-s3-keeps-serving-while-storage-nodes-and-s3-endpoints-are-lost) | [S3 gateway and large objects](s3-gateway-and-large-objects.md) | Passed | | 5.30 | [Multipart upload across a node loss](s3-gateway-and-large-objects.md#530-multipart-upload-across-a-node-loss) | [S3 gateway and large objects](s3-gateway-and-large-objects.md) | Passed | | 5.31 | [Large S3 object stays readable after its holders are lost, replication of 3 copies](s3-gateway-and-large-objects.md#531-large-s3-object-stays-readable-after-its-holders-are-lost-replication-of-3-copies) | [S3 gateway and large objects](s3-gateway-and-large-objects.md) | Passed | | 5.32 | [Large S3 object stays readable after its holders are lost, erasure coding 6+2](s3-gateway-and-large-objects.md#532-large-s3-object-stays-readable-after-its-holders-are-lost-erasure-coding-62) | [S3 gateway and large objects](s3-gateway-and-large-objects.md) | Passed | | 5.33 | [Storage node: kill, stop, pause, isolation, partition, and a bad link](node-availability.md#533-storage-node-kill-stop-pause-isolation-partition-and-a-bad-link) | [Node availability](node-availability.md) | Passed | --- # Node availability These five scenarios cover node crashes, graceful stops, Morph container pauses, network isolation, partitions, degraded links, and writes submitted while a storage node is already down. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.1 Full cluster restart **Goal** Every inner ring and storage node is killed, as in a power loss, and then started. No node is left to keep the FS chain or a copy of the data online. The cluster must come back without operator action, the FS chain must produce blocks again, every object acknowledged before the kill must be read back unchanged, and deleted objects must stay deleted. **Scenario** 1. **Write and delete reference objects.** One bucket is created for each of rep-3, ec-6-2. 8 objects are written to each bucket, two of them are deleted, and the rest are read back. 2. **Kill all 9 nodes.** Each node's Morph container is killed with SIGKILL, one after another, with its restart policy set to no. All of them stay down for 10 seconds and are then started. The S3 gateway is not touched. 3. **Wait for the cluster to come back.** Nothing is done to the cluster besides starting the Morph containers. The FS chain RPC must answer and then advance, the Morph API on IR1 must answer, and every node must report ready health and be in the network map. 4. **Read back after the restart.** Every object acknowledged before the kill is read and compared byte for byte, and every deleted key is probed. A new object is then written and read in each bucket. 5. **Wait for full redundancy.** Each node's policer has to finish two passes and report that no object is short of copies or parts. 6. **Read back every acknowledged object.** A final REST read of every bucket and of its listing after the policers have settled. **Observed result** - **Step 1 (Write and delete reference objects):** Before the kill, Morph REST returned the bytes of 12 objects in 2 buckets and did not return 4 deleted keys. - **Step 2 (Kill all 9 nodes):** All 9 Morph containers were down at the same time. - **Step 3 (Wait for the cluster to come back):** FS chain RPC answered at height 201 and moved from block 201 to 212. All 9 nodes report ready health and are in the network map, 177s after the Morph containers were started. - **Step 4 (Read back after the restart):** After the restart, Morph REST returned the bytes of 14 objects, including 2 written after it, and did not return 4 deleted keys. - **Step 5 (Wait for full redundancy):** The policers on all 9 nodes finished two passes with full redundancy. - **Step 6 (Read back every acknowledged object):** Final read-back: 14 objects matched and 4 deleted keys stayed absent. The listings of all 2 buckets name every one of the objects and none of the deleted keys.
Command log **Step 2. Kill all 9 nodes** ```shell # IR1 exit 0 $ docker update --restart=no morph morph # IR1 exit 0 $ docker kill morph morph # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # IR4 exit 0 $ docker update --restart=no morph morph # IR4 exit 0 $ docker kill morph morph # IR5 exit 0 $ docker update --restart=no morph morph # IR5 exit 0 $ docker kill morph morph # IR6 exit 0 $ docker update --restart=no morph morph # IR6 exit 0 $ docker kill morph morph # IR7 exit 0 $ docker update --restart=no morph morph # IR7 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # IR1 exit 0 $ docker update --restart=always morph morph # IR1 exit 0 $ docker start morph morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR4 exit 0 $ docker update --restart=always morph morph # IR4 exit 0 $ docker start morph morph # IR5 exit 0 $ docker update --restart=always morph morph # IR5 exit 0 $ docker start morph morph # IR6 exit 0 $ docker update --restart=always morph morph # IR6 exit 0 $ docker start morph morph # IR7 exit 0 $ docker update --restart=always morph morph # IR7 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph ``` **Step 3. Wait for the cluster to come back** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.2 Partial loss of storage nodes **Goal** Morph stores data on every node: 7 inner ring nodes and 2 storage-type nodes, 9 storage nodes in all. A node that runs the inner ring stores in the same package. The policy is replication of 3 copies, so an object stays readable after 2 of its 3 copies are lost. This scenario stops storage-type nodes, and at most 2 of them: the ones that hold copies of the written objects. The copies on the storage nodes that stay up, including the nodes that also run the inner ring, keep every object readable. A new object is written and one object is deleted while the stopped nodes are down. After they start, the new object matches and the delete stays gone. With two storage-type nodes, both are stopped. With more than 2, the rest stay up, because an object can have every copy on storage-type nodes. **Scenario** 1. **Stop storage-type nodes and keep serving.** 12 objects are written. Object placement, read from the storage nodes, names the storage-type nodes that hold copies. At most 2 of those nodes are killed with SIGKILL. Every object is read, a new object is written, and the object that lost the most copies is deleted. The Morph containers are started and the policer reports full redundancy. **Observed result** - **Step 1 (Stop storage-type nodes and keep serving):** 5 of 12 objects have a copy on the stopped nodes. rep/03 has 2 of its 3 copies there. Stopping every storage-type node (SN2, SN1). Each object keeps a copy on a node that also runs the inner ring. While the storage-type nodes are killed. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 1 deleted key. After the storage-type nodes returned. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 1 deleted key. The bucket listing (12 keys) names every acknowledged object and no deleted key.
Command log **Step 1. Stop storage-type nodes and keep serving** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.3 One inner ring node and one storage node down together **Goal** Under replication of 3 copies, each object is on 3 of the 9 storage nodes. Under erasure coding 6+2, its parts are on 8 of them. One inner ring node other than IR1 and one storage-type node are killed together. IR1 is left up because the test client addresses it; every inner ring node can serve the same requests. Object placement names the holders, and the pair is chosen to take as many copies and parts as it can without taking more from any object than its policy tolerates. The FS chain has to produce a new block. Both policies stay readable. After both nodes start, the policer reports full redundancy. **Scenario** 1. **Write both policies.** Two objects are written under replication of 3 copies, and two under erasure coding 6+2. Object placement says which nodes hold them. 2. **Kill IR7 and SN1.** Both Morph containers are killed with SIGKILL. The FS chain has to advance. Both object sets are read. The Morph containers are started and every storage node's policer reports full redundancy. **Observed result** - **Step 1 (Write both policies):** Replication landed on IR4, IR7, IR1, IR5, 192.168.43.145. Parts landed on SN1, IR4, IR7, IR1, SN2, IR5, IR2, IR6, 192.168.43.33. Killing IR7, 192.168.42.157. - **Step 2 (Kill IR7 and SN1):** FS chain moved from block 279 to 281. Replication while both nodes are killed. Morph REST on IR1:80 returned the acknowledged bytes for 2 objects. After both nodes returned. Morph REST on IR1:80 returned the acknowledged bytes for 4 objects.
Command log **Step 2. Kill IR7 and SN1** ```shell # IR7 exit 0 $ docker update --restart=no morph morph # IR7 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # IR7 exit 0 $ docker update --restart=always morph morph # IR7 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.26 Objects written while a storage node is already down **Goal** One storage node is killed before the bucket exists. Objects are written and read while it is down. After the node is started, the same bytes are still returned. **Scenario** 1. **Kill SN1 before any object is written.** The Morph container restart policy is set to no and the Morph container is killed. The bucket and the objects are created only after that. A write that fails is repeated under a new key for up to 120 seconds, and the time until every object was written is recorded. The bucket stays until the node has returned and the objects have been read back. **Observed result** - **Step 1 (Kill SN1 before any object is written):** All 8 objects had been written 0 s after the bucket was created. Repeated writes: 0. While SN1 is killed. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. SN1 is running again. Objects written during the outage are read back. After the node returned. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects.
Command log **Step 1. Kill SN1 before any object is written** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.33 Storage node: kill, stop, pause, isolation, partition, and a bad link **Goal** The policy is replication of 3 copies, with every storage node eligible. Each fault hits one node other than IR1, the inner ring node the client addresses, which leaves two copies of every object reachable. While the fault is held the cluster has to keep reading, writing and deleting objects. Everything acknowledged before and during the fault is read back after it is removed. **Scenario** 1. **Write 8 reference objects.** Reference objects are written through the Morph REST API on IR1, then read back before any fault. 2. **kill on SN1.** The Morph container restart policy is set to no and the Morph container is killed with SIGKILL, so Docker does not start it. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The Morph container is then started and has to become ready. 3. **stop on SN2.** The Morph container is stopped with a 20 second grace period, with the restart policy set to no. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The Morph container is then started. 4. **pause on SN1.** docker pause freezes the Morph container: its connections stay open and nothing answers on them. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The Morph container is then unpaused. 5. **isolate on SN2.** iptables drops traffic between this storage virtual machine and the other storage-type nodes. Inner ring addresses stay reachable. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The rules are then removed. 6. **partition on SN1.** iptables drops traffic between this virtual machine and every other cluster address. The host that applies the fault is not in that set, so the rules can be removed. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. 7. **slow-network on SN2.** tc-netem delays packets this virtual machine sends to the other cluster addresses by 100 ms, with 20 ms of jitter. Traffic back to the host that applies the fault is not shaped. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The qdisc is then removed. 8. **lossy-network on SN1.** tc-netem drops 10 percent of packets this virtual machine sends to the other cluster addresses. Traffic back to the host that applies the fault is not shaped. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. 9. **Read back every acknowledged object.** A final read of the ledger and of the bucket listing, after every fault in this scenario has been cleared. **Observed result** - **Step 1 (Write 8 reference objects):** Before any fault. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (kill on SN1):** During kill on SN1: all 8 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. SN1 is running and reports a ready health metric. After kill on 192.168.42.157. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. - **Step 3 (stop on SN2):** During stop on SN2: all 9 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. SN2 is running and reports a ready health metric. After stop on 192.168.43.139. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. - **Step 4 (pause on SN1):** During pause on SN1: all 10 objects had been read 33 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 50 s. After pause on 192.168.42.157. Morph REST on IR1:80 returned the acknowledged bytes for 11 objects and did not return 3 deleted keys. - **Step 5 (isolate on SN2):** During isolate on SN2: all 11 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. After isolate on 192.168.43.139. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 4 deleted keys. - **Step 6 (partition on SN1):** During partition on SN1: all 12 objects had been read 28 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 90 s. After partition on 192.168.42.157. Morph REST on IR1:80 returned the acknowledged bytes for 13 objects and did not return 5 deleted keys. - **Step 7 (slow-network on SN2):** During slow-network on SN2: all 13 objects had been read 2 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 3 s. After slow-network on 192.168.43.139. Morph REST on IR1:80 returned the acknowledged bytes for 14 objects and did not return 6 deleted keys. - **Step 8 (lossy-network on SN1):** During lossy-network on SN1: all 14 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. After lossy-network on 192.168.42.157. Morph REST on IR1:80 returned the acknowledged bytes for 15 objects and did not return 7 deleted keys. - **Step 9 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 15 objects and did not return 7 deleted keys. The bucket listing (18 keys) names every acknowledged object and no deleted key.
Command log **Step 2. kill on SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. stop on SN2** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 4. pause on SN1** ```shell # SN1 exit 0 $ docker pause morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker unpause morph morph ``` **Step 5. isolate on SN2** ```shell # SN2 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP — # SN2 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 6. partition on SN1** ```shell # SN1 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.43.122 -j DROP iptables -A MORPH_FAULT -d 192.168.43.122 -j DROP iptables -A MORPH_FAULT -s 192.168.43.145 -j DROP iptables -A MORPH_FAULT -d 192.168.43.145 -j DROP iptables -A MORPH_FAULT -s 192.168.43.33 -j DROP iptables -A MORPH_FAULT -d 192.168.43.33 -j DROP iptables -A MORPH_FAULT -s 192.168.42.231 -j DROP iptables -A MORPH_FAULT -d 192.168.42.231 -j DROP iptables -A MORPH_FAULT -s 192.168.43.143 -j DROP iptables -A MORPH_FAULT -d 192.168.43.143 -j DROP iptables -A MORPH_FAULT -s 192.168.43.225 -j DROP iptables -A MORPH_FAULT -d 192.168.43.225 -j DROP iptables -A MORPH_FAULT -s 192.168.42.248 -j DROP iptables -A MORPH_FAULT -d 192.168.42.248 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP iptables -A MORPH_FAULT -s 192.168.42.98 -j DROP iptables -A MORPH_FAULT -d 192.168.42.98 -j DROP — # SN1 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 7. slow-network on SN2** ```shell # SN2 exit 0 $ set -eu iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1) test -n "$iface" dump() { echo "netem setup failed on $iface" >&2 ip link show dev "$iface" >&2 || true tc qdisc show dev "$iface" >&2 || true exit 1 } tc qdisc del dev "$iface" root 2>/dev/null || true tc qdisc add dev "$iface" root handle 1: prio bands 2 priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 || dump tc qdisc replace dev "$iface" parent 1:1 handle 10: netem limit 1000 delay 100ms 20ms || dump tc filter add dev "$iface" protocol ip parent 1: prio 1 u32 match ip dst 192.168.43.122/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 2 u32 match ip dst 192.168.43.145/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 3 u32 match ip dst 192.168.43.33/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 4 u32 match ip dst 192.168.42.231/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 5 u32 match ip dst 192.168.43.143/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 6 u32 match ip dst 192.168.43.225/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 7 u32 match ip dst 192.168.42.248/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 8 u32 match ip dst 192.168.42.157/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 9 u32 match ip dst 192.168.42.98/32 flowid 1:1 || dump — # SN2 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 8. lossy-network on SN1** ```shell # SN1 exit 0 $ set -eu iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1) test -n "$iface" dump() { echo "netem setup failed on $iface" >&2 ip link show dev "$iface" >&2 || true tc qdisc show dev "$iface" >&2 || true exit 1 } tc qdisc del dev "$iface" root 2>/dev/null || true tc qdisc add dev "$iface" root handle 1: prio bands 2 priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 || dump tc qdisc replace dev "$iface" parent 1:1 handle 10: netem limit 1000 loss 10% || dump tc filter add dev "$iface" protocol ip parent 1: prio 1 u32 match ip dst 192.168.43.122/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 2 u32 match ip dst 192.168.43.145/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 3 u32 match ip dst 192.168.43.33/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 4 u32 match ip dst 192.168.42.231/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 5 u32 match ip dst 192.168.43.143/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 6 u32 match ip dst 192.168.43.225/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 7 u32 match ip dst 192.168.42.248/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 8 u32 match ip dst 192.168.43.139/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 9 u32 match ip dst 192.168.42.98/32 flowid 1:1 || dump — # SN1 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ```
--- # Disk and shard faults These eight scenarios cover shard replacement with empty drives, wiped metadata or data files on stopped and running nodes, tombstone retention when an offline holder returns, read-only shard filesystems, and full disks. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.4 Storage node returns with empty drives, replication of 3 copies **Goal** One storage node is stopped and its shard is replaced after the survivors report full redundancy. The policy is replication of 3 copies. The Morph REST API and S3 both have to return the acknowledged bytes, on a healthy cluster and again after the emptied node returns. **Scenario** 1. **Write 8 reference objects.** Reference objects are written through the Morph REST API and read back before the fault. 2. **Healthy cluster serves put, get, head and delete.** Four objects are written, read, and headed. The first two are deleted. S3 GetObject and HeadObject are checked against the same ledger. 3. **Stop IR4 and keep serving.** The storage node that holds the most of these objects is stopped. Object placement names that node. Objects stay readable through REST and S3. A mixed workload runs with retries. The shard is wiped only after the surviving nodes report two further policer passes and full redundancy. 4. **IR4 returns with empty drives.** The Morph container is started. REST and S3 read the ledger again, and every storage node's policer then reports full redundancy. Under replication the shards are searched as well: every object must be stored in its full number of files. 5. **Read back every acknowledged object.** A final REST read of the ledger and of the bucket listing after the node has returned and the fault is cleared. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Healthy cluster serves put, get, head and delete):** After the healthy workload. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. S3 `http://IR1:7130`: GetObject matched 10 objects and HeadObject reported 2 deleted keys absent. Deleted keys: healthy/0, healthy/1. - **Step 3 (Stop IR4 and keep serving):** Selected IR4: it holds 5 of 10 objects. While IR4 is stopped. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. Workload during the outage acknowledged 2 new objects and 2 deletes. Surviving nodes completed two further policer passes with consistency 1. - **Step 4 (IR4 returns with empty drives):** IR4 is running and reports a ready health metric. After the emptied node returned. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 4 deleted keys. S3 `http://IR1:7130`: GetObject matched 12 objects and HeadObject reported 4 deleted keys absent. On disk, each of the 12 objects is stored in 3 files on different nodes again; 5 of them have a copy on 192.168.42.231. Policer placement after the node returned: IR1: consistent=[1.0] optimal=[1.0] IR2: consistent=[1.0] optimal=[1.0] IR3: consistent=[1.0] optimal=[1.0] IR4: consistent=[1.0] optimal=[1.0] IR5: consistent=[1.0] optimal=[1.0] IR6: consistent=[1.0] optimal=[1.0] IR7: consistent=[1.0] optimal=[1.0] SN1: consistent=[1.0] optimal=[1.0] SN2: consistent=[1.0] optimal=[1.0] - **Step 5 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 4 deleted keys. The bucket listing (12 keys) names every acknowledged object and no deleted key.
Command log **Step 3. Stop IR4 and keep serving** ```shell # IR4 exit 0 $ docker update --restart=no morph morph # IR4 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR4 exit 0 $ set -eu find /mnt/morph/data_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + find /mnt/morph/metadata_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + — # IR4 exit 0 $ docker update --restart=always morph morph # IR4 exit 0 $ docker start morph morph ``` **Step 4. IR4 returns with empty drives** ```shell # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] ```
## 5.5 Storage node returns with empty drives, erasure coding 6+2 **Goal** One storage node is stopped and its shard is replaced after the survivors report full redundancy. The policy is erasure coding 6+2. The Morph REST API and S3 both have to return the acknowledged bytes, on a healthy cluster and again after the emptied node returns. **Scenario** 1. **Write 8 reference objects.** Reference objects are written through the Morph REST API and read back before the fault. 2. **Healthy cluster serves put, get, head and delete.** Four objects are written, read, and headed. The first two are deleted. S3 GetObject and HeadObject are checked against the same ledger. 3. **Stop IR2 and keep serving.** The storage node that holds the most of these objects is stopped. Object placement names that node. Objects stay readable through REST and S3. A mixed workload runs with retries. The shard is wiped only after the surviving nodes report two further policer passes and full redundancy. 4. **IR2 returns with empty drives.** The Morph container is started. REST and S3 read the ledger again, and every storage node's policer then reports full redundancy. 5. **Read back every acknowledged object.** A final REST read of the ledger and of the bucket listing after the node has returned and the fault is cleared. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Healthy cluster serves put, get, head and delete):** After the healthy workload. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. S3 `http://IR1:7130`: GetObject matched 10 objects and HeadObject reported 2 deleted keys absent. Deleted keys: healthy/0, healthy/1. - **Step 3 (Stop IR2 and keep serving):** Selected IR2: it holds 10 of 10 objects. While IR2 is stopped. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. Workload during the outage acknowledged 2 new objects and 2 deletes. Surviving nodes completed two further policer passes with consistency 1. - **Step 4 (IR2 returns with empty drives):** IR2 is running and reports a ready health metric. After the emptied node returned. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 4 deleted keys. S3 `http://IR1:7130`: GetObject matched 12 objects and HeadObject reported 4 deleted keys absent. Policer placement after the node returned: IR1: consistent=[1.0] optimal=[1.0] IR2: consistent=[1.0] optimal=[1.0] IR3: consistent=[1.0] optimal=[1.0] IR4: consistent=[1.0] optimal=[1.0] IR5: consistent=[1.0] optimal=[1.0] IR6: consistent=[1.0] optimal=[1.0] IR7: consistent=[1.0] optimal=[1.0] SN1: consistent=[1.0] optimal=[1.0] SN2: consistent=[1.0] optimal=[1.0] - **Step 5 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 12 objects and did not return 4 deleted keys. The bucket listing (12 keys) names every acknowledged object and no deleted key.
Command log **Step 3. Stop IR2 and keep serving** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ set -eu find /mnt/morph/data_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + find /mnt/morph/metadata_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + — # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph ``` **Step 4. IR2 returns with empty drives** ```shell # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.6 Metadata wiped on a storage node; the data files stay **Goal** One storage node is stopped and only its shard metadata directories are emptied. The data files and the node identity stay. After the node starts, every acknowledged object is read back. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back before metadata is removed. 2. **Remove shard metadata on SN1.** The storage node that holds the most of these objects is stopped. Object placement names that node. Metadata bind mounts are emptied. Data bind mounts are left in place. The Morph container is then started. 3. **Read back every acknowledged object.** A final read after the node with empty metadata has returned. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Remove shard metadata on SN1):** Selected SN1: it holds 4 of 8 objects. SN1 is running after its shard metadata was removed. After metadata loss. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 3 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. The bucket listing (8 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Remove shard metadata on SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ set -eu find /mnt/morph/metadata_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + — # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.7 A deleted object stays gone after the node that held a copy returns **Goal** One object is written. A node that holds a copy is stopped with its data and metadata left in place. The object is deleted, and the remaining nodes answer that it is gone. Their policers finish two passes. They cannot report full redundancy while the stopped node still holds unreachable copies. After that node starts and the policers do report full redundancy, the deleted object stays absent. **Scenario** 1. **Delete one object while its holder is stopped.** One object is written. Object placement names the node that stores a copy, and that node is stopped. The object is deleted and a read returns that it is gone. The surviving policers finish two passes while that node is still stopped. It is then started with the metadata it had. After the policers report full redundancy, the delete is read again. **Observed result** - **Step 1 (Delete one object while its holder is stopped):** The copies are on IR4, SN2, 192.168.42.157. Stopping 192.168.42.157. While SN1 is stopped. Morph REST on IR1:80 returned the acknowledged bytes for 0 objects and did not return 1 deleted key. After SN1 returned with its old metadata. keep/00 stays absent. Morph REST on IR1:80 returned the acknowledged bytes for 0 objects and did not return 1 deleted key.
Command log **Step 1. Delete one object while its holder is stopped** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.8 Data files wiped on a stopped storage node are restored **Goal** Objects are stored under replication of 3 copies. The node is stopped, every data file on its shard is deleted, and it is started. Its metadata and its identity are left as they are: this is a disk that lost data. Every object must still be read through every inner ring node. The node is down while the files are missing, and the cluster must put the lost copies back on its own, so that each object is again stored in 3 files on different nodes. The disks are checked for that, not what the nodes report. **Scenario** 1. **Write objects and find their files.** Four 256 KiB objects are written and read back. The node that holds the most of them is chosen, and the scenario waits until that node has moved copies from its write cache into the shard. The objects whose files are in the shard are the ones that are lost and followed. 2. **Lose the data files on IR3.** The node is stopped, every data file on its shard is deleted, and it is started. Every object is then read through the Morph REST API of every inner ring node, with requests repeated for up to 120 seconds. 3. **Wait for the copies to be restored.** The shards of every node are searched until each of the objects that IR3 held is stored in 3 files on different nodes again, for up to 300 seconds. The policers must then report full redundancy. 4. **Read back every acknowledged object.** A final read of the objects and of the bucket listing. **Observed result** - **Step 1 (Write objects and find their files):** IR3 holds 3 of 4 objects. 3 of them are in its shard as one file each: data/00, data/01, data/03. - **Step 2 (Lose the data files on IR3):** With the files gone from IR3, Morph REST on IR1, IR2, IR3, IR4, IR5, IR6, IR7 returned the written bytes of all 4 objects. - **Step 3 (Wait for the copies to be restored):** 24 s later every object was stored in 3 files again: data/00 on IR4, IR5, SN1; data/01 on IR1, SN1, SN2; data/03 on IR4, IR5, 192.168.43.225. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 4 objects. The bucket listing (4 keys) names every acknowledged object and no deleted key.
Command log **Step 1. Write objects and find their files** ```shell # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] ``` **Step 2. Lose the data files on IR3** ```shell # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ set -eu find /mnt/morph/data_1 -type f ! -name .fstree.json ! -name .fstree.json.tmp ! -name lost+found -delete find /mnt/morph/data_1 -depth -type d -empty -delete — # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Wait for the copies to be restored** ```shell # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.9 Data files wiped on a running storage node are restored **Goal** Objects are stored under replication of 3 copies. The files of these objects are deleted from the shard while the node keeps running. Its metadata and its identity are left as they are: this is a disk that lost data. Every object must still be read through every inner ring node. The node keeps answering from its metadata, so the lost file is not a missing replica while it stays up. It is then stopped until the cluster has put the lost copies back, and started again, so that each object is again stored in 3 files on different nodes. The disks are checked for that, not what the nodes report. **Scenario** 1. **Write objects and find their files.** Four 256 KiB objects are written and read back. The node that holds the most of them is chosen, and the scenario waits until that node has moved copies from its write cache into the shard. The objects whose files are in the shard are the ones that are lost and followed. 2. **Lose the data files on IR2.** The files of these objects are deleted from the shard while the node keeps running. Every object is then read through the Morph REST API of every inner ring node, with requests repeated for up to 120 seconds. 3. **Wait for the copies to be restored.** IR2 is stopped while the copies are restored: while it was up it still answered from its metadata, so the lost file was not a missing replica. It is started again once the files are back. The shards of every node are searched until each of the objects that IR2 held is stored in 3 files on different nodes again, for up to 300 seconds. The policers must then report full redundancy. 4. **Read back every acknowledged object.** A final read of the objects and of the bucket listing. **Observed result** - **Step 1 (Write objects and find their files):** IR2 holds 2 of 4 objects. 2 of them are in its shard as one file each: data/00, data/01. - **Step 2 (Lose the data files on IR2):** With the files gone from IR2, Morph REST on IR1, IR2, IR3, IR4, IR5, IR6, IR7 returned the written bytes of all 4 objects. - **Step 3 (Wait for the copies to be restored):** 37 s later every object was stored in 3 files again: data/00 on IR1, IR5, IR6; data/01 on IR1, IR3, 192.168.43.225. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 4 objects. The bucket listing (4 keys) names every acknowledged object and no deleted key.
Command log **Step 1. Write objects and find their files** ```shell # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] ``` **Step 2. Lose the data files on IR2** ```shell # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ set -eu test -f /mnt/morph/data_1/9/z/8/RJCspjYqEZcafb2FjJwYKX6guX4fveuSPsJp6EHRS.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ rm -f /mnt/morph/data_1/9/z/8/RJCspjYqEZcafb2FjJwYKX6guX4fveuSPsJp6EHRS.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ test ! -e /mnt/morph/data_1/9/z/8/RJCspjYqEZcafb2FjJwYKX6guX4fveuSPsJp6EHRS.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ — # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ set -eu test -f /mnt/morph/data_1/D/g/P/FAAP8YMtvHBJax68Kba33zvi7c1XPCsrdZGcqWyvo.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ rm -f /mnt/morph/data_1/D/g/P/FAAP8YMtvHBJax68Kba33zvi7c1XPCsrdZGcqWyvo.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ test ! -e /mnt/morph/data_1/D/g/P/FAAP8YMtvHBJax68Kba33zvi7c1XPCsrdZGcqWyvo.EVAY55Vkhwdw1b46bHci46idoq8j4khFTgjw96AZVaaQ — ``` **Step 3. Wait for the copies to be restored** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.10 Read-only disk on a running node **Goal** A failing disk does not stop the node: writes to its shards fail and the process keeps running. Here writes, creates and deletes on the shard data and metadata of one running node fail with a read-only filesystem error. The cluster must keep reading, writing and deleting. An object that the node holds is deleted while the node cannot record that. After the disk is writable again and the node has been restarted, the delete must still hold, every object must match, and the policers must report full redundancy. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back. The node that holds the most of them is the one whose disk fails. 2. **Make the disk of IR4 read-only.** Writes to the shard mounts fail with a read-only filesystem error, and a test write confirms it. The node process keeps running. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. ref/02, which the node holds, is deleted as well. 3. **Disk of IR4 writable again.** The mounts are made writable and the Morph container is restarted, as after a disk has been repaired or replaced. The node must report ready and the policers must report full redundancy. Every object is read and the delete is checked again: the node still has the deleted object on disk and must not bring it back. 4. **Read back every acknowledged object.** A final read of the objects, the deletes and the bucket listing. **Observed result** - **Step 1 (Write 8 reference objects):** IR4 holds 5 of 8 objects, ref/02 among them. - **Step 2 (Make the disk of IR4 read-only):** During the read-only disk on IR4: all 8 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. /mnt/metadata/metadata_1, /mnt/data/data_1 on IR4 refused writes. The Morph container is running. ref/02 was deleted and is not returned. - **Step 3 (Disk of IR4 writable again):** After the disk of IR4 was repaired. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects and did not return 2 deleted keys. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects and did not return 2 deleted keys. The bucket listing (8 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Make the disk of IR4 read-only** ```shell # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ set -eu python3 - ro /mnt/metadata/metadata_1 /mnt/data/data_1 <<'PY' import os, signal, subprocess, sys, time mode, dests = sys.argv[1], sys.argv[2:] EROFS = 30 def btf_offset(struct, field): current = False for line in raw.splitlines(): if line.startswith("[") and " STRUCT " in line: name = line.split(" STRUCT ", 1)[1].split()[0].strip("'") current = name == struct continue if not current: continue if not line.startswith("\t"): break parts = line.strip().split() if parts[0].strip("'") != field: continue bits = int(parts[-1].split("=")[1]) if bits % 8: raise SystemExit("%s.%s is not byte aligned" % (struct, field)) return bits // 8 raise SystemExit("no BTF offset for %s.%s" % (struct, field)) def container_pid(): out = subprocess.check_output(["docker", "inspect", "-f", "{{.State.Pid}}", "morph"], text=True) return int(out.strip() or "0") def enter(pid): ns = os.open("/proc/%d/ns/mnt" % pid, os.O_RDONLY) os.setns(ns, 0) os.close(ns) def stop_tracer(): try: pid = int(open("/tmp/morph-shard-ro.pid").read()) except (OSError, ValueError): pid = 0 if pid > 0: try: os.kill(pid, signal.SIGTERM) except ProcessLookupError: pid = 0 if pid > 0: for _ in range(50): try: os.kill(pid, 0) except ProcessLookupError: break time.sleep(0.1) else: try: os.kill(pid, signal.SIGKILL) except ProcessLookupError: pass try: os.unlink("/tmp/morph-shard-ro.pid") except OSError: pass def probe(pid, writable): if pid <= 0: if writable: return raise SystemExit("morph is not running") enter(pid) for dest in dests: path = dest + "/.fault-probe" failed = None try: fd = os.open(path, os.O_CREAT | os.O_WRONLY, 0o644) try: os.write(fd, b"x") finally: os.close(fd) except OSError as exc: failed = exc if writable: if failed is not None: raise SystemExit("write %s: %s" % (dest, failed)) os.unlink(path) continue if failed is None or failed.errno != EROFS: raise SystemExit("%s is still writable (%s)" % (dest, failed)) if mode == "rw": stop_tracer() probe(container_pid(), True) raise SystemExit(0) raw = subprocess.check_output(["bpftool", "btf", "dump", "file", "/sys/kernel/btf/vmlinux"], text=True, stderr=subprocess.DEVNULL) files_fdt = btf_offset("files_struct", "fdt") fdtable_fd = btf_offset("fdtable", "fd") # struct path is randomized on some kernels, so the vfsmount is not assumed to be first. file_mnt = btf_offset("file", "f_path") + btf_offset("path", "mnt") mnt_root = btf_offset("vfsmount", "mnt_root") dentry_inode = btf_offset("dentry", "d_inode") inode_ino = btf_offset("inode", "i_ino") name_at = btf_offset("dentry", "d_name") + btf_offset("qstr", "name") # Each shard is a bind mount of a directory on one disk: /mnt/morph/data_1 is # /mnt/data/data_1 in the container. That directory is the mount root, so its # inode is what stat of the container path reports. The directory name is # checked as well. host_pid = container_pid() if host_pid <= 0: raise SystemExit("morph is not running") inos = [] for dest in dests: try: inos.append(os.stat("/proc/%d/root%s" % (host_pid, dest)).st_ino) except OSError: pass names = sorted({os.path.basename(dest) for dest in dests}) prefixes = sorted({dest[:16] for dest in dests}) ino_test = " || ".join("$ino == %d" % ino for ino in inos) or "0" name_test = " || ".join('$name == "%s"' % name for name in names) prefix_test = " || ".join('$path == "%s"' % prefix for prefix in prefixes) program = ''' kprobe:__x64_sys_write, kprobe:__x64_sys_pwrite64, kprobe:__x64_sys_writev, kprobe:__x64_sys_pwritev, kprobe:__x64_sys_pwritev2, kprobe:__x64_sys_fallocate, kprobe:__x64_sys_ftruncate, kprobe:__x64_sys_fsync, kprobe:__x64_sys_fdatasync { $regs = (struct pt_regs *)arg0; $fd = $regs->di; $files = (uint64)curtask->files; $fdt = *(uint64 *)($files + %d); $fds = *(uint64 *)($fdt + %d); $file = *(uint64 *)($fds + ($fd << 3)); if ($file == 0) { return; } $mnt = *(uint64 *)($file + %d); if ($mnt == 0) { return; } $root = *(uint64 *)($mnt + %d); $inode = *(uint64 *)($root + %d); $ino = *(uint64 *)($inode + %d); $name = str(*(uint64 *)($root + %d)); if (%s || %s) { override(-30); } } tracepoint:syscalls:sys_enter_openat { $path = str(args->filename, 16); if (((args->flags & 3) != 0 || (args->flags & 64) != 0 || (args->flags & 512) != 0) && (%s)) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_creat { $path = str(args->pathname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_unlinkat, tracepoint:syscalls:sys_enter_mkdirat { $path = str(args->pathname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_linkat, tracepoint:syscalls:sys_enter_renameat, tracepoint:syscalls:sys_enter_renameat2 { $path = str(args->newname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_renameat, tracepoint:syscalls:sys_enter_renameat2 { $path = str(args->oldname, 16); if (%s) { @fail[tid] = 1; } } kprobe:__x64_sys_openat, kprobe:__x64_sys_creat, kprobe:__x64_sys_unlinkat, kprobe:__x64_sys_mkdirat, kprobe:__x64_sys_linkat, kprobe:__x64_sys_renameat, kprobe:__x64_sys_renameat2 /@fail[tid]/ { delete(@fail[tid]); override(-30); } ''' % (files_fdt, fdtable_fd, file_mnt, mnt_root, dentry_inode, inode_ino, name_at, ino_test, name_test, prefix_test, prefix_test, prefix_test, prefix_test, prefix_test) open("/tmp/morph-shard-ro.bt", "w").write(program) # Opened before the tracer, through the container's mounts. The check below writes # these descriptors, which is what a node with the shard already open does. probe_fds = [] for dest in dests: try: probe_fds.append(os.open("/proc/%d/root%s/.fault-probe" % (host_pid, dest), os.O_CREAT | os.O_WRONLY, 0o644)) except OSError as exc: raise SystemExit("open %s: %s" % (dest, exc)) stop_tracer() log = open("/tmp/morph-shard-ro.log", "w") proc = subprocess.Popen( ["bpftrace", "--unsafe", "/tmp/morph-shard-ro.bt"], stdin=subprocess.DEVNULL, stdout=log, stderr=subprocess.STDOUT, start_new_session=True, ) log.close() seen = "" for _ in range(50): time.sleep(0.1) seen = open("/tmp/morph-shard-ro.log").read() if "ERROR" in seen or "error:" in seen: stop_tracer() try: os.kill(proc.pid, signal.SIGTERM) except ProcessLookupError: pass raise SystemExit(seen) if proc.poll() is None and ("Attached" in seen or "Attaching" in seen): break else: try: os.kill(proc.pid, signal.SIGTERM) except ProcessLookupError: pass raise SystemExit("bpftrace did not attach\n" + seen) open("/tmp/morph-shard-ro.pid", "w").write(str(proc.pid)) # "Attaching N probes..." is printed before the probes are live. Retry the # write until one is rejected, instead of trusting the first attempt. def writes_fail(): for dest, fd in zip(dests, probe_fds): failed = None try: os.write(fd, b"x") except OSError as exc: failed = exc if failed is None or failed.errno != EROFS: raise SystemExit("%s is still writable (%s)" % (dest, failed)) deadline = time.monotonic() + 3 error = None while True: try: writes_fail() error = None break except SystemExit as exc: error = exc if "still writable" not in str(exc) or time.monotonic() >= deadline: break time.sleep(0.1) for fd in probe_fds: os.close(fd) if error is not None: stop_tracer() try: logged = open("/tmp/morph-shard-ro.log").read() except OSError: logged = "" raise SystemExit("%s\n%s" % (error, logged)) print("tracer %d" % proc.pid) PY tracer 10790 # IR4 exit 0 $ set -eu python3 - rw /mnt/metadata/metadata_1 /mnt/data/data_1 <<'PY' import os, signal, subprocess, sys, time mode, dests = sys.argv[1], sys.argv[2:] EROFS = 30 def btf_offset(struct, field): current = False for line in raw.splitlines(): if line.startswith("[") and " STRUCT " in line: name = line.split(" STRUCT ", 1)[1].split()[0].strip("'") current = name == struct continue if not current: continue if not line.startswith("\t"): break parts = line.strip().split() if parts[0].strip("'") != field: continue bits = int(parts[-1].split("=")[1]) if bits % 8: raise SystemExit("%s.%s is not byte aligned" % (struct, field)) return bits // 8 raise SystemExit("no BTF offset for %s.%s" % (struct, field)) def container_pid(): out = subprocess.check_output(["docker", "inspect", "-f", "{{.State.Pid}}", "morph"], text=True) return int(out.strip() or "0") def enter(pid): ns = os.open("/proc/%d/ns/mnt" % pid, os.O_RDONLY) os.setns(ns, 0) os.close(ns) def stop_tracer(): try: pid = int(open("/tmp/morph-shard-ro.pid").read()) except (OSError, ValueError): pid = 0 if pid > 0: try: os.kill(pid, signal.SIGTERM) except ProcessLookupError: pid = 0 if pid > 0: for _ in range(50): try: os.kill(pid, 0) except ProcessLookupError: break time.sleep(0.1) else: try: os.kill(pid, signal.SIGKILL) except ProcessLookupError: pass try: os.unlink("/tmp/morph-shard-ro.pid") except OSError: pass def probe(pid, writable): if pid <= 0: if writable: return raise SystemExit("morph is not running") enter(pid) for dest in dests: path = dest + "/.fault-probe" failed = None try: fd = os.open(path, os.O_CREAT | os.O_WRONLY, 0o644) try: os.write(fd, b"x") finally: os.close(fd) except OSError as exc: failed = exc if writable: if failed is not None: raise SystemExit("write %s: %s" % (dest, failed)) os.unlink(path) continue if failed is None or failed.errno != EROFS: raise SystemExit("%s is still writable (%s)" % (dest, failed)) if mode == "rw": stop_tracer() probe(container_pid(), True) raise SystemExit(0) raw = subprocess.check_output(["bpftool", "btf", "dump", "file", "/sys/kernel/btf/vmlinux"], text=True, stderr=subprocess.DEVNULL) files_fdt = btf_offset("files_struct", "fdt") fdtable_fd = btf_offset("fdtable", "fd") # struct path is randomized on some kernels, so the vfsmount is not assumed to be first. file_mnt = btf_offset("file", "f_path") + btf_offset("path", "mnt") mnt_root = btf_offset("vfsmount", "mnt_root") dentry_inode = btf_offset("dentry", "d_inode") inode_ino = btf_offset("inode", "i_ino") name_at = btf_offset("dentry", "d_name") + btf_offset("qstr", "name") # Each shard is a bind mount of a directory on one disk: /mnt/morph/data_1 is # /mnt/data/data_1 in the container. That directory is the mount root, so its # inode is what stat of the container path reports. The directory name is # checked as well. host_pid = container_pid() if host_pid <= 0: raise SystemExit("morph is not running") inos = [] for dest in dests: try: inos.append(os.stat("/proc/%d/root%s" % (host_pid, dest)).st_ino) except OSError: pass names = sorted({os.path.basename(dest) for dest in dests}) prefixes = sorted({dest[:16] for dest in dests}) ino_test = " || ".join("$ino == %d" % ino for ino in inos) or "0" name_test = " || ".join('$name == "%s"' % name for name in names) prefix_test = " || ".join('$path == "%s"' % prefix for prefix in prefixes) program = ''' kprobe:__x64_sys_write, kprobe:__x64_sys_pwrite64, kprobe:__x64_sys_writev, kprobe:__x64_sys_pwritev, kprobe:__x64_sys_pwritev2, kprobe:__x64_sys_fallocate, kprobe:__x64_sys_ftruncate, kprobe:__x64_sys_fsync, kprobe:__x64_sys_fdatasync { $regs = (struct pt_regs *)arg0; $fd = $regs->di; $files = (uint64)curtask->files; $fdt = *(uint64 *)($files + %d); $fds = *(uint64 *)($fdt + %d); $file = *(uint64 *)($fds + ($fd << 3)); if ($file == 0) { return; } $mnt = *(uint64 *)($file + %d); if ($mnt == 0) { return; } $root = *(uint64 *)($mnt + %d); $inode = *(uint64 *)($root + %d); $ino = *(uint64 *)($inode + %d); $name = str(*(uint64 *)($root + %d)); if (%s || %s) { override(-30); } } tracepoint:syscalls:sys_enter_openat { $path = str(args->filename, 16); if (((args->flags & 3) != 0 || (args->flags & 64) != 0 || (args->flags & 512) != 0) && (%s)) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_creat { $path = str(args->pathname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_unlinkat, tracepoint:syscalls:sys_enter_mkdirat { $path = str(args->pathname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_linkat, tracepoint:syscalls:sys_enter_renameat, tracepoint:syscalls:sys_enter_renameat2 { $path = str(args->newname, 16); if (%s) { @fail[tid] = 1; } } tracepoint:syscalls:sys_enter_renameat, tracepoint:syscalls:sys_enter_renameat2 { $path = str(args->oldname, 16); if (%s) { @fail[tid] = 1; } } kprobe:__x64_sys_openat, kprobe:__x64_sys_creat, kprobe:__x64_sys_unlinkat, kprobe:__x64_sys_mkdirat, kprobe:__x64_sys_linkat, kprobe:__x64_sys_renameat, kprobe:__x64_sys_renameat2 /@fail[tid]/ { delete(@fail[tid]); override(-30); } ''' % (files_fdt, fdtable_fd, file_mnt, mnt_root, dentry_inode, inode_ino, name_at, ino_test, name_test, prefix_test, prefix_test, prefix_test, prefix_test, prefix_test) open("/tmp/morph-shard-ro.bt", "w").write(program) # Opened before the tracer, through the container's mounts. The check below writes # these descriptors, which is what a node with the shard already open does. probe_fds = [] for dest in dests: try: probe_fds.append(os.open("/proc/%d/root%s/.fault-probe" % (host_pid, dest), os.O_CREAT | os.O_WRONLY, 0o644)) except OSError as exc: raise SystemExit("open %s: %s" % (dest, exc)) stop_tracer() log = open("/tmp/morph-shard-ro.log", "w") proc = subprocess.Popen( ["bpftrace", "--unsafe", "/tmp/morph-shard-ro.bt"], stdin=subprocess.DEVNULL, stdout=log, stderr=subprocess.STDOUT, start_new_session=True, ) log.close() seen = "" for _ in range(50): time.sleep(0.1) seen = open("/tmp/morph-shard-ro.log").read() if "ERROR" in seen or "error:" in seen: stop_tracer() try: os.kill(proc.pid, signal.SIGTERM) except ProcessLookupError: pass raise SystemExit(seen) if proc.poll() is None and ("Attached" in seen or "Attaching" in seen): break else: try: os.kill(proc.pid, signal.SIGTERM) except ProcessLookupError: pass raise SystemExit("bpftrace did not attach\n" + seen) open("/tmp/morph-shard-ro.pid", "w").write(str(proc.pid)) # "Attaching N probes..." is printed before the probes are live. Retry the # write until one is rejected, instead of trusting the first attempt. def writes_fail(): for dest, fd in zip(dests, probe_fds): failed = None try: os.write(fd, b"x") except OSError as exc: failed = exc if failed is None or failed.errno != EROFS: raise SystemExit("%s is still writable (%s)" % (dest, failed)) deadline = time.monotonic() + 3 error = None while True: try: writes_fail() error = None break except SystemExit as exc: error = exc if "still writable" not in str(exc) or time.monotonic() >= deadline: break time.sleep(0.1) for fd in probe_fds: os.close(fd) if error is not None: stop_tracer() try: logged = open("/tmp/morph-shard-ro.log").read() except OSError: logged = "" raise SystemExit("%s\n%s" % (error, logged)) print("tracer %d" % proc.pid) PY — ``` **Step 3. Disk of IR4 writable again** ```shell # IR4 exit 0 $ docker update --restart=no morph morph # IR4 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR4 exit 0 $ docker update --restart=always morph morph # IR4 exit 0 $ docker start morph morph # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.11 Full disk on a storage node **Goal** The filesystem that holds one storage-type node's data is filled until it accepts no more writes. The node keeps running. The cluster must keep reading every object, and must keep writing and deleting by using the other nodes. After the space is freed and the node is restarted, it must report ready, the policers must report full redundancy, and every acknowledged object and delete must hold. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back. The storage-type node that holds the most of them is the one whose disk fills up. 2. **Fill the disk of SN1.** A file is preallocated for nearly all free space of the filesystem under the shard data, the rest is written out, and a test write confirms that the filesystem is full. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. Six more objects are written while the disk is full. The file is then removed. 3. **Free the disk of SN1.** With the space free again, the Morph container is restarted. The node must report ready and the policers must report full redundancy, which includes the objects written while it could not store anything. Every object and delete is then checked. 4. **Read back every acknowledged object.** A final read of the objects, the deletes and the bucket listing. **Observed result** - **Step 1 (Write 8 reference objects):** SN1 holds 3 of 8 objects. - **Step 2 (Fill the disk of SN1):** Filled /mnt/morph: 115640139776 bytes were free, 1044480 left. During the full disk on SN1: all 8 objects had been read 0 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 0 s. With the disk of SN1 full, all 15 objects were read and six new ones were stored. The Morph container is running. - **Step 3 (Free the disk of SN1):** After the disk of SN1 was freed. Morph REST on IR1:80 returned the acknowledged bytes for 15 objects and did not return 1 deleted key. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 15 objects and did not return 1 deleted key. The bucket listing (15 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Fill the disk of SN1** ```shell # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ set -eu root=$(df --output=target /mnt/morph/data_1 | tail -n 1) file="$root/.morph-fault-filler" avail=$(df --output=avail -B1 "$root" | tail -n 1 | tr -d " ") if [ "$avail" -gt 134217728 ]; then fallocate -l $((avail - 67108864)) "$file"; fi dd if=/dev/zero of="$file.tail" bs=1M 2>/dev/null || true if dd if=/dev/zero of="$file.probe" bs=1M count=4 conv=fsync 2>/dev/null; then rm -f "$file.probe"; echo "filesystem $root still accepts writes" >&2; exit 1 fi rm -f "$file.probe" echo "$root: $avail bytes were free, $(df --output=avail -B1 "$root" | tail -n 1 | tr -d " ") left" /mnt/morph: 115640139776 bytes were free, 1044480 left # SN1 exit 0 $ set -eu root=$(df --output=target /mnt/morph/data_1 | tail -n 1) rm -f "$root/.morph-fault-filler" "$root/.morph-fault-filler.tail" "$root/.morph-fault-filler.probe" — ``` **Step 3. Free the disk of SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
--- # Erasure coding and rebuild These five scenarios cover erasure coding `6+2` under single- and multi-node part loss, losing more parts than parity can rebuild, and permanent storage-node loss with verified redundancy rebuild under both `rep-3` and `ec-6-2`. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.12 Erasure-coded object stays readable after part-holders are lost, and the parts are rebuilt **Goal** Each inner ring node is also a storage node. The policy is erasure coding 6+2: an object is stored as 8 parts on 8 nodes and can be rebuilt without any 2 of them. The object is written and object placement names the nodes that hold a part. 2 of them are killed. The IR1 stays up, and no more inner ring nodes are killed than consensus allows. The object is read back while they are down. Their shards are then emptied, they are started, and the policer has to restore the parts. To prove that it did, 2 other part-holders are then killed: with the first nodes' parts missing that would leave too few parts to rebuild the object. **Scenario** 1. **Lose 2 part-holders.** The object is written, and object placement names the part-holders. 2 of them are killed with SIGKILL, so the holders that stay up can still rebuild the object. The object is read back. The killed nodes' shard bind mounts are emptied and the Morph containers are started. The policer then gets two passes to put the lost parts back, and the object is read again. 2. **Kill IR3, IR4: the rebuilt parts are needed.** IR3, IR4 hold parts of the same object and are killed with SIGKILL. That leaves 6 parts only if the parts lost with SN2, SN1 were rebuilt; had they not been, the object could not be read. The object is read, and the killed nodes are started. **Observed result** - **Step 1 (Lose 2 part-holders):** Parts are on IR3, IR4, SN2, IR2, SN1, IR5, IR1, 192.168.42.248. Killing SN2, 192.168.42.157. While SN2, SN1 are killed. Morph REST on IR1:80 returned the acknowledged bytes for 1 object. SN2 is running after its shard was emptied. SN1 is running after its shard was emptied. The policer finished two passes after the emptied nodes returned. After the parts were restored. Morph REST on IR1:80 returned the acknowledged bytes for 1 object. - **Step 2 (Kill IR3, IR4: the rebuilt parts are needed):** While IR3, IR4 are killed. Morph REST on IR1:80 returned the acknowledged bytes for 1 object.
Command log **Step 1. Lose 2 part-holders** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # SN2 exit 0 $ set -eu find /mnt/morph/data_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + find /mnt/morph/metadata_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + — # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ set -eu find /mnt/morph/data_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + find /mnt/morph/metadata_1 -mindepth 1 -maxdepth 1 ! -name lost+found -exec rm -rf {} + — # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 2. Kill IR3, IR4: the rebuilt parts are needed** ```shell # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # IR4 exit 0 $ docker update --restart=no morph morph # IR4 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR4 exit 0 $ docker update --restart=always morph morph # IR4 exit 0 $ docker start morph morph ```
## 5.13 Write and delete while an erasure-coding part-holder is down **Goal** The policy is erasure coding 6+2. One node that holds a part is killed. While it is down, the object is deleted and a new object is written, which needs 8 of the remaining nodes. The disks are not emptied. After the node starts, the deleted object stays absent. A read of the new object returns the written bytes, or the read fails: the part that belonged on the killed node was not stored, and a part stored on a node that stayed up can sit in the metabase with a blob that node cannot read. A different body fails the test. **Scenario** 1. **Write and delete while one part-holder is killed.** One object is written and a node that holds a part is killed with SIGKILL. That object is deleted and a new object is written. The Morph container is started without emptying its storage. The node reports ready. The deleted object stays absent. The new object is the written bytes, or the read fails without returning a different body. **Observed result** - **Step 1 (Write and delete while one part-holder is killed):** Parts are on IR7, IR3, IR4, SN2, IR2, IR5, IR6, 192.168.43.122. Killing 192.168.43.139. While SN2 is killed, the write of ec/during and the delete of ec/00 were acknowledged. A read returned the written bytes or nothing, and the deleted key did not come back. After SN2 returned, ec/00 stayed absent. A read of ec/during did not complete: the part for the killed node was not stored, and a part on a node that stayed up is in the metabase with a blob that node cannot read. No different body was returned.
Command log **Step 1. Write and delete while one part-holder is killed** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.14 Losing one more erasure-coding part than the policy can rebuild **Goal** The policy is erasure coding 6+2, which stores 8 parts. 3 nodes that hold a part are killed, one more than the rule can rebuild, and their disks are left intact. A read during the outage is either the written bytes or a miss. After the nodes start, the written bytes are back. **Scenario** 1. **Kill 3 part-holders and read.** One object is written. 3 nodes that hold its parts are killed with SIGKILL. Each read is exact or missing, and a different body fails the test. The Morph containers are started without emptying storage, and the object is read back. **Observed result** - **Step 1 (Kill 3 part-holders and read):** Parts are on IR3, IR5, IR4, SN2, IR1, IR6, IR7, 192.168.42.157. Killing SN2, SN1, 192.168.43.33. While SN2, SN1, IR3 were killed, every answer was exact or missing. After the part-holders returned. Morph REST on IR1:80 returned the acknowledged bytes for 1 object.
Command log **Step 1. Kill 3 part-holders and read** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.27 Permanent loss of a storage node; redundancy is rebuilt, replication of 3 copies **Goal** The policy is replication of 3 copies. 256 MiB are stored in 64 objects. One storage node is stopped and does not come back. The other nodes must restore full redundancy on their own, and the time that takes is recorded. The data stays readable throughout. To prove the redundancy is real, 2 further nodes that held the same object are then killed, which the policy tolerates only if the lost copies or parts were rebuilt elsewhere, and every object must still be read. The lost node is started again only at the end, to leave a complete cluster. **Scenario** 1. **Store 256 MiB.** 64 objects of 4 MiB are written and read back. One more object is written until object placement puts it on nodes that can be stopped together: the node to lose and 2 more. That object is the one whose only surviving source will be the rebuilt data. 2. **Lose SN1 and wait for the rebuild.** The Morph container is stopped and stays stopped. Every object is read at once, with requests repeated for up to 120 seconds. The shards of the remaining nodes are then searched until every object is stored in 3 files on 3 different nodes: this looks at the disks, not at what the nodes report. 3. **Kill IR5, IR3 and read everything.** With SN1 still gone, IR5, IR3 are killed with SIGKILL. Together these are more holders of tracked/01 than the policy can lose, unless what SN1 held was rebuilt on another node. Every object is read; the same holds for any other object placed on these nodes. The killed nodes are then started. 4. **Start SN1 again.** The scenario is over; the node is started so that the next scenario has a complete cluster. It returns with the data it had, which is now surplus. The policers must report full redundancy, and every object and the bucket listing are checked once more. **Observed result** - **Step 1 (Store 256 MiB):** 256 MiB were written in 5 s. tracked/01 is stored on IR5, SN1, 192.168.43.33. The node to lose is SN1, which holds a copy of 27 of the 64 objects. The nodes killed later are IR5, 192.168.43.33. - **Step 2 (Lose SN1 and wait for the rebuild):** All 65 objects had been read 1 s after SN1 was lost. Redundancy was complete again after 20 s for the 27 objects that had lost a copy. tracked/01 is now on IR2, IR3, 192.168.43.143. - **Step 3 (Kill IR5, IR3 and read everything):** With SN1 and IR5, IR3 down, tracked/01 and all 64 objects of the volume matched, 1 s after the kill. - **Step 4 (Start SN1 again):** The bucket listing (65 keys) names every acknowledged object and no deleted key.
Command log **Step 1. Store 256 MiB** ```shell # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] ``` **Step 2. Lose SN1 and wait for the rebuild** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] ``` **Step 3. Kill IR5, IR3 and read everything** ```shell # IR5 exit 0 $ docker update --restart=no morph morph # IR5 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # IR5 exit 0 $ docker update --restart=always morph morph # IR5 exit 0 $ docker start morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 4. Start SN1 again** ```shell # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.28 Permanent loss of a storage node; redundancy is rebuilt, erasure coding 6+2 **Goal** The policy is erasure coding 6+2. 256 MiB are stored in 64 objects. One storage node is stopped and does not come back. The other nodes must restore full redundancy on their own, and the time that takes is recorded. The data stays readable throughout. To prove the redundancy is real, 2 further nodes that held the same object are then killed, which the policy tolerates only if the lost copies or parts were rebuilt elsewhere, and every object must still be read. The lost node is started again only at the end, to leave a complete cluster. **Scenario** 1. **Store 256 MiB.** 64 objects of 4 MiB are written and read back. One more object is written until object placement puts it on nodes that can be stopped together: the node to lose and 2 more. That object is the one whose only surviving source will be the rebuilt data. 2. **Lose SN1 and wait for the rebuild.** The Morph container is stopped and stays stopped. Every object is read at once, with requests repeated for up to 120 seconds. The lost node has to leave the network map, and the policer then gets two passes to place the missing parts on the nodes that remain. Parts are stored under ids of their own, so the disks cannot be checked object by object; the next step is the proof. 3. **Kill SN2, IR3 and read everything.** With SN1 still gone, SN2, IR3 are killed with SIGKILL. Together these are more holders of tracked/00 than the policy can lose, unless what SN1 held was rebuilt on another node. Every object is read; the same holds for any other object placed on these nodes. The killed nodes are then started. 4. **Start SN1 again.** The scenario is over; the node is started so that the next scenario has a complete cluster. It returns with the data it had, which is now surplus. The policers must report full redundancy, and every object and the bucket listing are checked once more. **Observed result** - **Step 1 (Store 256 MiB):** 256 MiB were written in 5 s. tracked/00 is stored on IR3, IR2, IR1, SN1, SN2, IR6, IR4, 192.168.43.143. The node to lose is 192.168.42.157. The nodes killed later are SN2, 192.168.43.33. - **Step 2 (Lose SN1 and wait for the rebuild):** All 65 objects had been read 2 s after SN1 was lost. Redundancy was complete again after 226 s. SN1 has left the network map, and the policer has finished two passes. The next step is the proof that the parts were placed again. - **Step 3 (Kill SN2, IR3 and read everything):** With SN1 and SN2, IR3 down, tracked/00 and all 64 objects of the volume matched, 2 s after the kill. - **Step 4 (Start SN1 again):** The bucket listing (65 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Lose SN1 and wait for the rebuild** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Kill SN2, IR3 and read everything** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph ``` **Step 4. Start SN1 again** ```shell # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
--- # Inner ring faults These four scenarios cover inner ring node kills, RPC delay, isolation from storage-type nodes, quorum loss, client endpoint failover off `IR1`, a 5-vs-2 inner ring network split, and wiping an inner ring node's FS chain database. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.15 One inner ring node down, a slow link, isolation from storage, and a lost quorum **Goal** With seven inner ring nodes, consensus tolerates two. Killing one node must leave the FS chain producing blocks and the objects readable. While one node is delayed, and while the inner ring is separated from the storage-type nodes, objects must still be read, written and deleted. Killing one more node than consensus tolerates (three nodes) must stop the chain until those nodes are started again, and even then objects must be read and written: storing an object does not need a block. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back before any inner ring fault. 2. **Kill inner ring node IR2.** One inner ring Morph container other than IR1 is killed with SIGKILL. IR1 is the node the test client addresses; every inner ring node can serve the same requests. The FS chain must advance, and the objects must stay readable. The Morph container is then started. 3. **Delay RPC from inner ring node IR2.** tc-netem delays packets this inner ring virtual machine sends to the other cluster addresses by 500 ms, with 100 ms of jitter. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. 4. **Isolate the inner ring from storage-type nodes.** iptables on every inner ring virtual machine drops traffic to the storage-type nodes. Inner ring nodes still reach each other, and each of them stores objects, so at least one copy of every object stays on their side. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The rules are then removed. 5. **Kill inner ring quorum IR5, IR6, IR7.** One more inner ring node is killed than consensus tolerates. IR1, which the client uses for REST and the FS chain RPC, stays up. The block height must not advance while the quorum is down. The killed nodes also store objects, so an object whose every copy is on them cannot be read until they return. Every other object must be read, and a new object must be written and read back, with requests repeated for up to 120 seconds. After the nodes start, the chain must advance and every object must match. 6. **Read back every acknowledged object.** A final REST read of the ledger and of the bucket listing after every inner ring fault has been cleared. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Kill inner ring node IR2):** FS chain RPC on IR1:7112 moved from block 503 to 505. While IR2 is killed. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. IR2 is running and reports ready inner ring and storage health. After IR2 returned. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 3 (Delay RPC from inner ring node IR2):** During the delay on IR2: all 8 objects had been read 5 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 12 s. After the delay was removed. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. - **Step 4 (Isolate the inner ring from storage-type nodes):** During the isolation of the inner ring from storage-type nodes: all 9 objects had been read 27 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 35 s. After inner ring isolation was removed. Morph REST on IR1:80 returned the acknowledged bytes for 10 objects and did not return 2 deleted keys. - **Step 5 (Kill inner ring quorum IR5, IR6, IR7):** FS chain height stayed at 515 for 10s while IR5, IR6, IR7 were killed. Without a quorum, 10 of 10 objects have a copy outside the killed nodes and all of them were read. during/quorum-lost (65536 bytes) was written and read back 13 s after the nodes were killed. IR5 is running and reports ready inner ring and storage health. IR6 is running and reports ready inner ring and storage health. IR7 is running and reports ready inner ring and storage health. FS chain resumed, from block 527 to 528. After the quorum returned. Morph REST on IR1:80 returned the acknowledged bytes for 11 objects and did not return 2 deleted keys. - **Step 6 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 11 objects and did not return 2 deleted keys. The bucket listing (11 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Kill inner ring node IR2** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker kill morph morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Delay RPC from inner ring node IR2** ```shell # IR2 exit 0 $ set -eu iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1) test -n "$iface" dump() { echo "netem setup failed on $iface" >&2 ip link show dev "$iface" >&2 || true tc qdisc show dev "$iface" >&2 || true exit 1 } tc qdisc del dev "$iface" root 2>/dev/null || true tc qdisc add dev "$iface" root handle 1: prio bands 2 priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 || dump tc qdisc replace dev "$iface" parent 1:1 handle 10: netem limit 1000 delay 500ms 100ms || dump tc filter add dev "$iface" protocol ip parent 1: prio 1 u32 match ip dst 192.168.43.122/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 2 u32 match ip dst 192.168.43.33/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 3 u32 match ip dst 192.168.42.231/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 4 u32 match ip dst 192.168.43.143/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 5 u32 match ip dst 192.168.43.225/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 6 u32 match ip dst 192.168.42.248/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 7 u32 match ip dst 192.168.42.157/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 8 u32 match ip dst 192.168.43.139/32 flowid 1:1 || dump tc filter add dev "$iface" protocol ip parent 1: prio 9 u32 match ip dst 192.168.42.98/32 flowid 1:1 || dump — # IR2 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 4. Isolate the inner ring from storage-type nodes** ```shell # IR1 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR2 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR3 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR4 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR5 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR6 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR7 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP — # IR1 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR2 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR3 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR4 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR5 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR6 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR7 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 5. Kill inner ring quorum IR5, IR6, IR7** ```shell # IR5 exit 0 $ docker update --restart=no morph morph # IR5 exit 0 $ docker kill morph morph # IR6 exit 0 $ docker update --restart=no morph morph # IR6 exit 0 $ docker kill morph morph # IR7 exit 0 $ docker update --restart=no morph morph # IR7 exit 0 $ docker kill morph morph # IR5 exit 0 $ docker update --restart=always morph morph # IR5 exit 0 $ docker start morph morph # IR6 exit 0 $ docker update --restart=always morph morph # IR6 exit 0 $ docker start morph morph # IR7 exit 0 $ docker update --restart=always morph morph # IR7 exit 0 $ docker start morph morph # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.16 The inner ring node the client is using goes down **Goal** Inner ring nodes are peers. Each one serves the API and the FS chain. The test client addresses IR1, and the other scenarios leave that node running. This scenario stops it. The Morph API on IR2 must keep reading, writing and deleting objects, and the FS chain must keep producing blocks. After the stopped node starts, it must serve every acknowledged object again. **Scenario** 1. **Write 8 reference objects.** Reference objects are written through IR1 and read back through IR2, so the second API is known to work before the fault. 2. **Kill inner ring node IR1.** The Morph container on IR1 is killed with SIGKILL. Every request goes to IR2 until it is started again. The FS chain must advance, the reference objects must be read, a new object must be written and read, and one reference object must be deleted. A request is retried while the cluster drops its connections to the dead node. 3. **Read back every acknowledged object.** A final REST read through IR1 and through 192.168.43.145. It includes the object written and the key deleted while IR1 was down. The bucket listing is checked against the same objects. **Observed result** - **Step 1 (Write 8 reference objects):** Morph REST on IR2:80 returned the bytes of all 8 objects written through 192.168.43.122. - **Step 2 (Kill inner ring node IR1):** FS chain RPC on IR2:7112 moved from block 537 to 538. While IR1 was killed, Morph REST on IR2:80 returned the bytes of 8 objects, stored during/ir-down (65536 bytes), deleted ref/00, and did not return the deleted key. IR1 is running, reports ready inner ring and storage health, and its Morph REST answers. FS chain RPC on IR1:7112 moved from block 550 to 551. After IR1 returned. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects and did not return 1 deleted key. - **Step 3 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects and did not return 1 deleted key. The bucket listing (8 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Kill inner ring node IR1** ```shell # IR1 exit 0 $ docker update --restart=no morph morph # IR1 exit 0 $ docker kill morph morph # IR1 exit 0 $ docker update --restart=always morph morph # IR1 exit 0 $ docker start morph morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.17 Network split of the inner ring: the majority keeps serving **Goal** The network is split in two. 2 inner ring nodes (IR6, IR7) are cut off from every other node; the other 5 inner ring nodes and the storage-type nodes stay together. The larger side has a consensus quorum: its chain must keep producing blocks and it must keep reading, writing and deleting objects. The smaller side must not produce blocks of its own. A write it acknowledges has to exist after the network heals; refusing the write is correct too. After the split is removed, the nodes that were cut off must catch up with the chain and every acknowledged object must match on both sides. **Scenario** 1. **Write 8 reference objects.** Reference objects are written through IR1 and read back through IR6, so the API of the node that will be cut off is known to work before the split. 2. **Cut IR6, IR7 off from the rest.** iptables on IR6, IR7 drops traffic to and from every other cluster address. Those nodes still reach each other and the host that applies the fault. On the larger side the chain must advance. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. On the smaller side one block that was already agreed may still be applied. After that the height is read, then read again 10 seconds later, and must not have moved; one write is attempted through its API and its outcome is recorded; a read through it must return the written bytes or nothing. 3. **Heal the split.** The iptables rules are removed. Each node that was cut off must reach the block height of the larger side and report ready inner ring and storage health. Every acknowledged object is then read through IR1 and through a node that was cut off, and the policers must report full redundancy. 4. **Read back every acknowledged object.** A final read of the ledger and of the bucket listing after the network has healed. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Cut IR6, IR7 off from the rest):** Larger side: FS chain RPC on IR1 moved from block 556 to 557. During the split, on the larger side: all 8 objects had been read 42 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 59 s. Smaller side: block height across the split was IR6: 556 -> 556, IR7: 556 -> 556. After it settled, the height stayed at IR6 at 556, IR7 at 556 for 10 s, while the larger side reached 561. A write through IR6 was refused (HTTPConnectionPool(host='IR6', port=80): Max retries exceeded with url: /api/v1/buckets/res-rep-3-3df06d99331943f693329363d0bedc88/objects (Caused by ReadTimeoutError("HTTPConnectionPool(host='IR6', port=80): Read timed out. (read timeout=8)"))). Reads through it returned the written bytes or nothing. - **Step 3 (Heal the split):** IR6 reached block 562 1 s after the split was removed and reports ready inner ring and storage health. IR7 reached block 562 1 s after the split was removed and reports ready inner ring and storage health. After the split. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. The bucket listing (10 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Cut IR6, IR7 off from the rest** ```shell # IR6 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.43.122 -j DROP iptables -A MORPH_FAULT -d 192.168.43.122 -j DROP iptables -A MORPH_FAULT -s 192.168.43.145 -j DROP iptables -A MORPH_FAULT -d 192.168.43.145 -j DROP iptables -A MORPH_FAULT -s 192.168.43.33 -j DROP iptables -A MORPH_FAULT -d 192.168.43.33 -j DROP iptables -A MORPH_FAULT -s 192.168.42.231 -j DROP iptables -A MORPH_FAULT -d 192.168.42.231 -j DROP iptables -A MORPH_FAULT -s 192.168.43.143 -j DROP iptables -A MORPH_FAULT -d 192.168.43.143 -j DROP iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP iptables -A MORPH_FAULT -s 192.168.42.98 -j DROP iptables -A MORPH_FAULT -d 192.168.42.98 -j DROP — # IR7 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT if iptables -L DOCKER-USER -n >/dev/null 2>&1; then iptables -C DOCKER-USER -j MORPH_FAULT 2>/dev/null || iptables -I DOCKER-USER 1 -j MORPH_FAULT; fi iptables -A MORPH_FAULT -s 192.168.43.122 -j DROP iptables -A MORPH_FAULT -d 192.168.43.122 -j DROP iptables -A MORPH_FAULT -s 192.168.43.145 -j DROP iptables -A MORPH_FAULT -d 192.168.43.145 -j DROP iptables -A MORPH_FAULT -s 192.168.43.33 -j DROP iptables -A MORPH_FAULT -d 192.168.43.33 -j DROP iptables -A MORPH_FAULT -s 192.168.42.231 -j DROP iptables -A MORPH_FAULT -d 192.168.42.231 -j DROP iptables -A MORPH_FAULT -s 192.168.43.143 -j DROP iptables -A MORPH_FAULT -d 192.168.43.143 -j DROP iptables -A MORPH_FAULT -s 192.168.42.157 -j DROP iptables -A MORPH_FAULT -d 192.168.42.157 -j DROP iptables -A MORPH_FAULT -s 192.168.43.139 -j DROP iptables -A MORPH_FAULT -d 192.168.43.139 -j DROP iptables -A MORPH_FAULT -s 192.168.42.98 -j DROP iptables -A MORPH_FAULT -d 192.168.42.98 -j DROP — # IR6 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — # IR7 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ``` **Step 3. Heal the split** ```shell # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.18 Inner ring node rejoins after its chain database is wiped **Goal** Inner ring node IR7 is stopped and its FS chain database is deleted, as after the loss of the disk that held it. Its keys, its configuration and its stored objects stay. After it starts it must fetch the whole chain from the other nodes and report ready. To show that it is a full member again, 2 other inner ring nodes are then killed: consensus has no node to spare after that, so the chain can only advance if the node that rejoined takes part. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back before the node is stopped. 2. **Delete the chain database of IR7.** The Morph container is stopped and the chain database file is removed from the node's state directory. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. The Morph container is then started. It must report ready inner ring and storage health, and its FS chain RPC must reach the block height IR1 reports. 3. **Kill IR2, IR3: consensus needs IR7.** IR2, IR3 are killed with SIGKILL. The inner ring nodes that remain are exactly a quorum, and IR7 is one of them. The chain must advance and the objects must be read. The killed nodes are then started. 4. **Read back every acknowledged object.** A final read of the ledger and of the bucket listing with every inner ring node running. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Delete the chain database of IR7):** Removed /mnt/morph/local_state/fschain.bolt on 192.168.42.248. During the outage of IR7: all 8 objects had been read 1 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 1 s. IR7 started with no chain database and reached block 574 6 s later. It reports ready inner ring and storage health. - **Step 3 (Kill IR2, IR3: consensus needs IR7):** With IR2, IR3 killed, the FS chain moved from block 579 to 582. After the rejoin. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. - **Step 4 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. The bucket listing (9 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Delete the chain database of IR7** ```shell # IR7 exit 0 $ docker update --restart=no morph morph # IR7 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ set -eu rm -f /mnt/morph/local_state/fschain.bolt test ! -e /mnt/morph/local_state/fschain.bolt — # IR7 exit 0 $ docker update --restart=always morph morph # IR7 exit 0 $ docker start morph morph # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Kill IR2, IR3: consensus needs IR7** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker kill morph morph # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker kill morph morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
--- # Traffic and operations These seven scenarios run continuous REST and S3 client traffic across `SIGKILL`, `docker pause`, inner ring failover, a full cluster rolling restart, a flapping storage node, and a blocked storage gRPC port. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.19 Traffic across a fault: SIGKILL of a storage node, replication of 3 copies **Goal** The policy is replication of 3 copies. Clients are writing, reading and deleting when the fault happens: SIGKILL of a storage node, on 192.168.42.157. Requests that were in flight may fail. Every write and delete that was acknowledged, before, during and after the fault, has to hold when the ledger is read back, and the clients have to be served again within 120 seconds, while the fault is still in place. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **SIGKILL of a storage node: SN1.** The fault is applied while the clients keep sending requests. The scenario waits until every client has three writes and three reads in a row succeed, holds the fault a little longer, and removes it. The node must report ready again. 3. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 1 (Start the traffic):** Before the fault, 0 of 96 requests failed. - **Step 2 (SIGKILL of a storage node: SN1):** After the fault: three writes and three reads in a row succeeded on every client 1 s later. 0 of 18 requests failed in that time. After SN1 returned: three writes and three reads in a row succeeded on every client 5 s later. 0 of 48 requests failed in that time. - **Step 3 (Read back the traffic):** rest through REST IR1:80, REST IR2:80: 75 PUT, 75 GET, 15 DELETE, 5460 KiB kept; failed requests: 0; there was no interruption. s3 through S3 IR1:7130, S3 IR2:7130: 75 PUT, 75 GET, 15 DELETE, 5460 KiB kept; failed requests: 0; there was no interruption. Requests with an unknown outcome: 0. Each of those objects was read back as exact or absent. Read-back of the traffic on res-rep-3-6c37e78a0f0143169c0204228fd6e749: 120 acknowledged objects match, 30 acknowledged deletes are gone, and the bucket listing (120 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. SIGKILL of a storage node: SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Read back the traffic** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.20 Traffic across a fault: a frozen storage node (docker pause), replication of 3 copies **Goal** The policy is replication of 3 copies. Clients are writing, reading and deleting when the fault happens: a frozen storage node (docker pause), on 192.168.42.157. Requests that were in flight may fail. Every write and delete that was acknowledged, before, during and after the fault, has to hold when the ledger is read back, and the clients have to be served again within 120 seconds, while the fault is still in place. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **A frozen storage node (docker pause): SN1.** The fault is applied while the clients keep sending requests. The scenario waits until every client has three writes and three reads in a row succeed, holds the fault a little longer, and removes it. The node must report ready again. 3. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 1 (Start the traffic):** Before the fault, 0 of 100 requests failed. - **Step 2 (A frozen storage node (docker pause): SN1):** After the fault: three writes and three reads in a row succeeded on every client 52 s later. 7 of 31 requests failed in that time. After SN1 returned: three writes and three reads in a row succeeded on every client 1 s later. 0 of 18 requests failed in that time. - **Step 3 (Read back the traffic):** rest through REST IR1:80, REST IR2:80: 78 PUT, 78 GET, 15 DELETE, 5460 KiB kept; failed requests: 6; the longest interruption was 34 s for DELETE (1 failed in a row, first error: HTTPError: 500 Server Error: Internal Server Error for url: `http://IR1:80/api/v1/buckets/res-rep-3-5ab87c15d5bc47c499a30b2f8fbefc2d/objects/load%2Frest%2F00005`). s3 through S3 IR1:7130, S3 IR2:7130: 51 PUT, 51 GET, 10 DELETE, 3806 KiB kept; failed requests: 1; the longest interruption was 34 s for DELETE (1 failed in a row, first error: ReadTimeoutError: Read timeout on endpoint URL: `http://IR1:7130/res-rep-3-5ab87c15d5bc47c499a30b2f8fbefc2d/load/s3/00005`). Requests with an unknown outcome: 5. Each of those objects was read back as exact or absent. Read-back of the traffic on res-rep-3-5ab87c15d5bc47c499a30b2f8fbefc2d: 101 acknowledged objects match, 23 acknowledged deletes are gone, and the bucket listing (105 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. A frozen storage node (docker pause): SN1** ```shell # SN1 exit 0 $ docker pause morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker unpause morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Read back the traffic** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.21 Traffic across a fault: SIGKILL of the inner ring node the clients are connected to, replication of 3 copies **Goal** The policy is replication of 3 copies. Clients are writing, reading and deleting when the fault happens: SIGKILL of the inner ring node the clients are connected to, on 192.168.43.145. Requests that were in flight may fail. Every write and delete that was acknowledged, before, during and after the fault, has to hold when the ledger is read back, and the clients have to be served again within 120 seconds, while the fault is still in place. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **SIGKILL of the inner ring node the clients are connected to: IR2.** The fault is applied while the clients keep sending requests. The scenario waits until every client has three writes and three reads in a row succeed, holds the fault a little longer, and removes it. The node must report ready again. 3. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 1 (Start the traffic):** Before the fault, 0 of 100 requests failed. - **Step 2 (SIGKILL of the inner ring node the clients are connected to: IR2):** After the fault: three writes and three reads in a row succeeded on every client 3 s later. 2 of 31 requests failed in that time. After IR2 returned: three writes and three reads in a row succeeded on every client 10 s later. 0 of 92 requests failed in that time. - **Step 3 (Read back the traffic):** rest through REST IR2:80, REST IR1:80: 92 PUT, 92 GET, 18 DELETE, 6808 KiB kept; failed requests: 1; the longest interruption was 1 s for PUT (1 failed in a row, first error: ConnectionError: HTTPConnectionPool(host='IR2', port=80): Max retries exceeded with url: /api/v1/buckets/res-rep-3-c429d0d387344907ad9eaefc38d7954b/objects (Caused by). s3 through S3 IR2:7130, S3 IR1:7130: 90 PUT, 90 GET, 18 DELETE, 6536 KiB kept; failed requests: 1; the longest interruption was 1 s for PUT (1 failed in a row, first error: EndpointConnectionError: Could not connect to the endpoint URL: `http://IR2:7130/res-rep-3-c429d0d387344907ad9eaefc38d7954b/load/s3/00025`). Requests with an unknown outcome: 2. Each of those objects was read back as exact or absent. Read-back of the traffic on res-rep-3-c429d0d387344907ad9eaefc38d7954b: 144 acknowledged objects match, 36 acknowledged deletes are gone, and the bucket listing (144 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. SIGKILL of the inner ring node the clients are connected to: IR2** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker kill morph morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Read back the traffic** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.22 Traffic across a fault: SIGKILL of a storage node, erasure coding 6+2 **Goal** The policy is erasure coding 6+2. Clients are writing, reading and deleting when the fault happens: SIGKILL of a storage node, on 192.168.42.157. Requests that were in flight may fail. Every write and delete that was acknowledged, before, during and after the fault, has to hold when the ledger is read back, and the clients have to be served again within 120 seconds, while the fault is still in place. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **SIGKILL of a storage node: SN1.** The fault is applied while the clients keep sending requests. The scenario waits until every client has three writes and three reads in a row succeed, holds the fault a little longer, and removes it. The node must report ready again. 3. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 1 (Start the traffic):** Before the fault, 0 of 100 requests failed. - **Step 2 (SIGKILL of a storage node: SN1):** After the fault: three writes and three reads in a row succeeded on every client 1 s later. 0 of 18 requests failed in that time. After SN1 returned: three writes and three reads in a row succeeded on every client 4 s later. 0 of 48 requests failed in that time. - **Step 3 (Read back the traffic):** rest through REST IR1:80, REST IR2:80: 77 PUT, 77 GET, 15 DELETE, 5732 KiB kept; failed requests: 0; there was no interruption. s3 through S3 IR1:7130, S3 IR2:7130: 77 PUT, 77 GET, 15 DELETE, 5732 KiB kept; failed requests: 0; there was no interruption. Requests with an unknown outcome: 0. Each of those objects was read back as exact or absent. Read-back of the traffic on res-ec-6-2-77e408a60e624388bc5696d31407c0b7: 124 acknowledged objects match, 30 acknowledged deletes are gone, and the bucket listing (124 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. SIGKILL of a storage node: SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Read back the traffic** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.23 Rolling restart under load **Goal** Every node of the cluster is restarted, one at a time, the way an upgrade is rolled out: 2 storage-type nodes first, then the other inner ring nodes, and IR1 last. Clients keep writing, reading and deleting in buckets with replication of 3 copies and erasure coding 6+2. Their endpoints are all the inner ring nodes, so each client loses the node it is connected to and has to move to another. A node is restarted only after the previous one reports ready. No acknowledged write or delete may be lost, and no kind of request may keep failing for longer than 120 seconds. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **Restart SN1.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 3. **Restart SN2.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 4. **Restart IR2.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 5. **Restart IR3.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 6. **Restart IR4.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 7. **Restart IR5.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 8. **Restart IR6.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 9. **Restart IR7.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 10. **Restart IR1.** The Morph container is stopped with a 20 second grace period and started again. The node must report ready health and be in the network map, and an inner ring node's API must answer, before the next node is touched. The clients keep sending requests the whole time. 11. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 2 (Restart SN1):** SN1 (storage) was ready again 8 s after its restart began. 0 of 132 client requests failed in that time. - **Step 3 (Restart SN2):** SN2 (storage) was ready again 8 s after its restart began. 0 of 126 client requests failed in that time. - **Step 4 (Restart IR2):** IR2 (ir) was ready again 68 s after its restart began. 0 of 1114 client requests failed in that time. - **Step 5 (Restart IR3):** IR3 (ir) was ready again 90 s after its restart began. 2 of 1475 client requests failed in that time. - **Step 6 (Restart IR4):** IR4 (ir) was ready again 108 s after its restart began. 2 of 1777 client requests failed in that time. - **Step 7 (Restart IR5):** IR5 (ir) was ready again 110 s after its restart began. 2 of 1795 client requests failed in that time. - **Step 8 (Restart IR6):** IR6 (ir) was ready again 150 s after its restart began. 2 of 2461 client requests failed in that time. - **Step 9 (Restart IR7):** IR7 (ir) was ready again 150 s after its restart began. 2 of 2456 client requests failed in that time. - **Step 10 (Restart IR1):** IR1 (ir) was ready again 148 s after its restart began. 4 of 2434 client requests failed in that time. - **Step 11 (Read back the traffic):** rest through REST IR1:80, REST IR2:80, REST IR3:80, REST IR4:80, REST IR5:80, REST IR6:80, REST IR7:80: 1598 PUT, 1598 GET, 319 DELETE, 116553 KiB kept; failed requests: 1; the longest interruption was 1 s for PUT (1 failed in a row, first error: ConnectionError: HTTPConnectionPool(host='IR1', port=80): Max retries exceeded with url: /api/v1/buckets/res-rep-3-eccd2bccccf44246ac4910e6e678e771/objects (Caused by). s3 through S3 IR2:7130, S3 IR3:7130, S3 IR4:7130, S3 IR5:7130, S3 IR6:7130, S3 IR7:7130, S3 IR1:7130: 1592 PUT, 1591 GET, 318 DELETE, 114727 KiB kept; failed requests: 7; the longest interruption was 1 s for PUT (1 failed in a row, first error: EndpointConnectionError: Could not connect to the endpoint URL: `http://IR3:7130/res-rep-3-eccd2bccccf44246ac4910e6e678e771/roll-rep-3/s3/00186`). Requests with an unknown outcome: 8. Each of those objects was read back as exact or absent. Read-back of the traffic on res-rep-3-eccd2bccccf44246ac4910e6e678e771: 2545 acknowledged objects match, 637 acknowledged deletes are gone, and the bucket listing (2545 keys) names every one of the objects and none of the deleted keys. rest through REST IR1:80, REST IR2:80, REST IR3:80, REST IR4:80, REST IR5:80, REST IR6:80, REST IR7:80: 1623 PUT, 1623 GET, 324 DELETE, 118193 KiB kept; failed requests: 1; the longest interruption was 1 s for PUT (1 failed in a row, first error: ConnectionError: HTTPConnectionPool(host='IR1', port=80): Max retries exceeded with url: /api/v1/buckets/res-ec-6-2-bb47538c071d4c29baba603d5ed3af92/objects (Caused b). s3 through S3 IR2:7130, S3 IR3:7130, S3 IR4:7130, S3 IR5:7130, S3 IR6:7130, S3 IR7:7130, S3 IR1:7130: 1615 PUT, 1614 GET, 323 DELETE, 117100 KiB kept; failed requests: 7; the longest interruption was 1 s for PUT (1 failed in a row, first error: EndpointConnectionError: Could not connect to the endpoint URL: `http://IR6:7130/res-ec-6-2-bb47538c071d4c29baba603d5ed3af92/roll-ec-6-2/s3/00755`). Requests with an unknown outcome: 8. Each of those objects was read back as exact or absent. Read-back of the traffic on res-ec-6-2-bb47538c071d4c29baba603d5ed3af92: 2583 acknowledged objects match, 647 acknowledged deletes are gone, and the bucket listing (2583 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. Restart SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Restart SN2** ```shell # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 4. Restart IR2** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 5. Restart IR3** ```shell # IR3 exit 0 $ docker update --restart=no morph morph # IR3 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR3 exit 0 $ docker update --restart=always morph morph # IR3 exit 0 $ docker start morph morph # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 6. Restart IR4** ```shell # IR4 exit 0 $ docker update --restart=no morph morph # IR4 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR4 exit 0 $ docker update --restart=always morph morph # IR4 exit 0 $ docker start morph morph # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 7. Restart IR5** ```shell # IR5 exit 0 $ docker update --restart=no morph morph # IR5 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR5 exit 0 $ docker update --restart=always morph morph # IR5 exit 0 $ docker start morph morph # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 8. Restart IR6** ```shell # IR6 exit 0 $ docker update --restart=no morph morph # IR6 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR6 exit 0 $ docker update --restart=always morph morph # IR6 exit 0 $ docker start morph morph # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 9. Restart IR7** ```shell # IR7 exit 0 $ docker update --restart=no morph morph # IR7 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR7 exit 0 $ docker update --restart=always morph morph # IR7 exit 0 $ docker start morph morph # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 10. Restart IR1** ```shell # IR1 exit 0 $ docker update --restart=no morph morph # IR1 exit 0 $ docker stop --time 20 morph Flag --time has been deprecated, use --timeout instead morph # IR1 exit 0 $ docker update --restart=always morph morph # IR1 exit 0 $ docker start morph morph # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.24 Flapping storage node under load **Goal** Storage node SN1 is killed and started 5 times in a row, 15 seconds down and 15 seconds up, without waiting for it to become ready in between. The other nodes see it leave and return again and again while clients keep writing, reading and deleting. No acknowledged write or delete may be lost, no kind of request may keep failing for longer than 120 seconds, and once the node stays up the policers must report full redundancy. **Scenario** 1. **Start the traffic.** A REST client and an S3 client each write a new object, read back one they wrote earlier, and delete every fifth one, about twice a second, with objects of 1, 16 and 256 KiB. Each client has several endpoints and moves to the next one when a request fails. A request is not repeated: a failed write or delete has an unknown outcome, and that object is later accepted as exact or absent. 2. **Kill and start SN1 5 times.** Each cycle kills the Morph container with SIGKILL, waits 15 seconds, starts it and waits 15 seconds. After the last cycle the node must report ready and the clients must be served. 3. **Read back the traffic.** The traffic is stopped. Every acknowledged object is read and compared, every acknowledged delete is checked to be gone, and the bucket listing is compared with the same ledger. No kind of request may have kept failing for longer than 120 seconds. The policers must then report full redundancy. **Observed result** - **Step 2 (Kill and start SN1 5 times):** Cycle 1: 0 of 261 client requests failed. Cycle 2: 0 of 262 client requests failed. Cycle 3: 0 of 264 client requests failed. Cycle 4: 0 of 264 client requests failed. Cycle 5: 0 of 260 client requests failed. After SN1 stayed up: three writes and three reads in a row succeeded on every client 0 s later. 0 of 12 requests failed in that time. - **Step 3 (Read back the traffic):** rest through REST IR1:80, REST IR2:80: 324 PUT, 324 GET, 64 DELETE, 23735 KiB kept; failed requests: 0; there was no interruption. s3 through S3 IR1:7130, S3 IR2:7130: 324 PUT, 324 GET, 64 DELETE, 23735 KiB kept; failed requests: 0; there was no interruption. Requests with an unknown outcome: 0. Each of those objects was read back as exact or absent. Read-back of the traffic on res-rep-3-25c4dca87ea349d0a3095f743f0d99da: 520 acknowledged objects match, 128 acknowledged deletes are gone, and the bucket listing (520 keys) names every one of the objects and none of the deleted keys.
Command log **Step 2. Kill and start SN1 5 times** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Read back the traffic** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.25 Storage port blocked on one node; the other copies keep serving **Goal** iptables on one storage VM drops the storage protocol: host port 7120 and Morph container port 8080, on INPUT, OUTPUT, and FORWARD. The node process keeps running and stays in the network map, but no other node can store or fetch objects on it. The cluster has to keep serving from the other copies. After the rules are removed, every acknowledged object is read back. **Scenario** 1. **Write 8 reference objects.** Reference objects are written and read back before the port is blocked. 2. **Block storage port 7120 on SN1.** INPUT, OUTPUT, and FORWARD drop the published storage port and Morph container port 8080. While the fault is held, every object is read, and a new object is written, read back and deleted. A request that fails is repeated for up to 120 seconds, and the time until it succeeded is recorded. A request that never succeeds fails the scenario. 3. **Read back every acknowledged object.** A final read of the objects and of the bucket listing after the port rules have been removed. **Observed result** - **Step 1 (Write 8 reference objects):** Initial reference set. Morph REST on IR1:80 returned the acknowledged bytes for 8 objects. - **Step 2 (Block storage port 7120 on SN1):** During the blocked storage port on SN1: all 8 objects had been read 27 s after the fault was applied. Two new objects were written and read back, and one of them was deleted, by 35 s. After the storage port was opened. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. - **Step 3 (Read back every acknowledged object):** Final read-back. Morph REST on IR1:80 returned the acknowledged bytes for 9 objects and did not return 1 deleted key. The bucket listing (9 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Block storage port 7120 on SN1** ```shell # SN1 exit 0 $ set -eu iptables -N MORPH_FAULT 2>/dev/null || iptables -F MORPH_FAULT iptables -C INPUT -j MORPH_FAULT 2>/dev/null || iptables -I INPUT 1 -j MORPH_FAULT iptables -C OUTPUT -j MORPH_FAULT 2>/dev/null || iptables -I OUTPUT 1 -j MORPH_FAULT iptables -C FORWARD -j MORPH_FAULT 2>/dev/null || iptables -I FORWARD 1 -j MORPH_FAULT iptables -A MORPH_FAULT -p tcp --dport 7120 -j DROP iptables -A MORPH_FAULT -p tcp --sport 7120 -j DROP iptables -A MORPH_FAULT -p tcp --dport 8080 -j DROP iptables -A MORPH_FAULT -p tcp --sport 8080 -j DROP — # SN1 exit 0 $ set -eu while iptables -D INPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D OUTPUT -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D FORWARD -j MORPH_FAULT 2>/dev/null; do :; done || true while iptables -D DOCKER-USER -j MORPH_FAULT 2>/dev/null; do :; done || true iptables -F MORPH_FAULT 2>/dev/null || true iptables -X MORPH_FAULT 2>/dev/null || true iface=$(ip -4 route show default | sed -n 's/.* dev \([^ ]*\).*/\1/p' | head -n 1 || true) if [ -n "$iface" ]; then tc qdisc del dev "$iface" root 2>/dev/null || true; fi — ```
--- # S3 gateway and large objects These four scenarios cover S3 availability across multiple endpoints (including the standalone gateway-type node `GW1`), multipart uploads spanning a node kill and recovery, and 96 MiB split objects under `rep-3` and `ec-6-2` when two holders are lost. See the [Resilience tests overview](index.md) for the cluster topology, node inventory, shorthand labels (`IR1`-`IR7`, `SN1`-`SN2`, `GW1`), and pass criteria. ## 5.29 S3 keeps serving while storage nodes and S3 endpoints are lost **Goal** S3 is used through S3 IR1:7130, S3 IR2:7130, S3 gateway `http://GW1:7130`. Objects written through each endpoint must be readable and listed through every other one. A storage node that holds copies is killed, then the second S3 node, then the gateway-type node when the deployment has one. During each loss the endpoints that are left must read every object, store a new one, delete one and list the bucket correctly. An endpoint that was killed must serve the same objects again after it starts. **Scenario** 1. **Write through every S3 endpoint.** Three objects of 4, 64 and 256 KiB are stored through each endpoint with PutObject. Every endpoint then reads all of them with GetObject and lists the bucket with ListObjectsV2, and the Morph REST API reads them as well. 2. **Kill storage node SN1.** SN1 holds copies of 1 of these objects and is killed with SIGKILL. Every endpoint must read all objects, store and read a new one, delete one and list the bucket. A request is repeated for up to 120 seconds. The node is then started. 3. **Kill S3 node IR2.** The node behind S3 IR2:7130 is killed with SIGKILL: a client of that endpoint has to use another one. The other endpoints must serve every object, including those written through the killed node, and take a write and a delete. After the node starts, its endpoint must serve all objects again, including those written while it was down. 4. **Kill the gateway-type node GW1.** The gateway Morph container is killed with SIGKILL. The cluster nodes' S3 must serve every object, including those written through the gateway. The Morph container is started, its S3 health metric must report ready, and the gateway must then return every object, including those written while it was down. 5. **Read back through every endpoint.** With every node running, each S3 endpoint reads all objects and lists the bucket, and the Morph REST API reads the objects and its own listing. **Observed result** - **Step 1 (Write through every S3 endpoint):** 9 objects were stored. Each of S3 IR1:7130, S3 IR2:7130, S3 gateway `http://GW1:7130` returned all of them and listed them, and so did Morph REST. - **Step 2 (Kill storage node SN1):** While SN1 was killed, each of S3 IR1:7130, S3 IR2:7130, S3 gateway `http://GW1:7130` served reads, a write, a delete and the listing. All of it had succeeded 5 s after the kill. - **Step 3 (Kill S3 node IR2):** While IR2 was killed, the other endpoints served reads, a write, a delete and the listing, all within 8 s of the kill. After it started, S3 IR2:7130 returned all 9 objects and none of the 5 deleted keys. - **Step 4 (Kill the gateway-type node GW1):** While the gateway was killed, the cluster nodes served every object. After it started, S3 gateway `http://GW1:7130` returned all 9 objects and none of the 7 deleted keys. - **Step 5 (Read back through every endpoint):** The bucket listing (9 keys) names every acknowledged object and no deleted key.
Command log **Step 2. Kill storage node SN1** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 3. Kill S3 node IR2** ```shell # IR2 exit 0 $ docker update --restart=no morph morph # IR2 exit 0 $ docker kill morph morph # IR2 exit 0 $ docker update --restart=always morph morph # IR2 exit 0 $ docker start morph morph # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 4. Kill the gateway-type node GW1** ```shell # GW1 exit 0 $ docker update --restart=no morph morph # GW1 exit 0 $ docker kill morph morph # GW1 exit 0 $ docker update --restart=always morph morph # GW1 exit 0 $ docker start morph morph # GW1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.30 Multipart upload across a node loss **Goal** An S3 multipart upload of 16 MiB in 4 parts is started. After the first part, storage node SN1 is killed with SIGKILL. The second part is uploaded while it is down, the third right after it is started, and the last once it is ready. The upload is then completed. The assembled object must be the bytes that were sent, through S3 on two nodes, through the Morph REST API and for a ranged read across a part boundary, and no unfinished upload may be left behind. **Scenario** 1. **Upload parts while a storage node dies and returns.** CreateMultipartUpload and UploadPart 1 run on a healthy cluster. The node is killed, and UploadPart 2 is repeated for up to 120 seconds until it is accepted. The node is started and UploadPart 3 is sent at once. After the node reports ready, UploadPart 4 and CompleteMultipartUpload follow. 2. **Read the assembled object.** The object is read in full through S3 on IR1 and on a second node and through the Morph REST API. A range of 2000 bytes across the boundary between parts 1 and 2 is read. ListMultipartUploads must not name the upload any more. The policers must then report full redundancy and the object is read again. **Observed result** - **Step 1 (Upload parts while a storage node dies and returns):** Part 2 was accepted 0 s after SN1 was killed. All 4 parts were accepted and the upload was completed. - **Step 2 (Read the assembled object):** uploads/assembled.bin (16777216 bytes) matched through S3 on IR1 and IR2 and through Morph REST, the ranged read matched, and no unfinished upload is listed.
Command log **Step 1. Upload parts while a storage node dies and returns** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ``` **Step 2. Read the assembled object** ```shell # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.31 Large S3 object stays readable after its holders are lost, replication of 3 copies **Goal** One object of 96 MiB is uploaded through S3. A single stored object holds at most 64 MiB, so the upload is kept as several objects that are placed independently, under replication of 3 copies. 2 of the nodes that hold pieces of it are killed, which is as many as the policy tolerates. The object must still be read in full, by a range that crosses the split, and with the right size, through S3 and through the Morph REST API. After the nodes return the policers must report full redundancy. **Scenario** 1. **Upload 96 MiB through S3.** The object is stored with one PutObject and read back in full, by range and by size. The shards are then searched for files of this bucket, which shows which nodes hold pieces of the object. 2. **Kill SN1, SN2 and read.** The nodes are killed with SIGKILL. The object is read in full through S3 and through the Morph REST API, by a range of 2000 bytes across the split, and by size. A request is repeated for up to 420 seconds. The nodes are then started, the policers must report full redundancy, and the object is read again. **Observed result** - **Step 1 (Upload 96 MiB through S3):** The upload took 1 s. Files of the bucket are on IR2 (2 files), IR3 (2 files), IR4 (2 files), IR5 (2 files), IR7 (2 files), SN1 (2 files), IR1 (1 file), IR6 (1 file), SN2 (1 file). Killing SN1, 192.168.43.139. - **Step 2 (Kill SN1, SN2 and read):** With SN1, SN2 killed, the object was read in full through S3 and REST, by range and by size, 1 s after the kill. After the nodes returned, the policers report full redundancy and the object matches in full, by range and by size, and is listed.
Command log **Step 1. Upload 96 MiB through S3** ```shell # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] ``` **Step 2. Kill SN1, SN2 and read** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
## 5.32 Large S3 object stays readable after its holders are lost, erasure coding 6+2 **Goal** One object of 96 MiB is uploaded through S3. A single stored object holds at most 64 MiB, so the upload is kept as several objects that are placed independently, under erasure coding 6+2. 2 of the nodes that hold pieces of it are killed, which is as many as the policy tolerates. The object must still be read in full, by a range that crosses the split, and with the right size, through S3 and through the Morph REST API. After the nodes return the policers must report full redundancy. **Scenario** 1. **Upload 96 MiB through S3.** The object is stored with one PutObject and read back in full, by range and by size. The shards are then searched for files of this bucket, which shows which nodes hold pieces of the object. 2. **Kill SN1, SN2 and read.** The nodes are killed with SIGKILL. The object is read in full through S3 and through the Morph REST API, by a range of 2000 bytes across the split, and by size. A request is repeated for up to 420 seconds. The nodes are then started, the policers must report full redundancy, and the object is read again. **Observed result** - **Step 1 (Upload 96 MiB through S3):** The upload took 1 s. Files of the bucket are on IR1 (3 files), IR2 (3 files), IR4 (3 files), IR5 (3 files), IR6 (3 files), IR7 (3 files), SN1 (3 files), IR3 (2 files), SN2 (2 files). Killing SN1, 192.168.43.139. - **Step 2 (Kill SN1, SN2 and read):** With SN1, SN2 killed, the object was read in full through S3 and REST, by range and by size, 1 s after the kill. After the nodes returned, the policers report full redundancy and the object matches in full, by range and by size, and is listed.
Command log **Step 1. Upload 96 MiB through S3** ```shell # IR1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR3 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR4 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR5 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"}] # IR6 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] # IR7 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN1 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"}] # SN2 exit 0 $ docker inspect -f "{{json .Mounts}}" morph [{"Type":"bind","Source":"/mnt/morph/local_meta","Destination":"/mnt/local_meta","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/local_state","Destination":"/morph/local_state","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/srv/morph/installer.config.yaml","Destination":"/morph/config/installer.config.yaml","Mode":"ro","RW":false,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/data_1","Destination":"/mnt/data/data_1","Mode":"rw","RW":true,"Propagation":"rprivate"},{"Type":"bind","Source":"/mnt/morph/metadata_1","Destination":"/mnt/metadata/metadata_1","Mode":"rw","RW":true,"Propagation":"rprivate"}] ``` **Step 2. Kill SN1, SN2 and read** ```shell # SN1 exit 0 $ docker update --restart=no morph morph # SN1 exit 0 $ docker kill morph morph # SN2 exit 0 $ docker update --restart=no morph morph # SN2 exit 0 $ docker kill morph morph # SN1 exit 0 $ docker update --restart=always morph morph # SN1 exit 0 $ docker start morph morph # SN2 exit 0 $ docker update --restart=always morph morph # SN2 exit 0 $ docker start morph morph # SN1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # SN2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR1 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR2 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR3 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR4 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR5 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR6 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 # IR7 exit 0 $ set -eu docker port morph 5100 | head -n 1 0.0.0.0:7140 ```
--- # Glossary Terms are in alphabetical order. | Term | Definition | |---|---| | Access box | An object that holds the tokens behind one set of S3 credentials or a Morph API token, encrypted for the gateways that may use them. The S3 access key ID is the address of this object. | | Attribute (node) | A key-value pair that an operator assigns to a storage node, for example a site or rack label. Storage policies filter and group nodes by attributes. | | Attribute (object) | A key-value pair in an object's header, fixed when the object is created. Attributes are indexed and searchable. Keys that start with `__NEOFS__` are reserved for the system. | | Basic ACL | The access rules that are part of a bucket's record: which operations the owner, other users and the system may perform. | | Bearer token | A token signed by a bucket's owner that grants its holder access defined by extended rules, for requests that present it. | | Bucket | The unit that holds objects and carries a storage policy, an owner and access rules. | | Bucket ID | An internal identifier of a bucket used by the FS chain, different from the bucket name. | | Candidate (network map) | A storage node that has registered with the inner ring and enters the network map at the next epoch. | | Candidate nodes | The storage nodes that a rule of a bucket's storage policy selects from the network map: the primary holders and reserves of the bucket's objects. | | Chain RPC | The JSON-RPC interface of an inner ring node, through which other components read the FS chain and submit transactions. Port 30333 by default. | | Cleanup threshold | The number of epochs a storage node may stay silent before the netmap contract removes it from the network map. The value is 3. | | Cluster-type node | A Morph node that runs an inner ring node, a storage node, the console and the S3 gateway. A cluster has 1 of them for tests and 4 or 7 in production; see [Limits](limits.md). | | Console | The Morph service that provides the REST API and the web interface. Process name `morph`. | | Data part | One of the `d` parts of an erasure-coded object that hold the original bytes. | | dBFT | The Byzantine fault-tolerant consensus algorithm that the inner ring nodes use to agree on each block of the FS chain. | | Epoch | The unit of time of the network. The network map changes only at an epoch boundary. The default duration in Morph is 3600 seconds. | | Erasure coding (EC) | Storing an object as `d` data parts and `p` parity parts on different nodes, so that any `d` parts restore it. Written `EC d/p` in a storage policy. | | Expiration | A time in an object's header after which the object is no longer served and is removed by garbage collection. | | Extended ACL | Extended access rules of a bucket: a table of allow and deny rules stored on the FS chain that narrows the access allowed by the basic ACL. Can be shortened to eACL or EACL. | | Filter | The part of a storage policy that matches storage nodes by their attributes. | | FS chain | The replicated ledger, maintained by the inner ring, that records buckets, access rules, users and the network map. | | FSTree | The component of a shard that stores object data as files on the data drive. | | Garbage collector (GC) | The process in each shard that removes the data of deleted and expired objects in batches. | | Gateway-type node | A Morph node that runs only the console and the S3 gateway and connects to an existing cluster. Marked experimental. | | Hardfork | A change of the FS chain's rules that all inner ring nodes apply at the same block height. | | HRW | Highest random weight hashing, also called rendezvous hashing: each node gets a score from a hash of the node and a key, and nodes are ranked by score. Morph uses it to select a bucket's candidate nodes, to rank them for each object, and to choose a shard inside a node. | | Initial placement | An optional section of a storage policy that lets a write be acknowledged before all replicas exist. The rest is delivered in the background. | | Inner ring | The nodes that run the FS chain and agree on its content. Can be shortened to IR. | | Link object | A small object that lists, in order and with sizes, the pieces of an object larger than the maximum object size. | | Lock | A small object that protects one other object from deletion until the lock expires. | | Maintenance mode | A state in which a storage node answers client object operations with the status `NODE_UNDER_MAINTENANCE`. Policers do not re-create its replicas while the network map shows the state, and do not re-create its erasure-coded parts while it answers with that status. | | Maximum object size | The network setting that limits the payload of one stored object. 64 MiB. Larger uploads are stored as pieces. | | Metabase | The index of one shard: a bbolt database of the headers and attributes of the shard's objects, kept on a fast drive. | | Morph container | The Docker container that runs the Morph services on one machine. | | Morph node | One machine running the Morph container. | | Namespace | A named partition of a cluster's users and their settings, managed through the console. | | Network map | The list of storage nodes, with their addresses, attributes and states, that are members of the network in the current epoch. | | Object | A header and a payload, stored together and immutable. Addressed by bucket ID and object ID. | | Object ID | The SHA-256 hash of an object's header, which includes the checksum of the payload. Can be shortened to OID. | | Parity part | One of the `p` parts of an erasure-coded object that hold redundancy computed from the data parts. | | Part | One of the `d + p` objects into which a piece is encoded in an erasure-coded bucket, each stored on one node. A part is a data part or a parity part. | | Piece | One of the objects, each at most the maximum object size, into which a large upload is cut. | | Placement factor | The multiplier that makes a rule select more nodes than it needs, as reserves. `CBF` in policy text, `placementFactor` in the console API, default 3. | | Policer | The background process in every storage node that checks the node's objects against their storage policy, restores missing replicas and parts, moves objects to the nodes that rank for them, and removes surplus copies. | | Primary holder | A node that ranks among the first `n` for an object under a `REP n` rule, or at the rank of a part under an `EC` rule, and therefore holds it when the cluster is healthy. | | Quorum | The number of inner ring nodes that must agree on a block: 3 of 4, 5 of 7. | | Ranking | The order of a rule's candidate nodes for one object, computed by HRW on the object ID. Also known as placement vector. | | Replica | A full copy of an object on one storage node. `REP n` in a storage policy keeps `n` of them. | | Reserve | A candidate node that ranks below the primary holders for an object. It takes the object when a primary holder cannot. | | S3 gateway | The Morph service that translates S3 requests into operations on a storage node. Process name `neofs-s3-gw`. | | Selector | The part of a storage policy that picks a number of nodes, or groups of nodes, from those a filter matches. | | Session token | A token by which a user delegates the right to perform stated operations on their behalf for a limited time, for example to a gateway. | | Shard | One drive's object store (FSTree), index (metabase) and optional write-cache inside a storage node. | | Shard mode | The operating state of a shard: `read-write`, `read-only`, `degraded`, `degraded-read-only` or `disabled`. | | Storage node | The process that stores objects on a machine's drives and serves them. Process name `neofs-node`. Can be shortened to SN. | | Storage policy | The rule set of a bucket that selects nodes and sets redundancy. Also known as placement policy. | | Storage-type node | A Morph node that runs a storage node, the console and the S3 gateway, without an inner ring node. | | Tombstone | A small object that marks one other object as deleted. Nodes that hold it refuse the deleted object. It expires after its lifetime, 5 epochs by default. | | Write-cache | An optional component of a shard, on a fast drive, that accepts writes before they are flushed to the FSTree. | --- # Architecture Morph is object storage with an S3 API. It runs as a cluster of machines that each hold part of the data, and it is built on NeoFS, an open-source distributed object storage system. Morph adds the console with its REST API and web interface, user and policy management, the installer, and the packaging of all components into one container image. This page gives the overall picture. The other explanation pages go into each mechanism. The [architecture explorer](/architecture-explorer) shows an example deployment at three levels of detail and replays a write, a read, a drive failure, a rack failure, an expansion and a site failover step by step. ## The components of a Morph node A Morph node is one machine that runs the Morph container. The container holds four services and an entrypoint that starts and supervises them. | Component | Process | What it does | Listens on (default) | |---|---|---|---| | S3 gateway | `neofs-s3-gw` | Translates S3 requests into operations on the storage node. Keeps no state of its own. | 9080 | | Console | `morph` | REST API and web interface for buckets, objects, users, storage policies and cluster administration | 9100 | | Storage node | `neofs-node` | Stores objects on the machine's drives, serves them, replicates and repairs them with other storage nodes | 8080 (gRPC) | | Inner ring node | `neofs-ir` | Takes part in the consensus that maintains the FS chain | 20333 (consensus), 30333 (chain RPC) | ```mermaid flowchart LR client([Clients]) subgraph node["Morph node (cluster type)"] gw["S3 gateway"] console["Console"] sn["Storage node"] ir["Inner ring node"] end osn["Other storage nodes"] oir["Other inner ring nodes"] client -- "S3 :9080" --> gw client -- "REST :9100" --> console gw -- gRPC --> sn console -- gRPC --> sn sn <-- "gRPC :8080" --> osn gw -. "chain RPC :30333" .-> ir console -. "chain RPC" .-> ir sn -. "chain RPC" .-> ir ir <-- "consensus :20333" --> oir ``` Solid arrows carry object data. Dotted arrows are reads on the FS chain and, for the console and the storage node, transactions. The link between inner ring nodes is the exception: it carries consensus messages and blocks, and no object data. On cluster-type and storage-type nodes the gateway and the console are clients of the storage node on their own machine. A gateway-type node has no storage node; there they connect to storage nodes of the cluster. In both cases they use the same gRPC protocol that storage nodes use among themselves. All three read cluster state through the chain RPC of an inner ring node. The console and the storage node also submit changes through it. The gateway only reads. ## Three node types The installer sets up a Morph node as one of three types. The type decides which services run. | Type | Inner ring | Storage node | Console | S3 gateway | Use | |---|---|---|---|---|---| | cluster-type | yes | yes | yes | yes | The nodes that form the cluster's inner ring: 1 for tests, 4 or 7 in production. | | storage-type | no | yes | yes | yes | Additional capacity. Any number, added and removed at any time. | | gateway-type | no | no | yes | yes | Additional S3 and REST endpoints without storage. Marked experimental. | A cluster-type node also runs a small internal verification service that the inner ring consults before it admits a storage node. Every node with a gateway can serve any S3 request for any bucket. Distributing clients over the nodes is the job of a load balancer, which is not part of Morph (see [Put a load balancer in front](../how-to/deploy/put-a-load-balancer-in-front.md)). A deployment is one Morph container per machine, started with Docker. ## Two planes A cluster consists of two groups of processes that do different jobs and scale differently. **Storage nodes hold the data.** They store objects with their metadata, answer reads, forward writes to each other and repair what is missing. Their number can grow and shrink. One replica of an object, or one part of an erasure-coded object, lives on one storage node. **The inner ring agrees on the FS chain.** The chain is a small replicated ledger that records what all nodes must see identically: buckets and their storage policies, access rules, users, and the network map, which is the list of storage nodes that are members in the current epoch. The inner ring nodes keep it consistent with a Byzantine fault-tolerant consensus protocol. Their number is fixed when the cluster is created. The planes meet in two places. Storage nodes read the chain to learn the policy of a bucket and the current network map. And they register themselves on the chain to become part of that map. Object data never passes through the inner ring. | | Storage nodes | Inner ring | |---|---|---| | Holds | Objects and their metadata | Buckets, policies, access rules, users, network map | | Size of the state | Grows with the stored data | Small, independent of the number of objects | | Number | Any, changeable | Fixed at installation: 1 for tests, 4 or 7 in production. Other sizes are accepted but add no tolerance | | Fault tolerance | Set per bucket by its storage policy | A quorum: 3 of 4, 5 of 7 | | On the path of a GET or PUT | Yes | No | ## How a request travels ### A write 1. A client sends an S3 `PUT` to the gateway of some node. 2. The gateway resolves the bucket name to a bucket ID on the FS chain, unless it has it cached, and opens a write stream to the storage node on its own machine. On a gateway-type node, which has no storage node, it uses a storage node of the cluster. 3. The storage node reads the bucket's storage policy and the current network map. Both are usually in its cache. 4. It cuts the payload into pieces of at most 64 MiB and forms each piece into an object with an ID derived from its content. In an erasure-coded bucket it encodes each piece into data and parity parts. 5. It computes, from the policy, the network map and the object ID, which storage nodes hold this object, and sends the replicas or parts to them in parallel. It keeps one itself if it is among them. 6. Each receiving node writes to one of its drives and indexes the object there. 7. When the policy's requirement is met, the storage node returns the object ID and the gateway answers the client. ### A read 1. A client sends an S3 `GET` to the gateway of some node. 2. The gateway finds the ID of the object that the key currently refers to. This is a search over object attributes, answered by storage nodes of the bucket, unless the gateway has the answer cached. 3. The storage node that the gateway uses computes which nodes hold the object. It does not look the location up anywhere. 4. It reads the object from one holder, or the data parts of an erasure-coded object from their holders, and streams the payload to the gateway and on to the client. The node that a client happens to reach need not hold the object. It computes where the object is and fetches it. The REST API of the console follows the same paths. The console takes the place of the gateway. ## What is deliberately absent Several components that are common in storage systems do not exist in Morph. Each absence is a design decision with consequences that the other pages work out. **No central metadata server.** No database lists the objects of the cluster. Each storage node indexes the objects on its own drives, and questions such as "which objects are in this bucket" are answered by asking the bucket's nodes. There is no metadata tier to size, scale or fail over. Listing costs more than a single index lookup in exchange. See [Metadata](metadata.md). **No location index.** Nothing records where an object is. The holders follow from a computation that every node can repeat. A write does not have to update a location table, and a failed node does not leave stale entries behind. When the set of nodes changes, the computed locations change too, and data has to move to match. See [Data placement](data-placement.md). **No coordinator in the data path.** No master assigns writes, grants leases or tracks transfers. The node that receives a request carries it out with the nodes it computed. The inner ring is needed to change cluster state. Reads and writes of objects need no decision from it. They go on while it has no quorum, as long as the storage nodes can still read the chain from one inner ring node. See [Inner ring and FS chain](inner-ring-and-fs-chain.md). **No rebalancer and no repair scheduler.** Each storage node continuously checks its own objects against the policy and corrects what it finds. There is no cluster-wide plan and no job to start after a failure or an expansion. The work is paced per node. See [Failure domains and self-healing](failure-domains-and-self-healing.md). **No replication between clusters.** A deployment is one network. Copies in several sites are placed by storage policies inside it. See [Replication and consistency](replication-and-consistency.md). [Design trade-offs and limitations](design-trade-offs.md) collects what these decisions cost and how to plan for it. ## Where to go next | Topic | Page | |---|---| | Buckets, objects, object IDs and object types | [Data model](data-model.md) | | Which nodes hold an object, and what moves when nodes are added | [Data placement](data-placement.md) | | Parts, parity and the read and write rules | [Erasure coding](erasure-coding.md) | | When a write is acknowledged and what a reader can rely on | [Replication and consistency](replication-and-consistency.md) | | The loss of a drive, node, rack or site, and repair | [Failure domains and self-healing](failure-domains-and-self-healing.md) | | Where metadata lives | [Metadata](metadata.md) | | The inner ring, epochs and the quorum | [Inner ring and FS chain](inner-ring-and-fs-chain.md) | | How S3 operations map onto this | [How S3 maps onto Morph](s3-on-morph.md) | | Authentication and access control | [Security model](security-model.md) | | What determines throughput and latency | [Performance](performance.md) | --- # Data model Morph stores **objects** in **buckets**. An object is immutable and is addressed by an ID that is derived from its content. Names, versions, overwrites and deletes are built on top of that with attributes and with small objects of special types. This page describes the model that both the S3 API and the REST API map onto. ## Buckets A bucket is the unit that holds objects and carries the rules for them. On the storage layer a bucket is a NeoFS container, and NeoFS tools such as `neofs-cli` use that word. A bucket is a record on the FS chain. It consists of: - the **owner**, the account that created it, - the **storage policy**, which decides how many replicas or parts each object has and which nodes hold them (see [Data placement](data-placement.md)), - the basic access rules, - **attributes**: key-value pairs such as the bucket's name and creation time, and settings that the S3 gateway keeps there, - a nonce that makes the record unique. The **bucket ID** is the SHA-256 hash of this record. Two consequences follow. The ID is fixed when the bucket is created, and the storage policy, being part of the hashed record, cannot be changed afterwards. The chain's container contract accordingly has operations to create and remove a bucket, to set and remove some attributes, to set access rules and quotas, and none to change the policy. A bucket **name** is a separate record on the chain that maps the name to the bucket ID. Gateways resolve the name first and work with the ID from then on. Objects are not listed on the chain. The chain knows that a bucket exists and where its objects belong. Which objects exist is known only to the storage nodes that hold them (see [Metadata](metadata.md)). ## Objects An object has a **header** and a **payload**. The header contains: - the bucket ID and the owner, - the payload size and the SHA-256 checksum of the payload, - the object type, - the creation epoch, - an optional expiration time, - attributes, - for parts of a larger whole, references to the other objects involved, - the session token under which the object was created, if one was used. The encoded header is limited to 16 KiB. The payload of a stored object is limited by the network setting for the maximum object size, 64 MiB. Larger uploads are stored as several objects, as described [below](#large-objects). ### Object IDs The **object ID** is the SHA-256 hash of the encoded header. Since the header contains the checksum of the payload, the ID commits to everything: content, size, attributes, owner and bucket. The creator signs the ID, and the signature is stored with the object. IDs are written as Base58 strings, for example `9QueQyKQ66K9Xg7DigMrgkdEujs4VKuq2WFNhEZLzhsx`. An object is fully addressed by the pair of bucket ID and object ID. Properties that follow from deriving the ID from the content: - **An ID never refers to different data.** Any node, and any client that has the object, can recompute the ID and detect a mismatch. - **Identical input gives an identical ID.** Two uploads with the same header and payload are the same object. To keep repeated uploads distinct, a creator adds a random value as an attribute. The S3 gateway does this for every object it stores. - **The ID is not chosen.** It is known when the object has been formed, which is why a write returns it. The ID is also the input of placement: together with the storage policy and the network map it determines the nodes that hold the object. ### Attributes Attributes are key-value pairs of UTF-8 strings in the header. A key occurs at most once per object, and a value is never empty. Because they are part of the header, attributes are fixed when the object is created. Attributes are indexed by every node that holds the object and can be searched (see [Search objects](../how-to/buckets-and-objects/search-objects.md)). Some have a conventional meaning: | Attribute | Meaning | |---|---| | `FilePath` | The object's path or key. The S3 gateway stores the S3 key here, and the REST API requires it on upload. | | `Timestamp` | Creation time set by the creator, as a Unix timestamp | | `Content-Type` | The MIME type of the payload | ## Names and IDs The storage layer finds objects by ID. A name is an attribute, and nothing forces it to be unique. The REST API states this directly: `FilePath` values are not unique, each successful upload creates an independent object, and the returned ID addresses that exact object. Where a name must identify one object, as with an S3 key, the name is resolved by searching for the objects that carry it and choosing the newest. The S3 gateway does this for every request by key. [How S3 maps onto Morph](s3-on-morph.md) describes the rules, including versioning. ## Object types | Type | Purpose | Payload | |---|---|---| | Regular | User data, and the pieces and parts it is stored as | The data | | Link | Lists the pieces of a large object in order, with their sizes | The list | | Tombstone | Marks another object as deleted | None | | Lock | Protects another object from deletion until the lock expires | None | Tombstones, locks and link objects are small and are treated differently from regular objects: they are stored on every node of the bucket and on every shard of a node, and they are never erasure coded. Each tombstone and each lock refers to exactly one object and must carry an expiration. ## Large objects A stored object has at most 64 MiB of payload. The limit is the network setting `MaxObjectSize`, which the inner ring sets when the cluster is created. The storage node that receives a larger upload cuts the payload into **pieces** of at most that size while the data streams in. The client does not have to split anything. - Each piece is a regular object with its own ID, checksum and placement. - The pieces form a chain: each refers to the previous one, and all but the first refer to the first. - The last piece carries the header of the whole object, including its ID and signature. - A **link object** lists all pieces with their sizes. The whole object, the one whose ID the client receives, is not stored as such. It exists as its pieces and the link object and is assembled on read. A read by its ID returns the complete payload in order. A range read uses the sizes in the link object to fetch only the pieces that cover the range. Because each piece is placed by its own ID, the pieces of one large object are spread over the bucket's nodes. In an erasure-coded bucket each piece is encoded separately (see [Erasure coding](erasure-coding.md)). An S3 multipart upload is a separate mechanism of the gateway that sits on top of this. See [How S3 maps onto Morph](s3-on-morph.md). ## Immutability A stored object never changes. There is no operation to modify a payload, a header or an attribute. Everything that looks like a change is expressed with additional objects. ### Overwrite Writing to an existing S3 key, or uploading through the REST API with a `FilePath` that is already in use, stores a **new object** with a new ID. The earlier object is not touched by the write itself. Which object a name refers to afterwards is decided by the lookup: the newest one. Whether the earlier object is kept as a previous version or removed depends on the interface. For S3 this is described in [How S3 maps onto Morph](s3-on-morph.md). Through the REST API both objects remain and are addressed by their IDs. ### Delete Deleting an object stores a **tombstone** for it in the bucket. From the moment a node has the tombstone, it answers requests for the deleted ID with `object already removed` and refuses to store that object again. The data is removed afterwards by the garbage collector of each shard, which works through removed objects in batches. The tombstone itself expires after its lifetime, 5 epochs by default, and is then collected as well. A tombstone for a large object also marks its pieces for removal on every node that receives it. Two things cannot be deleted through the object API: an object that is under a lock, and a lock itself. Removing the bucket removes locks and locked objects with it, whatever their expiration. ### Expiration An object can carry an expiration time in its header. An expired object is no longer served, and the garbage collector removes it. The expiration is part of the header and therefore of the ID. It is set when the object is created and cannot be extended or shortened later. The header field is a Unix timestamp in seconds. [Expire objects](../how-to/buckets-and-objects/expire-objects.md) shows how to set an expiration through the APIs. ### Locks A lock is an object of its own type that names one regular object and carries an expiration. While the lock exists, the locked object cannot be deleted. [Lock objects against deletion](../how-to/buckets-and-objects/lock-objects.md) describes the use. ## What the model does not have - **No in-place update and no append.** A changed object is a new object. - **No rename.** A name is an attribute and attributes are immutable. Renaming means writing a new object. - **No directories.** A path with slashes is a string. Listing "a directory" is a search for a prefix. - **No transactions over several objects.** --- # Data placement Morph computes where an object lives. No component stores a table of object locations. Every node derives the holders of an object from three inputs: the storage policy of the bucket, the current network map, and the object ID. Two nodes with the same inputs reach the same answer, so any node can write or find any object. This page explains the computation, what it guarantees, and what follows from it when nodes join or leave. The [architecture explorer](/architecture-explorer?scenario=expand) replays an expansion step by step on an example deployment, with the node rankings before and after. ## One mechanism: the storage policy A storage policy is part of the bucket. It states two things: - **Redundancy**: `REP n` keeps `n` full replicas of each object; `EC d/p` keeps `d` data parts and `p` parity parts. A policy uses replica rules or erasure coding rules, not both. - **Location**: filters match storage nodes by their attributes (for example a site or a rack label set by the operator), and selectors pick a number of matching nodes, optionally grouped by an attribute. There is no separate setting for redundancy, failure domains or geography. A bucket that must live in two sites, a bucket confined to one rack row, and a bucket spread over the whole cluster differ only in their policies. The syntax is in the [storage policy language](../reference/storage-policy-language.md) reference, and [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md) helps you pick one. The container contract on the FS chain has operations to create and remove a bucket and to change its attributes, access rules and quotas. It has no operation that changes the policy of an existing bucket. Choose the policy when you create the bucket. ## Step 1: the bucket's candidate nodes When a node handles a request for a bucket, it applies the bucket's policy to the network map of the current epoch: 1. Each filter keeps the nodes whose attributes match. 2. Each selector picks nodes from a filter's result. `SELECT n FROM f` picks single nodes. `SELECT n IN DISTINCT attr FROM f` picks `n` groups of nodes that differ in `attr`. `SELECT n IN SAME attr FROM f` picks one group that shares a value of `attr`. 3. The choice among equally valid nodes or groups is made by rendezvous hashing on the **bucket ID**. Different buckets with the same policy therefore land on different nodes, and the same bucket always lands on the same nodes for a given network map. The result is one list of **candidate nodes** per rule of the policy. ### The placement factor A rule does not select exactly as many nodes as it needs. It selects up to *count × placement factor* nodes, where the placement factor is `CBF` in policy text and `placementFactor` in the console API. The default is 3. | Selector | Candidates for the rule | |---|---| | `SELECT n FROM f` | up to `n × CBF` nodes | | `SELECT n IN DISTINCT attr FROM f` | `n` groups, up to `CBF` nodes from each | | `SELECT n IN SAME attr FROM f` | one group, up to `n × CBF` nodes | If fewer nodes match than the factor asks for, the rule takes what is there, down to the minimum of `n`. Below that minimum the policy is unsatisfiable (see [below](#the-policy-must-stay-satisfiable)). The extra nodes are the rule's **reserves**. They take writes when a primary holder is unreachable, and they receive repaired data when a holder is lost. The placement factor also sets the **ceiling** of a bucket: a rule with `EC 4/2` and `CBF 2`, in a policy without selectors, never uses more than 12 nodes, however large the cluster grows. A policy is accepted only if each rule counts at most 64 nodes and all rules together at most 512. The count is the placement factor times the count of the rule's selector, or of the rule itself when it names none. A rule that names no selector in a policy that has selectors uses the nodes of all of them, which this count does not reflect (see [Storage policy language](../reference/storage-policy-language.md)). ## Step 2: the ranking for one object For each object, the node sorts the rule's candidates by weighted rendezvous hashing (highest random weight, HRW) on the **object ID**. Each candidate gets a score computed from the object ID and the node's public key, and the list is sorted by score. The result is a ranking that is specific to the object and the same on every node. - For `REP n`, the first `n` nodes of the ranking are the **primary holders**. The rest are reserves, in order. - For `EC d/p`, parts are counted from 0 and ranks from 1: part `i` belongs on the node ranked `i + 1`, so part 0 is on the first node of the ranking. The nodes after rank `d + p` are reserves. Each part has its own fallback sequence through them. See [Erasure coding](erasure-coding.md). The ranking is weighted. Each storage node announces the total size of its drives as the `Capacity` attribute, and the weight of a node is its capacity divided by its `Price` attribute when one is set. The hash distance of a node is divided by its weight, so nodes with more capacity rank first for more objects and receive a larger share of the data. The share grows with the weight but is not exactly proportional to it. Inside a node the same technique picks the drive: the node ranks its shards by HRW on the object ID and writes to the first one that accepts the object. ### A worked example Take a bucket with this policy in a site of eight nodes, `a1` to `a8`: ```text EC 4/2 IN SA CBF 2 SELECT 6 FROM FA AS SA FILTER site EQ a AS FA ``` The rule could use up to 6 × 2 = 12 nodes. Eight match the filter, so all eight are candidates. For the object with ID `9QueQyKQ66K9Xg7DigMrgkdEujs4VKuq2WFNhEZLzhsx` the SDK placement code produces this ranking: | Rank | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |---|---|---|---|---|---|---|---|---| | Node | a1 | a8 | a5 | a4 | a3 | a6 | a2 | a7 | | Holds | part 0 | part 1 | part 2 | part 3 | part 4 | part 5 | reserve | reserve | A node that receives a GET for this object computes the same table and knows that the four data parts are on `a1`, `a8`, `a5` and `a4`. It does not ask anyone where the object is. ## What changes when the network map changes The network map changes at an epoch boundary: a new node joins, or a node that stopped sending heartbeats is removed. Every node then recomputes placement from the new map. Three things can change. **The bucket's candidates.** If more nodes match the policy than the rule's ceiling, the selection by bucket ID may now pick a different set, and a node that was a candidate can stop being one. If a selector of single nodes still takes every matching node after the change, a new matching node becomes one more candidate and none is dropped. With a grouped selector (`IN DISTINCT`, `IN SAME`) the choice of groups is made again from the new map, and groups that can supply the full placement factor are preferred over smaller ones. **The ranking of each object.** Rendezvous hashing gives each node a score that does not depend on the other nodes. A new node is inserted somewhere into the existing order, and a removed node leaves a gap. The relative order of the remaining nodes does not change. **Where the data should be.** For some objects the holders computed from the new map differ from the nodes that have the data. Nothing moves at the moment of the change. New writes follow the new ranking at once. Existing objects stay readable as long as the nodes that hold them are still candidates of the bucket, because a read walks the ranking past the primary holders into the reserves until it finds the data. The difference is closed in the background, as described next. ### No rebalancer, only policers Morph has no rebalancing process and no coordinator that plans data movement. Each storage node runs a [policer](failure-domains-and-self-healing.md#the-policer) that walks the objects on its own drives and compares, for each one, the nodes that should hold it with the nodes that do. When a node finds that it holds something a better-ranked node lacks, it copies the object or part there. When it finds that enough better-ranked nodes hold the object, it drops its own copy. Movement after an expansion, repair after a failure, and cleanup after a node returns are the same loop. The consequence is that movement is paced by the policer settings on every node, not by a plan. It starts at the epoch change and finishes when every node has completed a pass over its objects. ### How much moves: erasure-coded buckets Add two nodes, `a9` and `a10`, to the site of the example. The bucket now has ten candidates, still under its ceiling of twelve. The first object's ranking becomes: | Rank | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |---|---|---|---|---|---|---|---|---|---|---| | Node | a1 | a8 | a5 | a4 | a3 | a6 | a9 | a10 | a2 | a7 | Both new nodes rank below the six holders. Nothing moves for this object. A second object in the same bucket ranked `a2 a8 a4 a6 a5 a3 · a1 a7` before the expansion. Afterwards: | Rank | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |---|---|---|---|---|---|---|---|---|---|---| | Node | a2 | a8 | a4 | **a10** | a6 | a5 | a3 | a1 | a9 | a7 | `a10` ranks fourth. Part 3 now belongs on `a10`, part 4 on `a6` and part 5 on `a5`. Three parts move, although only one of them moves to a new node. This is the effect of the rule that part `i` belongs on the node ranked `i + 1`: a newcomer that ranks above existing holders shifts every part below it by one position. Measured over 20,000 random object IDs with the SDK placement code, for two nodes added to eight under `EC 4/2`: | | Parts | Share | |---|---|---| | Parts in the sample | 120,000 | 100% | | Parts that end up on the new nodes | 24,087 | 20% | | Parts that change node | 68,683 | 57% | | Objects with no part moved | 2,587 of 20,000 | 13% | The new nodes receive their fair share, two tenths. The amount of data that moves between nodes is almost three times that share. The figure follows from the ranking: a part at position `j` stays only if neither new node ranks at or above `j`, which for six positions among ten ranks leaves an expected 2.58 of 6 parts in place. Adding a single node to the eight moves 39% of the parts (46,781 of 120,000). During the move, reads of affected objects take extra hops: the reader asks the node that now ranks for a part, gets "not found", and continues along the part's fallback sequence to the node that still holds it. Reads do not fail. ### How much moves: replicated buckets Replicas are interchangeable. The policer of a replicated bucket checks that the first `n` nodes of the ranking hold the object and does not care which of them holds which copy. A replica therefore moves only when a new node enters the first `n` ranks, and it displaces exactly one previous holder. Take `REP 3` with placement factor 4 over the same eight nodes growing to ten. The ceiling is twelve, so all ten nodes are candidates. The same sample gives: | | Replicas | Share | |---|---|---| | Replicas in the sample | 60,000 | 100% | | Replicas that end up on the new nodes | 12,074 | 20% | | Replicas that change node | 12,074 | 20% | The moved share equals the share of the new nodes. In general, adding `k` nodes of equal weight to `N` candidates moves `k / (N + k)` of the replicas, which is the minimum any scheme can move while keeping the load even. For both kinds of bucket this holds only while the bucket stays within its ceiling. With the default placement factor of 3, `REP 3` has a ceiling of nine: of the ten nodes it uses nine. A bucket that already has *count × placement factor* candidates does not grow onto new nodes. The selection by bucket ID can exchange some of its candidates for new ones. Reads look for an object on the current candidates only, so what an exchanged node still holds is not found until its policer has handed it over (see [Replication and consistency](replication-and-consistency.md#eventually)). ## What placement guarantees - **Determinism.** For one network map, every node computes the same candidates and the same ranking. There is no location index to lose, corrupt or rebuild. - **Distinct nodes.** The parts of an erasure-coded object are stored on distinct nodes at write time, and the replicas that one rule requires are on distinct nodes. If two rules of a policy share candidates, one node can count for both. The guarantee needs every rule to name its selector, or the policy to have none: a rule that names no selector in a policy with selectors uses the nodes of all selectors as they come, and a node that two selectors chose appears twice. - **Even load.** Over many objects, candidates of equal weight hold equal shares of a rule's data, and a candidate with a larger weight holds a larger share. - **Bounded spread.** A bucket's data is on its candidate nodes and nowhere else, once the policers have finished. A node outside the bucket that still holds an object keeps it only until it has confirmed that a node of the bucket holds it. ## What placement does not guarantee ### Distinct failure domains with a placement factor above 1 A selector with `IN DISTINCT attr` guarantees that the **candidates** come from distinct groups. It does not guarantee that the **primary holders** of each object do. The ranking for an object sorts all candidates of a rule in one list and ignores the grouping. Take `REP 2 IN X CBF 2 SELECT 2 IN DISTINCT site FROM * AS X`. The candidates are two nodes from each of two sites, four in all. For a given object the two best-ranked of the four can be the two nodes of the same site. Two forms do guarantee distinct failure domains for every object: - **Placement factor 1 with as many groups as replicas.** `REP 2 IN X CBF 1 SELECT 2 IN DISTINCT site FROM * AS X` has exactly one candidate per site, so the two replicas are in two sites. The cost is that the rule has no reserves: while one of the two nodes is down, writes that require both replicas do not complete, and repair has to wait until the node returns or leaves the network map. - **One rule per domain.** `REP 1 IN A REP 1 IN B` with one selector per site keeps one replica in each site, and each rule can have its own reserves inside its site. The same applies to racks and to erasure-coded buckets. For EC, the practical rule is to keep the number of nodes per failure domain no larger than the number of parity parts, as described in [Failure domains and self-healing](failure-domains-and-self-healing.md). ### The policy must stay satisfiable Placement is recomputed from the current network map for every operation. If a selector cannot find its minimum number of nodes or groups, the computation fails with `not enough nodes to SELECT from`, and every operation on the bucket fails with it, reads included. The data is intact on the drives. It becomes reachable again when the policy can be satisfied. This happens when a filter names something that has left the network map. A policy that requires a node in site `c` stops working after the last node of site `c` has been silent for more than three epochs and is removed from the map. A policy that leaves the choice open ("any two distinct sites") keeps working as long as two sites remain, and the bucket moves to the remaining sites by itself. Write policies so that the loss you plan to survive leaves enough matching nodes. See [Deploy across sites](../how-to/deploy/deploy-across-sites.md) and [Recover from a site failure](../how-to/operate/recover-from-a-site-failure.md). ### Immediate balance after expansion New nodes take their share of new writes from the first epoch in which they are in the network map. Existing data follows at the pace of the policers. Until they finish, old nodes hold more than their share. [Add storage nodes](../how-to/operate/add-storage-nodes.md) describes how to watch the progress. ## Related pages - [Erasure coding](erasure-coding.md) and [Replication and consistency](replication-and-consistency.md) describe what is placed. - [Failure domains and self-healing](failure-domains-and-self-healing.md) describes the policer and the effect of each kind of failure. - [Design trade-offs and limitations](design-trade-offs.md) summarizes the consequences of computed placement. - [Limits](../reference/limits.md) lists the numeric limits of storage policies. --- # Erasure coding An erasure-coded bucket stores each object as `d` data parts and `p` parity parts on `d + p` different nodes. Any `d` of the parts are enough to read the object. Compared with full replicas it tolerates the same number of lost nodes with less raw capacity, and pays for it with more nodes involved in every operation. The [architecture explorer](/architecture-explorer?scenario=write) follows one erasure-coded object from the PUT to six drives, and [back out again](/architecture-explorer?scenario=read) on a read. ## The scheme A storage policy with an `EC d/p` rule turns on erasure coding for the bucket, for example `EC 4/2`. The coder is Reed-Solomon, from the `klauspost/reedsolomon` library. ### Encoding one piece Encoding happens on the storage node that receives the upload, after the payload has been cut into pieces of at most 64 MiB (see [Data model](data-model.md)). Each piece is encoded on its own: 1. The payload of the piece is split into `d` data parts of equal size. The part size is the payload size divided by `d`, rounded up. If the payload does not divide evenly, the last data part is padded with zero bytes. 2. Reed-Solomon computes `p` parity parts of the same size. 3. Each part becomes an object of its own, with its own ID and payload checksum. It carries the complete header and signature of the piece it belongs to, the index of the rule, and its part index (`__NEOFS__EC_RULE_IDX`, `__NEOFS__EC_PART_IDX`). 4. The SHA-256 hashes of all parts are written into the header of the piece (`__NEOFS__EC_PART_HASHES`) before its ID is calculated, so the object ID commits to the content of every part. The data parts hold the original bytes in order. Concatenating parts 0 to `d − 1` and cutting off the padding gives back the payload without any decoding. Small system objects are not encoded. Tombstones, locks and the link objects of large uploads are stored as full copies on the nodes of the bucket. ### Storage overhead A piece of size `S` occupies `(d + p) × ⌈S / d⌉` bytes of payload, which is `(d + p) / d` times its size. | Scheme | Parts | Raw capacity per stored byte | Lost parts tolerated | Replicas with the same tolerance | |---|---|---|---|---| | `EC 2/1` | 3 | 1.50× | 1 | `REP 2`, 2× | | `EC 4/2` | 6 | 1.50× | 2 | `REP 3`, 3× | | `EC 6/3` | 9 | 1.50× | 3 | `REP 4`, 4× | | `EC 8/3` | 11 | 1.375× | 3 | `REP 4`, 4× | | `EC 8/4` | 12 | 1.50× | 4 | `REP 5`, 5× | | `EC 10/4` | 14 | 1.40× | 4 | `REP 5`, 5× | | `EC 16/4` | 20 | 1.25× | 4 | `REP 5`, 5× | A 64 MiB piece under `EC 4/2` becomes six parts of 16 MiB, 96 MiB in total. Each part also stores a header that contains the header of the piece, so very small objects carry proportionally more overhead than the table shows. ## Where the parts go The policy selects the bucket's candidate nodes and each object gets its own ranking of them, as described in [Data placement](data-placement.md). **Part `i`, counted from 0, belongs on the node ranked `i + 1`**: part 0 is on the first node of the ranking. Nodes ranked after `d + p` are reserves. Each part has a fixed fallback sequence through the ranking. With `t = d + p` parts and `N` candidates, part `i` tries the node ranked `i + 1`, then the nodes ranked `i + 1 + t`, `i + 1 + 2t` and so on, then the ranks that belong to part `i + 1` and its reserves, and so on around. Every node that reads, checks or repairs a part walks the same sequence, which is how a part is found when it is not on its first-choice node. ## The write rule: all parts A PUT to an erasure-coded bucket is acknowledged only when **all `d + p` parts of every piece are stored, each on a different node**. The node that handles the PUT sends the parts in parallel. If a node cannot take its part, the part goes to the next free node in its sequence. A node that has been tried for one part is not used for another. The write fails when the candidates run out before every part has a node. The error text is `incomplete object PUT by placement`, or `not enough nodes for EC parts` once fewer than `d` candidates are left that have not failed. Parts that were stored before the failure are not removed by the write. Two consequences: - **A write needs `d + p` reachable candidates.** With the default placement factor of 3 and enough matching nodes, a bucket has up to `3 × (d + p)` candidates, and writes continue while any `d + p` of them answer. If the cluster has exactly `d + p` matching nodes, a single unreachable node stops writes to the bucket until it returns or is replaced. - **An acknowledged object starts with full redundancy.** There is no window in which an acknowledged erasure-coded object has fewer than `d + p` parts of a rule that was written. The one exception is a policy with several rules and an initial placement that leaves a whole EC rule out of the first write: that rule's parts follow after the acknowledgement. ## The read rule: any d parts A GET is served by a node of the bucket. It computes the ranking and asks for the **data parts only**, in parallel, each from the node that ranks for it. On a healthy cluster the node passes the data parts on in order. The parity parts are not read and nothing is decoded. A range read fetches only the ranges of the data parts that cover the requested bytes. ### Degraded reads If a data part cannot be read from any node in its sequence, the node requests the parity parts, waits for as many as there are missing data parts, and reconstructs the missing data with Reed-Solomon. The client receives the complete object and sees no difference apart from the time taken. A read fails when more than `p` parts of a piece are unavailable at the same time. Unavailable here means that the node cannot be reached or answers "not found". A node in [maintenance mode](failure-domains-and-self-healing.md#maintenance-mode) answers with the maintenance status instead. What the reader does with that status depends on the path: - A GET of a whole object first streams the data parts to the client as they arrive. If the node asked for a data part answers with any status other than success or "not found", the storage node passes that answer to the client and ends the read. A maintenance status from a data part holder therefore reaches the client, with no fallback to parity. - A ranged GET, and the fallback of a whole-object GET after a part arrived incomplete, fetch parts one by one. There a maintenance status counts as a failed attempt: the read continues with the next node of the part's sequence and then with parity. ## Repair Every node that holds a part checks the other parts of the same piece as its [policer](failure-domains-and-self-healing.md#the-policer) walks the node's objects. It asks for the header of each other part along that part's sequence. If a part is not found anywhere, the node reads the surviving parts, recomputes the missing ones and stores each on the first node of its sequence that accepts it. Repair needs the same thing as a read: any `d` parts. It reads every part that is available, not only `d` of them, so rebuilding one lost part reads `d + p − 1` parts. The policer makes two exceptions: - A node that answers with the maintenance status may still have its part. The policer counts the part as unavailable and does not recreate it. This holds only while the node answers. If it is switched off, the request fails without that status, and the part is recreated like the part of a failed node. - A part that is found on a node further down its sequence is not recreated. Its holder moves it to the better-ranked node when that node is able to take it. When the network map changes, the same loop moves parts so that part `i` is again on the node ranked `i + 1`. See [Data placement](data-placement.md) for how much data that moves. ## Limits | Limit | Value | |---|---| | EC rules in one policy | 4 | | Data parts, parity parts, and their sum, per rule | at most 64; neither may be 0 | | Candidate nodes per rule (`(d + p)` or the selector count, times the placement factor) | 64 | | Replica rules in the same policy | none: a policy has either `REP` rules or `EC` rules | | Size of one encoded piece | 64 MiB, the network's maximum object size | A policy with several EC rules stores every object once per rule, each rule with its own parts on the nodes of its own selector. A read tries the rules in order, and repair can rebuild the parts of one rule from the parts of another. ## When to prefer replicas Erasure coding saves capacity. Replicas are the better fit in these cases: - **Small clusters.** A write needs `d + p` reachable nodes of the bucket. `REP 3` needs three. A cluster of four nodes can run `EC 2/1` with one node to spare, and has no room for `EC 4/2`. - **Small objects.** Each object becomes `d + p` stored objects with their own headers and index entries, and each write opens `d + p` node-to-node transfers. For objects of a few kilobytes this costs more than it saves. - **Reads that must come from one node.** A replicated object is read from a single holder. An erasure-coded object is assembled from `d` nodes on every read. - **Two sites.** Losing a site removes every part stored there. An EC rule that spans two sites survives the loss of one only if that site holds at most `p` parts of every object, which needs `p ≥ d`. Two replicas in two sites, or one EC rule per site, achieve this more directly. - **Acknowledging before full redundancy.** A replicated bucket can opt into an [initial placement](replication-and-consistency.md#initial-placement) that acknowledges a write after fewer copies. An EC rule is always written in full. In a policy with several EC rules, initial placement can defer whole rules and nothing smaller. [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md) turns these considerations into a procedure, and [Performance](performance.md) describes what each choice costs on the write and read paths. --- # Replication and consistency A replicated bucket keeps `n` full copies of every object, set by a `REP n` rule in its storage policy. This page describes when a write is acknowledged, how a read finds a replica, and what a client can rely on. It separates the properties that follow from the design from those that hold only after background work has finished. Erasure-coded buckets follow the same placement and consistency model. Their write and read rules are in [Erasure coding](erasure-coding.md). The [architecture explorer](/architecture-explorer?scenario=site) replays a site failure for a bucket with two replicas in two sites, including the replication lag. ## When a write is acknowledged The storage node that receives a PUT computes the object's ranking of the bucket's candidate nodes (see [Data placement](data-placement.md)). For each `REP n` rule it sends the object to the first `n` nodes of the ranking in parallel. If one of them fails, it tries the next node of the ranking, and so on through the reserves. **The PUT is acknowledged when every rule of the policy has `n` stored replicas.** They are on the primary holders when all of them answer, and on reserves otherwise. If the candidates of a rule run out before `n` replicas are stored, the write fails: - If no replica of that rule was stored, the client gets an error that carries the error of the last node. - If at least one replica of that rule was stored, the client gets the status `incomplete` (`incomplete object PUT by placement`). The stored replicas stay where they are. The policers treat them like any other object and bring them to full redundancy when enough nodes are available. A client that receives `incomplete` cannot assume that the object is absent. A rule whose candidates are exactly as many as it stores has no reserves: its writes need every one of them to answer. That is the case with a placement factor of 1 and a selector that selects as many nodes as the rule stores. A selector that selects more leaves reserves even at factor 1. ### Initial placement A policy can carry an **initial placement** section that lets a write be acknowledged before the full policy is met. In the console API it is the `initialPlacement` object of a storage policy: | Field | Effect | |---|---| | `maxReplicas` | The write is acknowledged as soon as this many replicas are stored in total, over all rules. | | `replicaLimits` | One number per rule: how many replicas of that rule are written before the acknowledgement. 0 skips the rule for the initial write. For an `EC` rule the number is 0 or 1: 1 writes all `d + p` parts, 0 skips the rule. The number of parts cannot be lowered. | | `preferLocal` | With `maxReplicas`: rules whose nodes include the node handling the request are served first. | The replicas that are still missing after the acknowledgement are queued on the node that handled the PUT and delivered in the background. What this trades: - **Gain.** Latency no longer depends on the slowest replica, and a write can succeed while part of the policy's nodes are unreachable. With two replicas in two sites and `maxReplicas: 1`, writes continue when one site is down. - **Cost.** Between the acknowledgement and the delivery of the remaining replicas, the object has fewer copies than the policy states. If the node or site that holds them is lost in that window, the object is unavailable until it returns, and lost if its drives are. - **Delivery is best effort.** The queue lives in memory, holds 4096 tasks and makes one attempt per target node. When the queue is full, or the attempt fails, or the node restarts, the task is gone. The [policer](failure-domains-and-self-healing.md#the-policer) of a node that holds the object finds the shortage on its next pass and repairs it. Without initial placement there is no such window: an acknowledged object has all its replicas. ## How a read finds a replica A GET names the object by ID. The node that receives it computes the same ranking as the writer did. - If the node is itself a primary holder, it reads its own drives first. - Otherwise it asks the primary holders one after another, then the reserves in ranking order, until one returns the object. A node that is a reserve reads its own drives when the walk reaches its own rank. - A node that is not among the bucket's candidates does not look in its own storage. It forwards the request to one candidate, primary holders first and in random order among those, and passes that node's answer through. The walk continues past a node that cannot be reached or that answers "not found". It ends at the first node that answers anything else. A node in maintenance mode answers with the maintenance status, and that status is passed to the client. A read needs one reachable replica. Replicas are complete, so the object is served from a single node, and a range read is served from a single node as well. For a large object the ID names the whole object, which is stored as pieces plus a link object. The node resolves the pieces and reads each of them the same way, so different pieces can come from different nodes. ## What a client can rely on ### By construction These properties do not depend on timing or on background processes. **Objects are immutable and self-verifying.** An object ID is the SHA-256 hash of the object's header, and the header contains the payload's size and checksum. A storage node checks the ID and the signature of every object it accepts and the payload checksum of every upload. There is no operation that changes a stored object. A read by ID therefore returns the complete object that was written under that ID, or an error. It cannot return an older version, a newer version or a mixture, because none exists. **All replicas are identical.** Since content determines the ID, replicas cannot diverge. There is nothing to reconcile and no conflict resolution. **An acknowledged write is on `n` nodes** (or on the number that the initial placement states). **Read-after-write by ID.** After a PUT is acknowledged, a GET for the returned ID through any node finds the object, provided the network map has not changed in between, at least one holder is reachable, and no node that is asked before a holder is in maintenance mode. The reader walks the same ranking that the writer used, primaries first and then reserves, so it reaches every node the writer could have used. **Deletes win while the tombstone exists.** A delete is recorded as a tombstone object. A node that holds the tombstone answers `object already removed` for the deleted ID and refuses to store the object again, including when a replication request offers it. The protection ends when the tombstone expires (see [Deletes and tombstones](#deletes-and-tombstones)). ### Eventually These properties hold after the policers have completed their passes. Their pace is described in [Failure domains and self-healing](failure-domains-and-self-healing.md). **Full redundancy after a failure or an early acknowledgement.** Missing replicas are restored in the background. **Optimal placement after a network map change.** When nodes join or leave, some objects are no longer on the nodes that rank for them. Reads still find them, with extra hops, as long as the nodes that hold them are still candidates of the bucket. One case needs attention. A bucket that already uses its maximum number of candidates (*count × placement factor*) can **exchange** candidates when storage nodes are added, because the selection by bucket ID may prefer a new node. A node that is no longer a candidate keeps its replicas until its policer has copied them to a current candidate. In the meantime no read reaches them: every node looks for an object on the current candidates only, and the old holder itself forwards a GET to them without looking in its own storage. For an object that had some replicas on remaining candidates, reads continue from those. An object whose every replica was on exchanged nodes is reported as not found until the hand-over, which the old holder's policer performs when its cycle reaches that object. A bucket whose selector picks single nodes and that stays within its maximum after the addition is not affected: it gains candidates and loses none. See [Design trade-offs and limitations](design-trade-offs.md). **Removal of surplus copies.** After a failed node returns, or after replicas have moved, some nodes hold copies that the policy no longer needs. A node drops its copy only after it has seen enough better-ranked nodes holding the object. **Propagation of deletes.** The node that handles a delete stores the tombstone on as many nodes as the policy requires replicas and then sends it to all other nodes of the bucket. A failure in that second round does not fail the delete. A node that missed the tombstone still serves the object until the tombstone reaches it. Policers treat tombstones as objects that every node of the bucket must hold and deliver the missing ones. **Reclaiming space.** A tombstone marks the object as removed in the index of each shard. The shard's garbage collector deletes the data in batches. With Morph's generated configuration it runs every 10 seconds and removes up to 200 objects per run and shard. ### Listing and search Listing a bucket and resolving an S3 key are searches over object attributes. Each storage node answers from the index of its own shards, and the node that handles the request merges the answers of the bucket's nodes (see [Metadata](metadata.md)). The points below describe that merge. A bucket created with a metadata consistency setting is the exception: the node that receives the search answers from its own metadata service and asks no other node. - **Read-your-writes for listings.** An acknowledged object is in the index of every node that stored it. The merged result contains an object as soon as one queried node has it, so a listing that follows an acknowledged write includes the object, provided a holder is among the nodes that answer. - **Deletes appear when the tombstone has spread.** The merge is a union. An object disappears from listings once every queried node that still indexes it has the tombstone. Until then a listing can show an object that a GET through another node already reports as removed. - **Unreachable nodes.** If a queried node fails to answer, the search returns the merged result of the others together with the status `incomplete`. Objects whose only indexed copies are on the silent nodes are missing from that result. - **No snapshot.** A listing that spans several pages is not a point-in-time view. Objects written or removed while a client pages through the result may or may not appear. There is no cross-object transaction. Two writes are independent, and a reader can observe one without the other. ### S3 names S3 addresses objects by key, the storage layer by ID. The gateway resolves a key by searching for the newest object stored under it. "Overwriting" a key stores a new object with a new ID, and "the current version" is the result of a search, with the listing properties above. [How S3 maps onto Morph](s3-on-morph.md) describes the mapping and its caches. ## Deletes and tombstones Deleting an object does not erase anything at once. The node creates a **tombstone**, a small object of its own type that names the deleted object and carries an expiration, and stores it in the bucket. The tombstone lifetime is 5 epochs by default (`object.delete.tombstone_lifetime`; Morph's generated configuration does not change it), which is five hours at the default epoch duration. While a node holds the tombstone, it refuses the deleted object. When the tombstone expires, the garbage collector removes the tombstone as well. The lifetime is the time the tombstone has to reach every node of the bucket. An object under a lock cannot be deleted until the lock expires. See [Data model](data-model.md). ## No replication between clusters Morph has no cross-cluster replication. A deployment is one network with one FS chain, and replicas of an object live on nodes of that network. Copies in several sites are expressed by the storage policy of a bucket within one deployment, as described in [Deploy across sites](../how-to/deploy/deploy-across-sites.md). Copying data to a second, independent deployment is a task for an external S3 tool. --- # Failure domains and self-healing Morph keeps data available through failures by storing each object on several nodes and by repairing in the background what a failure removed. This page goes through the units that can fail, from a drive to a site, and states for each what is lost, what continues to work, and what restores full redundancy. It then describes the process that does the restoring, the policer, and gives the rules for how many failures a storage policy tolerates. The [architecture explorer](/architecture-explorer?scenario=drive) replays a drive failure, and a [rack failure](/architecture-explorer?scenario=rack), step by step on an example deployment. ## The units that fail | Unit | What it is in Morph | Who notices | What restores redundancy | |---|---|---|---| | Drive | One shard of a storage node | The node, on I/O errors | Policers of the other holders, after the shard is taken out of service | | Node | One storage node with all its shards | Other nodes, when requests fail | Policers of the other holders, at once where the bucket has reserves | | Rack, site | A group of nodes that share a node attribute | Other nodes, as for single nodes | The same, if the policy leaves enough candidates elsewhere | | Inner ring node | One member of the group that runs the FS chain | The other inner ring nodes | Nothing to restore; see [Inner ring and FS chain](inner-ring-and-fs-chain.md) | Racks and sites exist for Morph only as attributes that the operator gives to storage nodes and as filters and selectors in storage policies that refer to them. Nothing else in the system knows about them. ## Drives and shards A storage node treats each data drive as a **shard**. A shard consists of: - the **FSTree**, the object store on the data drive, - the **metabase**, a bbolt database that indexes the objects of the shard, - an optional **write-cache** that absorbs writes before they are flushed to the FSTree. The expected layout puts the metabases and write-caches on an SSD and the FSTrees on HDDs. [Configure drives and shards](../how-to/deploy/configure-drives.md) describes how to set this up. A node stores one object or part on one shard, chosen by rendezvous hashing on the object ID. The small link, lock and tombstone objects are kept on every shard. ### Shard modes | Mode | Writes | Metabase and write-cache | Use | |---|---|---|---| | `read-write` | yes | in use | Normal operation | | `read-only` | no | in use | Before evacuating a shard that still reads | | `degraded` | yes | not used | Not for regular use: writing without the index can lead to unexpected behavior | | `degraded-read-only` | no | not used | A failed data drive, or a failed or replaced SSD | | `disabled` | no | closed | Only in the configuration file, to switch a shard off | A shard switches to `degraded-read-only` by itself in two cases: its metabase cannot be reopened during a configuration reload, or its error counter reaches the threshold `storage.shard_ro_error_threshold`. A shard whose metabase cannot be opened at startup is switched to `read-only`, and to `degraded-read-only` only if that switch fails. ### What a failed drive removes A failed data drive removes one replica, or one part, of every object that the node kept on that shard. The node stays in the network map and its other shards keep working. Reads of the affected objects are served by the other holders: another replica, or, for an erasure-coded object, the remaining parts. ### The required operator action :::warning A failed data drive is not repaired automatically with Morph's default configuration. You must take the shard out of service. ::: The reason is the split between data and index. When the data drive of a shard fails, the shard's metabase on the SSD is intact and still lists every object of the shard. As long as the shard stays in `read-write` mode with that metabase in use, the node answers a peer that offers a re-created replica or part with "already present" and does not store it. The peers' policers keep finding the object short and keep being turned away. Redundancy is restored once the shard is in `degraded-read-only` mode. Its metabase is then out of use, the node no longer claims the lost objects, and incoming replicas go to the node's other shards. The node makes this switch by itself only when shard errors reach `storage.shard_ro_error_threshold`. The default is 0, which disables the automatic switch, and Morph's generated storage node configuration does not set the threshold. Failed writes and failed reads by object ID count as errors. Failed reads of erasure-coded parts are logged and not counted. The operator therefore sets the mode with `neofs-cli control shards set-mode`. [Replace a failed drive](../how-to/operate/replace-a-failed-drive.md) gives the procedure. After the replacement, the new drive is a new shard with a new ID. The node's policer moves to it every object whose first-choice shard it now is, so the node fills evenly again. ## Nodes A node that stops takes all its shards with it. Other nodes notice through failing requests. There is no failure detector and no immediate change to the network map. **Reads** skip the node. A replicated object is read from the next holder in the ranking. An erasure-coded object is read with a parity part in place of the missing one. **Writes** go to reserves. A new object whose ranking includes the stopped node is stored on the next free candidate instead. Writes fail only when a rule has fewer reachable candidates than it needs: `n` for `REP n`, `d + p` for `EC d/p`. **Repair starts without waiting for the network map.** When a policer on another holder checks an object and cannot reach the stopped node, it continues along the ranking, finds a reserve that lacks the object, and copies the replica or re-creates the part there. A replicated bucket whose rule has no reserves (placement factor 1 with a selector that selects only as many nodes as the rule stores, or every matching node already in use) has nowhere to put the copy and stays short until the map changes. An erasure-coded bucket without reserves still repairs: the re-created part goes to the next reachable node of its sequence, which then holds two parts of the object. **The network map follows later.** Each storage node confirms its presence on the FS chain once per epoch. The netmap contract removes a node whose last confirmation is more than 3 epochs old. With Morph's default epoch of 3600 seconds, a stopped node leaves the network map 3 to 4 hours after it stopped. Placement is then recomputed without it: buckets select a replacement candidate where one matches, and policers move objects to the nodes that now rank for them. **When the node returns**, it registers again and enters the network map at the next epoch. Its drives still hold what they held. The policers remove the copies that were made in its absence and are now surplus, and deliver what the node missed. [Handle a node failure](../how-to/operate/handle-a-node-failure.md) lists what to check. ### Maintenance mode For planned work, a node can be put into **maintenance mode**. It then answers the object operations PUT, GET, HEAD, DELETE and search with the status `NODE_UNDER_MAINTENANCE`, and the state is published in the network map from the next epoch. The handler for replication requests from other storage nodes has no such check. Policers treat a node under maintenance as a holder in good standing. This avoids rebuilding data that will be back in a few minutes. The rule differs by kind of bucket: - **Replicated objects.** A policer counts the node as a holder when the network map shows it under maintenance or when it answers with the maintenance status. It does not copy the replica elsewhere and does not delete a copy that it would otherwise consider surplus. This also holds while the machine is switched off, as long as the network map still lists the node under maintenance. - **Erasure-coded parts.** A policer leaves a part alone only when the node answers with the maintenance status. If the machine is switched off, the request fails without that status and the part is re-created like the part of a failed node. Maintenance mode also affects reads. A stopped node is skipped, but a node under maintenance answers, and its status is passed to the client. A GET that asks the node for a replica before it has found another holder ends with `NODE_UNDER_MAINTENANCE`. So does a GET of a whole erasure-coded object that asks the node for a data part. A ranged GET of an erasure-coded object skips the node and continues with other nodes and parity, as [Erasure coding](erasure-coding.md) describes. The cost is that redundancy is reduced for the duration and that nothing compensates if the node does not come back. The node documentation states it this way: persistence of the data after maintenance is expected but not guaranteed. [Use maintenance mode](../how-to/operate/use-maintenance-mode.md) describes when and how. ## Racks and sites The loss of a rack or a site is the loss of several nodes at once. Everything said about a single node applies to each of them. Two questions decide the outcome. **Does every object keep enough replicas or parts outside the lost domain?** This depends on where the policy put them. Morph does not spread data over racks or sites unless the policy says so, and a selector with `IN DISTINCT` gives that guarantee per object only in the forms described in [Data placement](data-placement.md#distinct-failure-domains-with-a-placement-factor-above-1). **Can the policy still be satisfied afterwards?** After the lost nodes leave the network map, a policy that names the lost site or needs more distinct sites than remain cannot be applied, and every operation on its buckets fails until nodes return. A policy that leaves the choice of sites open moves the bucket to the remaining sites without operator action. A site failure also affects the inner ring. The FS chain keeps producing blocks only while a quorum of inner ring nodes can reach each other: 3 of 4, or 5 of 7. Place the inner ring nodes so that the loss of any one site leaves a quorum, for example seven nodes over four sites as 2 + 2 + 2 + 1. Without a quorum, nothing that needs a chain transaction happens: no new buckets, no epoch change, and no change to the network map. The failed nodes are then not removed from the map either. Reading and writing objects needs no chain transaction and continues on the nodes that can still read the chain. See [Inner ring and FS chain](inner-ring-and-fs-chain.md). [Deploy across sites](../how-to/deploy/deploy-across-sites.md) and [Recover from a site failure](../how-to/operate/recover-from-a-site-failure.md) turn this into layouts and procedures. ## The policer Every storage node runs a policer. It is the only repair mechanism for object data, and it is also what moves data after the network map changes. ### What it does The policer walks all objects in the node's shards in a continuous cycle. For each object it computes the current ranking and checks the other nodes by requesting the object's header. Depending on what it finds, it does one of the following. | Finding | Action | |---|---| | A replicated object has fewer holders than the policy requires | Copies the object to the next nodes of the ranking that lack it | | A part of an erasure-coded object is not found on any node of its sequence | Reads the parts that are available (at least `d` are needed), recomputes the missing part, stores it on the first node of its sequence that accepts it | | Enough holders exist, but a better-ranked node lacks the object or part | Copies it there | | Enough better-ranked nodes hold the object, and this node is not needed | Deletes the local copy | | A tombstone, lock or link object is missing on a node of the bucket | Copies it there; these objects belong on every node of the bucket | | The object is on a shard other than the one that ranks first for it | Moves it to that shard | | The bucket no longer exists | Deletes the local object | | A node that should hold the object is under maintenance | Counts it as a holder and keeps the local copy | Safeguards apply to deleting. A node that is not among the bucket's candidates keeps a replica until it has seen at least one candidate holding the object. A node that is itself outside the network map keeps its replicas. An erasure-coded part is dropped only after a better-ranked node of its sequence has confirmed that it holds the part. ### What triggers it Nothing triggers the policer. It does not react to events such as a failed request or a new epoch. It runs all the time, and a failure is found when the cycle of some holder reaches an affected object. A change of the network map takes effect in the same way: from the new epoch on, the rankings that the policer computes are the new ones. ### Its pace The policer processes one batch of objects per interval. | Setting | Default | Meaning | |---|---|---| | `policer.object_batch_size` | 10 | Objects checked per batch | | `policer.replication_cooldown` | 1 s | Interval between batches | | `policer.boost_multiplier` | 3 | Factor on the batch size while the node keeps finding shortages | | `policer.head_timeout` | 5 s | Time limit for one header request to another node | Morph's generated storage node configuration sets none of these, so the defaults apply. A node therefore checks at most 10 objects per second, which is 864,000 objects per day, counting every replica and every erasure-coded part on the node as one object. The boost applies to shortages only. The policer keeps a window of the last 8 batches. A batch counts as a shortage batch when an object with missing replicas or parts has been found since the current cycle over the node's objects began, so one shortage marks every later batch of that cycle. The policer multiplies the batch size when at least 5 of the 8 batches are marked and returns to the normal size when at least 5 are clean. With the defaults a node in boost mode checks at most 30 objects per second. Moving objects to better-ranked nodes after an expansion does not start the boost. The time to restore redundancy after a failure is therefore governed by the number of objects on the surviving holders and these settings. It is not governed by the amount of lost data alone, because a holder has to reach the affected objects in its cycle. These settings belong to the Morph-managed storage node configuration (manual edits are not supported without advice from Morph support). [Storage node settings](../reference/configuration/storage-node.md) lists them for reference, and [Performance](performance.md) discusses the effect of repair on client traffic. The policer reports whether its last complete cycle found any shortage and whether it found any misplaced object. [Check cluster health](../how-to/observe/check-cluster-health.md) shows how to read this. ## How many failures a policy tolerates The rules below count **holders of one object**. Whether a rack or a site counts as one failure or as several depends on how many holders of the same object the policy can put into it. **Rule 1: `REP n` keeps an object readable while one of its `n` replicas is reachable.** It tolerates the loss of `n − 1` holders. `REP 3` survives two lost nodes. `REP 1` has no redundancy: the loss of the drive that holds the object loses the object. **Rule 2: `EC d/p` keeps an object readable while any `d` of its `d + p` parts are reachable.** It tolerates the loss of `p` holders. `EC 4/2` survives two lost nodes. **Rule 3: Writes need more than reads.** A write to `REP n` needs `n` reachable candidates of the rule, and a write to `EC d/p` needs `d + p`. An [initial placement](replication-and-consistency.md#initial-placement) can lower the number for a `REP` rule. It cannot for an `EC` rule, which is written with all its parts or, in a policy with several rules, left out of the first write. Reserves are what keeps writes going during a failure. `REP 3` with the default placement factor of 3 has up to nine candidates and accepts writes with six of them down. `REP 2` with placement factor 1 and no selector that selects more has two candidates and accepts no writes with one of them down. **Rule 4: Tolerance returns after repair.** The numbers above apply to failures that overlap. When the policers have restored full redundancy on the remaining nodes, the bucket tolerates the same number of further failures, as long as each rule still has enough candidates. **Rule 5: A failure domain is tolerated if it never holds more than the tolerated number of holders of one object.** For replicas this means at most `n − 1` replicas of an object in one rack or site. For erasure coding it means at most `p` parts. - With a policy that does not mention racks, keep the number of nodes per rack at or below the tolerance. Under `EC 4/2` a rack of two nodes can hold at most two parts of an object while all nodes are up, since each node holds one part. - With a policy that selects distinct domains, use one of the forms that guarantee the spread per object: placement factor 1, or one rule per domain. - After a repair that ran while nodes were down, one node can temporarily hold more than one part of the same object. The margin is reduced until the nodes return or leave the network map and the policers have put the parts back in rank order. **Rule 6: The policy must remain satisfiable.** Tolerating a failure for existing data is not enough. If the lost nodes leave the network map and the policy can no longer select its minimum, the bucket stops serving requests until matching nodes are back. Examples: | Policy | Cluster | One node lost | One rack lost | One site lost | |---|---|---|---|---| | `REP 3`, placement factor 3 | 12 nodes, one site, racks of 4 | Readable, writable, repaired on reserves | Readable if no rack held all three replicas of an object, which this policy does not exclude | Not tolerated | | `EC 4/2`, placement factor 2 | 8 nodes, one site, racks of 2 | Readable, writable, repaired on reserves | Readable and writable: at most 2 parts lost, 6 nodes remain | Not tolerated | | `REP 2` over 2 distinct sites, placement factor 1 | 3 sites | Readable; writes need initial placement; repair after the node leaves the map | As for the node | Readable from the other site; the bucket moves to the third site after the map change | | One `REP 1` rule per site, 2 sites named in the policy | 2 sites | Readable, writable with reserves in the site | Readable, writable with reserves in the site | Readable from the other site and writes need initial placement, until the lost nodes leave the map; then unsatisfiable until the site returns | See [Resilience tests](../reference/resilience-tests/index.md) for measured fault-injection scenarios and recovery results across a deployed cluster. --- # Metadata Morph has no metadata server. What other systems keep in a central database is split into three kinds of metadata, each kept where it is needed. | Kind | Examples | Where it lives | Agreement | |---|---|---|---| | Cluster metadata | Buckets and their storage policies, access rules, users, the network map | On the FS chain, replicated to every inner ring node | By consensus, one state for all | | Object metadata | Object headers and attributes, tombstones, locks, counters | In the metabase of each shard, next to the object data | None needed: each node indexes what it holds | | S3 names | The object that a key currently refers to, versions, tags | Derived from object metadata by attribute search | None stored | ## Cluster metadata: on the FS chain Everything that must be the same for all nodes is a record on the FS chain: the list of buckets with owner, policy and attributes, the access rules of each bucket, the mapping of bucket names to bucket IDs, the network map of each epoch, and the users, named storage policies and cluster settings that Morph's own contracts hold. [Inner ring and FS chain](inner-ring-and-fs-chain.md) describes the chain. This data is small. Its size depends on the number of buckets, users and nodes, and does not grow with the number of objects. It changes through transactions and is read by every other component through the RPC endpoint of an inner ring node. ## Object metadata: in each shard An object consists of a header and a payload. The header holds the object's ID, bucket, owner, size, checksum, type, creation epoch and attributes. Header and payload are stored together in the FSTree of one shard. The shard's **metabase**, a bbolt database, indexes the headers of that shard's objects. For every bucket that has objects on the shard, the metabase holds: - the IDs of the objects, - an index from each attribute and value to the objects that carry it, with a separate ordered index for integer values, - an index from each object to its attributes, - marks for removed objects and for buckets scheduled for garbage collection, - counters: stored objects, user-visible objects, tombstones, locks, link objects, garbage, and payload bytes. Three properties follow from this layout. **The index is local.** A metabase describes the objects of its own shard and nothing else. A node knows what it holds. No node knows what the cluster holds. **The index travels with the data.** When an object is written, replicated or repaired, the receiving shard indexes it as part of the write. There is no second system to update and no window in which data exists without its index entry on the same shard. **Each holder indexes the whole header.** A replica carries the full header. A part of an erasure-coded object carries the header of the object it belongs to. Every node that holds a replica or a part can answer attribute queries about the object. The expected hardware layout puts metabases on SSD, because every object operation reads or writes one. ### How a search is answered A search names a bucket and a set of attribute filters. The storage node that receives it does not consult an index of the bucket, because none exists. It asks the nodes of the bucket, each of which runs the query against its own metabases, and merges the sorted answers. - For a replicated bucket, every candidate node of the bucket is asked. - For an erasure-coded bucket and a query on a user attribute, a random subset of the candidates is asked. The subset is large enough that it contains a holder of every object even when `p` of the holders fail to answer. - One request returns at most 1000 results and a cursor for the next page. - If a node fails to answer, the merged result of the others is returned with the status `incomplete`. The cost of a search therefore grows with the number of nodes in the bucket's candidate set and with the size of the result. It does not depend on the number of buckets or on the total number of objects in the cluster. ## S3 names: resolved by search The storage layer addresses objects by ID. S3 addresses them by key. Morph stores no table from keys to IDs. The S3 gateway writes the key into the object's `FilePath` attribute. To serve a GET for a key, it searches the bucket for objects with that `FilePath` and takes the one with the newest timestamp. Listing a prefix is a search on the same attribute. Versions of a key are the objects that share a `FilePath`, a delete marker is an object, and tags and object locks are found by search as well. The same mechanism serves the console's REST API, which exposes attribute search directly (see [Search objects](../how-to/buckets-and-objects/search-objects.md)). Consequences: - **A GET by key costs one search plus one read by ID**, unless the gateway has the answer cached. A read by object ID, which the REST API allows, skips the search. - **Listing is a fan-out.** Each page of a listing is a search across the bucket's nodes. The larger the candidate set of the bucket, the more nodes take part in every page. - **Listings have the consistency of searches**, described in [Replication and consistency](replication-and-consistency.md#listing-and-search). [How S3 maps onto Morph](s3-on-morph.md) covers the S3 side in detail. ## Caches and their lifetimes Because lookups are computed or searched, caches sit in front of the frequent ones. All of them are in memory, per process, and are not shared between nodes. **In the S3 gateway**, with the values that Morph's installer writes: | Cache | Holds | Lifetime | Entries | |---|---|---|---| | `objects` | Object headers | 300 s | 150 | | `list` | Object listings | 1 min | 100 | | `names` | The current object for a key: ID, tags, lock information | 1 min | 1000 | | `buckets` | Bucket name to bucket information | 1 min | 500 | | `system` | System data kept as objects in a bucket, such as object tags and lock state | 2 min | 1000 | | `accessbox` | S3 credentials (access boxes) by access key ID | 5 min | 10 | | `accesscontrol` | Results of access checks per owner | 1 min | 100000 | A gateway's cache does not see changes made through another gateway. After an overwrite or a delete through one Morph node, a GET for the same key through another node can return the previous object until that node's `names` entry expires, up to one minute with these values. [S3 gateway settings](../reference/configuration/s3-gateway.md) lists the options. **In the storage node:** | Cache | Holds | Lifetime | |---|---|---| | FS chain cache (`fschain.cache_ttl`) | Buckets, bucket lists, access rules read from the chain, up to 100 entries of each kind | 15 s | | Bucket placement | The candidate nodes of up to 1000 buckets | Entries are kept per epoch | | Object placement | The ranking for up to 10,000 objects | Entries are kept per epoch | An entry of the FS chain cache is read again from the chain after its 15 seconds. A failed read is cached for the same time. The cache therefore does not carry a storage node through an outage of its chain RPC endpoints: once the cached record of a bucket has expired, requests for that bucket fail until the chain can be read again. The network map itself is not polled. Storage nodes receive each new epoch as a notification from the chain. ## The optional chain-backed object metadata By default object metadata exists only in the metabases, as described above. A bucket can opt into a second mode in which the storage nodes of the bucket also agree on the bucket's object metadata. - In the console API it is the field `consistency` of a named storage policy, with the values `strict` and `optimistic`. A bucket created with such a policy reports the value in its field `metadataConsistency`. The API describes it as experimental. - On the storage layer it is the bucket attribute `__NEOFS__METAINFO_CONSISTENCY`. - With `strict`, a PUT returns after the object's metadata has been validated, signed by the required number of the bucket's nodes and recorded. With `optimistic`, the PUT returns first and the recording follows. - The metadata of such a bucket is gathered on every storage node of the bucket, in the node's metadata service (`metadata.path` in the storage node configuration). A search in such a bucket is answered by the metadata service of the node that receives it, without asking the other nodes. ## What this means for recovery **Nothing central has to be rebuilt.** No component holds a map of object locations or a catalog of objects whose loss would make data unreachable. Locations are computed from the storage policy, the network map and the object ID. Object metadata is on the same nodes as the objects. **A lost shard loses its own index and nothing else.** When a data drive fails, the objects on it are re-created on other shards and nodes by the policers, and each receiving shard indexes what it receives. The other shards' metabases are unaffected. **A lost metabase affects one shard.** When the drive that carries a shard's metabase fails, that shard has to run in `degraded-read-only` mode. The node switches it to that mode when it cannot open the metabase on a configuration reload. At startup it switches the shard to `read-only` instead, and to `degraded-read-only` only if that fails, so after a restart you may have to set the mode yourself. It switches a running shard only when the error threshold is set, which it is not by default (see [Failure domains and self-healing](failure-domains-and-self-healing.md#shard-modes)), so otherwise the operator sets the mode. In this mode the shard's objects can still be read by ID from the FSTree, and the node no longer answers searches for them. If one SSD carries the metabases of all shards of a node, as in the expected layout, its loss puts all shards of that node into this mode. The objects remain indexed on their other holders. **The chain is the part to protect.** The FS chain is the only state that is not derived from stored objects. It is replicated on every inner ring node, and a quorum of them is needed to change it. If the chain were lost on all inner ring nodes, the buckets, access rules and users would be lost with it, even though the object data would still be on the drives. [Back up and restore](../how-to/operate/back-up-and-restore.md) covers what to save. --- # Inner ring and FS chain A Morph cluster has two groups of processes with different jobs. Storage nodes hold objects. The **inner ring** holds the small set of facts that every node must agree on: which buckets exist, who may use them, and which storage nodes are part of the network. The inner ring keeps these facts in a replicated ledger, the **FS chain**. This page describes what the inner ring does, how it agrees, and what its limits mean for operating a cluster. ## What the inner ring does Every cluster-type Morph node runs one inner ring node (the `neofs-ir` process). Together they run the FS chain and execute the contracts deployed on it. The chain records: - the **network configuration**, such as the maximum object size and the epoch duration, - the **network map**: the storage nodes of the current epoch with their addresses and attributes, - **buckets**: their owner, storage policy and attributes, - **access rules** of buckets, - **names**: the mapping from a bucket name to a bucket ID, - the data of the contracts that Morph adds, described [below](#contracts-that-morph-adds). The inner ring also drives the **epoch**, the clock of the network, and approves storage nodes that ask to join. A change to any of these is a transaction on the chain. It takes effect when a block that contains it is accepted, and from then on every node reads the same state. ## What the inner ring does not do - **It stores no objects and no object metadata.** The amount of data on the FS chain is small and does not grow with the number of objects. The exception is the separate metadata chain, which Morph enables on every inner ring node: for buckets created with a metadata consistency setting it records every object (see [Metadata](metadata.md)). - **It is not in the data path.** A PUT or GET travels from the client to a gateway and to storage nodes. No inner ring node handles the payload, chooses the holders or confirms the write. - **It does not coordinate repair.** Storage nodes find and repair missing replicas among themselves. Storage nodes, gateways and the console read the chain through the RPC endpoint of an inner ring node and cache what they read. A storage node keeps buckets and access rules in a cache with a lifetime of 15 seconds (`fschain.cache_ttl`) and receives new epochs as notifications. An operation on an object therefore reads chain state from memory in the common case. ## Agreement: dBFT and the quorum Inner ring nodes exchange blocks over their own peer-to-peer protocol (port 20333 by default) and agree on each block with the dBFT algorithm. dBFT is Byzantine fault tolerant: it produces correct results while fewer than a third of the nodes are faulty, whether they are down or misbehaving. With `n` inner ring nodes, a block needs the agreement of ```text n − (n − 1) / 3 (integer division) ``` nodes. | Inner ring nodes | Needed for a block | Nodes that may fail | |---|---|---| | 1 | 1 | 0 | | 4 | 3 | 1 | | 7 | 5 | 2 | One node is for tests. Production clusters use four or seven. Sizes in between add nodes without adding tolerance: five or six nodes still tolerate one failure. A block is final when it is accepted. The protocol is designed so that two different blocks are never accepted at the same height while fewer than a third of the nodes are faulty, and it has no rollback. The block interval is dynamic. With transactions waiting, blocks follow each other after 50 ms (`time_per_block`). Without transactions, an empty block is produced after the maximum interval (`max_time_per_block`). The installer writes a maximum of 2 s into the inner ring configuration. After the first start of a cluster-type node, the entrypoint changes it to 20 s and restarts the inner ring process, so a running cluster has a block interval between 50 ms and 20 s. ## Why the size is fixed The inner ring nodes are the committee of the chain. The list of their public keys is part of the chain's protocol configuration and is written when the cluster is installed. Every installer of a cluster-type node receives the same list of all cluster-type nodes for that purpose. The number of inner ring nodes is fixed for the life of the network. There is no procedure to add or remove a member afterwards. Decide between one, four and seven cluster-type nodes before the installation, and place them so that the failures you plan for leave a quorum (see [Failure domains and self-healing](failure-domains-and-self-healing.md#racks-and-sites)). The number of storage nodes is independent of this and can change at any time. [Size a cluster](../how-to/deploy/size-a-cluster.md) covers the decision. ## Epochs An **epoch** is the unit of time of the network. The epoch number is a counter on the chain, and the inner ring increments it when the configured epoch duration has passed. In Morph the duration is 3600 seconds by default. Epochs exist so that all nodes change their view of the network at the same moment. The network map does not change within an epoch. At the epoch change: 1. The netmap contract sets the new epoch number. 2. It removes from the candidate list every storage node whose last sign of life is more than 3 epochs old (the cleanup threshold). 3. If the list of nodes or their states changed since the last epoch, it publishes a new version of the network map. 4. The inner ring applies each bucket's storage policy to the new map and records the resulting node lists in the container contract. 5. Every storage node receives the new epoch, loads the new network map, and confirms its own presence for the next round. On the storage nodes the new epoch has further effects: placement is computed from the new map from then on, and tokens with a lifetime in epochs age. Objects that carry an expiration epoch, as older versions wrote it, become eligible for garbage collection when that epoch has passed. Objects written by Morph 0.30.1 carry an expiration time and do not wait for an epoch. ## How storage nodes join and leave **Joining.** A new storage node has its own key. An administrator grants access to the node's account through the console API. The node then sends its description (key, addresses and attributes) to the netmap contract. Each inner ring node validates the candidate, and in Morph additionally asks a verification service on its own machine, which checks the request against the cluster's license. With the approval of the inner ring the node becomes a **candidate**. It appears in the network map at the next epoch and takes part in placement from then on. [Add storage nodes](../how-to/operate/add-storage-nodes.md) gives the steps. **Staying.** A node in the map confirms its presence once per epoch. It can also change its own state, for example to maintenance, and the change is published with the next epoch. **Leaving.** A node leaves in one of three ways. It sets its own state to offline. An administrator decommissions it through the console API, which blocks its account and removes it from the candidates. Or it stops confirming and is removed by the cleanup threshold after more than 3 epochs. In each case the node is absent from the network map of the following epoch. [Decommission a node](../how-to/operate/decommission-a-node.md) describes the orderly way. ## When the quorum is lost If fewer inner ring nodes than the quorum can reach each other, no block is accepted. The chain stops where it is. **What stops:** - creating and deleting buckets, - changing access rules, bucket attributes and quotas, - creating, changing and deleting users, storage policies and other data held in Morph's contracts, - epoch changes, and with them every change to the network map: no node joins, no failed node is removed, no maintenance state is published, - anything that waits for an epoch, such as the expiration of objects that carry an expiration epoch. Expiration by time, which Morph 0.30.1 sets, continues. **What continues:** - The chain can still be read. Each remaining inner ring node serves the last accepted state. - Reading and writing objects in existing buckets needs no transaction. Storage nodes that can reach an inner ring node's RPC endpoint keep working with the last network map. - Policers keep repairing within that network map. The chain resumes by itself when enough inner ring nodes are reachable again. Nothing has to be repaired, because no block was accepted without a quorum. The practical consequence is for multi-site layouts: a site failure that also takes the quorum freezes the network map at the moment of the failure. Buckets whose policy needs the map to change before they can be repaired stay as they are until the quorum is back. ## Contracts that Morph adds The FS chain carries the contracts of the storage layer (network map, buckets, names, balances). Morph deploys four contracts of its own on the same chain. The console reads and writes them, and every console in the cluster sees the same state without a database of its own. | Contract | Holds | |---|---| | Storage policies | Named storage policies: system policies for everyone and policies of individual users, and which system policy is the default | | User management | Users with their role and keys, by namespace, and default storage quotas | | Cluster configuration | Namespaces, single sign-on providers, the license, and the schedule of chain hardforks | | Meta storage | The public keys of the consoles and S3 gateways that are registered with the cluster | Because these records are on the chain, they have the chain's properties: a change needs a quorum, it is visible to all nodes once its block is accepted, and it survives the loss of any console. ## Hardforks The chain software changes its rules at defined block heights, called hardforks. All inner ring nodes must switch at the same height. A new cluster starts with every stable hardfork that its Morph version knows enabled from the first block. For an existing cluster, a newer Morph version schedules a pending hardfork through the cluster configuration contract: the contract fixes an activation height about five days ahead, each cluster-type node writes that height into its inner ring configuration and restarts only its inner ring process. The storage node, console and gateway keep running. All cluster-type nodes must be upgraded before the activation height, and block production pauses briefly if several nodes restart their inner ring process within the same minute and drop below quorum. See [Upgrade a cluster](../how-to/operate/upgrade.md#check-the-result) to check hardfork logs after an upgrade. --- # How S3 maps onto Morph Morph does not store data in an S3-shaped structure. It stores immutable objects that are addressed by an ID, grouped in buckets that carry a storage policy, with the list of buckets and their access rules recorded on the FS chain. The S3 gateway translates between the two models. It holds no data and no index of its own: everything it knows is either an object on the storage nodes, a record on the FS chain, or a short-lived cache entry. This page explains the translation, because most of the deviations listed in [S3 compatibility](../reference/s3-compatibility.md) follow from it. ## The gateway Every Morph node runs one gateway process. On a cluster-type or storage-type node it sends its requests to the storage node on the same machine by default. A gateway-type node has no storage node; its gateway uses the storage nodes of the cluster that it was given at installation. In both cases that storage node reaches the other nodes of the bucket. Because the gateway keeps no state, any number of gateways can serve the same buckets, and a load balancer can spread clients over them. What gateways do not share is their caches, which matters for the consistency a client sees. That is the subject of the last section. ## Buckets and the name registry An S3 bucket is a Morph bucket. NeoFS tools show it as a container. It is created by a transaction on the FS chain and is identified by a bucket ID. S3 clients address buckets by name, so the name has to be turned into the ID. The registry for that is the name service contract on the FS chain: a bucket name is registered as a domain in the zone `container`, and the gateway resolves `my-bucket.container` to the bucket ID through the chain RPC endpoints in its configuration. On a gateway bound to a namespace the name carries the namespace as a further label, so equal bucket names in different namespaces do not collide. Two consequences follow. Bucket names are unique within the network, or within the namespace, and creating or deleting a bucket is a chain transaction: it needs the inner ring quorum and completes when a block contains it. Reading the registry needs no quorum. What a chain without quorum means for a running cluster is described in [Inner ring and FS chain](inner-ring-and-fs-chain.md). The bucket also carries what S3 calls bucket configuration. Versioning state, the Object Lock default, ownership controls, CORS rules, bucket tags and the notification configuration are stored as attributes of the bucket on the FS chain, and the `LocationConstraint` given at creation is stored the same way. The location constraint names a storage policy. There are no regions in Morph; the place where S3 has a region is used to choose how and where the data of the bucket is stored, as described in [Data placement](data-placement.md). ## Keys are attributes, lookup is a search An object in Morph has an ID, a header with attributes, and a payload. It has no name in the sense of S3. The gateway stores the S3 key in the `FilePath` attribute of the object and stores the content type, the user metadata and the tags given with the upload as further attributes. The whole header is limited to 16 KiB, which is the only bound on the key length and the metadata size. To serve `GET /my-bucket/my-object` the gateway therefore cannot open a path. It asks the storage nodes of the bucket to search for objects whose `FilePath` equals `my-object`, takes the newest result, and then reads that object by ID. The storage nodes answer the search from the index each of them keeps for its own objects, see [Metadata](metadata.md). There is no central index and no directory structure: `a/b/c` is one attribute value, and a "folder" exists only as a common prefix of keys. Objects are immutable. Overwriting a key in an unversioned bucket writes a new object and then deletes the objects that carried the key before. For a moment both exist, and the search returns both; the gateway picks the one with the later creation time. The creation time has a resolution of one second. It is taken from the signing time of a request signed in the `Authorization` header and from the clock of the gateway for presigned and anonymous requests, so two writes to one key within the same second have no defined order. ## Versions Because every write creates a new object with a new ID, versioning needs no separate mechanism. In a versioned bucket the gateway marks each new object with a versioning attribute and deletes nothing. The version ID that S3 clients see is the object ID. The current version of a key is the newest object with that key; the list of versions is the result of the same search, ordered by creation time. A delete without a version ID stores an empty object with a delete-marker attribute. When the newest object of a key is a delete marker, the key reads as absent. A delete with a version ID removes that one object. Suspending versioning makes new writes unversioned again while the stored versions remain. ## Multipart uploads A multipart upload is built from the mechanism the storage nodes already use for large objects. A payload larger than 64 MiB is always stored as a chain of pieces plus a link object that lists them; a reader of the large object follows the link. The gateway uses the same structure and fills it in over several requests. CreateMultipartUpload stores an empty first piece, whose object ID becomes the upload ID, and a small information object that holds the key and the metadata for the final object. Each UploadPart stores the part as one or more pieces. When the part with the preceding number is already there, the new pieces are chained directly behind it and the running SHA-256 of the whole payload is carried forward in an attribute. When the preceding part is missing, the part is stored on its own, outside the chain. CompleteMultipartUpload checks the part list, writes a final empty piece that carries the header of the complete object, and writes the link object. From that moment the object exists under its key. No payload is copied at completion as long as the parts arrived in ascending order. This design explains three things that differ from Amazon S3. The ETag of a part and of the completed object is a SHA-256 checksum, because that is what the storage layer computes, and the completed object has the checksum of its whole payload instead of a hash of part hashes. A part is limited to 4 GiB minus one byte. And the order of uploads matters for cost: a part that was uploaded before its predecessor, and every part after it, is read back and written again during CompleteMultipartUpload to form the chain. Clients that upload parts in parallel still produce a correct object, but the completion request then takes time in proportion to the data that has to be rewritten, and the storage nodes write that data twice. Parts of an upload that is never completed stay in the bucket until AbortMultipartUpload removes them. The gateway has no lifecycle rules that would do it. ## Access control on top of Morph access rules Morph controls access per bucket, with a table of rules that allow or deny an operation to a user or to everyone. The storage nodes enforce the table on every request. S3 ACLs and bucket policies are two notations for writing into that one table. PutBucketAcl and the canned ACLs of CreateBucket are translated into rules for the grantees, and PutBucketPolicy is translated statement by statement. GetBucketAcl and GetBucketPolicy work in the opposite direction and render the current table. For that reason a policy read back is not the document that was uploaded, a policy and an ACL on the same bucket are not independent of each other, and policy features without an equivalent in the table, such as conditions and wildcard resources, cannot be expressed. A principal is a Morph user, written as the user's address, or everyone. There are no object ACLs. The owner of every object is the owner of the bucket, and ACL headers on uploads change nothing. With the default ownership setting of a bucket the gateway rejects an upload that asks for a canned ACL other than `private` or `bucket-owner-full-control`. The model behind the rules is described in [Security model](security-model.md). ## Credentials: the access box Storage nodes do not know S3 signatures. They accept requests that are signed with a key and, when the signer acts for someone else, accompanied by a session token in which that user delegates rights to the signer. The S3 credential connects the two worlds. When a user creates an S3 credential, Morph generates a secret access key and a session token that lets the gateways act for the user, puts both into an access box, encrypts the box for the public keys of the gateways, and stores it as an object. The access key ID that the user receives is the address of that object in a form that fits the S3 syntax. Nothing about the credential is stored in the gateway. On each signed request the gateway takes the access key ID from the signature, fetches the access box it points to, and decrypts it with its own wallet key. With the secret from the box it recomputes the Signature Version 4 of the request and compares. If the signature matches, the gateway sends the storage request signed with its own key and attaches the session token from the box, so that the storage nodes treat the request as coming from the user and apply the user's access rules. A request without a signature is forwarded as an anonymous user and succeeds only where the bucket allows everyone. Three properties of S3 credentials in Morph follow. A credential can be restricted to one bucket and to a set of operations when it is created, because the session token names the bucket and the operations it delegates. A credential expires with its access box. And revoking a credential means deleting the access box; a gateway that has the box in its cache keeps accepting the credential until the cache entry expires. Creating and revoking credentials is described in [Manage S3 credentials](../how-to/secure/manage-s3-credentials.md). ## Why listing behaves as it does A listing is a search. For ListObjectsV2 with a prefix the gateway asks the storage nodes for all objects of the bucket whose `FilePath` starts with the prefix. The answer arrives in pages of up to 1000 results, sorted by key, with the size, the creation time and the checksum of each object attached, so the gateway does not have to read each object header. The search returns objects, and a listing shows keys. The gateway reduces all versions of a key to the newest, hides keys whose newest version is a delete marker, and, when a delimiter is given, folds all keys below a common prefix into one entry. This work is done in the gateway for every request. Several costs follow from it. A listing with a delimiter still visits every key under the prefix, so listing the top level of a bucket with millions of keys in a few "folders" is as expensive as listing all keys. A versioned bucket with many versions per key needs more search pages for the same number of listed keys. Pagination restarts the search behind the last key returned and carries no server-side cursor state between requests. And ListObjectVersions can return a page with fewer entries than requested while more follow. Listings are not cached, and they are computed from the state of the storage nodes at the time of the request. Applications that list a prefix in order to discover what a previous step has written, as Hadoop-style committers do, get the current state and pay for it with search load on the storage nodes. ## What the caches trade Resolving a name, reading bucket settings from the chain, fetching an access box and searching for a key each cost a round trip, and several of them are needed before the first byte of an object is sent. The gateway caches the results for a short time: bucket information and access rules for a minute, credentials for five minutes, tags and lock state for two minutes, and, in Morph's configuration, the result of the key lookup for a minute. The lifetimes are listed in [S3 gateway settings](../reference/configuration/s3-gateway.md). The price is a window of staleness between gateways. A gateway updates or drops its own entries when a request that passes through it changes something, so a single client talking to a single gateway reads its own writes. Another gateway learns of the change only when its entry expires. For most caches the effect is that a changed setting or a revoked credential becomes effective everywhere within the lifetime of the entry. Access rules are the exception: the storage nodes enforce them, not the gateway, so the cache only delays what GetBucketAcl and GetBucketPolicy return. The key lookup cache deserves a closer look, because the gateway software ships with it turned off and Morph turns it on. It saves one search per GET or HEAD of a recently read key, which is a large share of the work for small objects. In an unversioned bucket it cannot return wrong data for long: an overwrite deletes the old object, a gateway with a stale entry finds the object gone, drops the entry and searches again. In a versioned bucket the old version still exists, so a gateway with a stale entry serves the previous version of the key for up to a minute after another gateway wrote a new one. The gateway configuration (`cache.names.lifetime`) is managed by Morph and manual edits are not supported; contact Morph support if a workload requires changing this setting (which trades cache hits for an additional search per request). ## Related pages - [S3 compatibility](../reference/s3-compatibility.md) - [Data model](data-model.md) - [Replication and consistency](replication-and-consistency.md) - [Inner ring and FS chain](inner-ring-and-fs-chain.md) - [Store your first object with S3](../tutorials/first-steps-with-s3.md) --- # Security model Morph has no central authorization server. Every party is a key pair: each node, each gateway and each user. A request is accepted when it carries the signatures and tokens that let the storage node trace it back to the owner of the bucket and to an access rule that allows it. This page explains which keys exist, how a user of the console becomes a key on the FS chain, how a request is checked on its way, and what the people who run a cluster can and cannot do. ## Keys and wallets | Key | Held by | What it is used for | |---|---|---| | Inner ring node key | Each inner ring node, in its wallet | Signs blocks of the FS chain and takes part in consensus. Together, the inner ring keys form the committee that owns the contracts on the chain. | | Storage node key | Each storage node, in its wallet | Identifies the node in the network map, signs its requests to other nodes, and is the key of its TLS certificate when TLS is enabled. | | Gateway key | Each Morph node, in one wallet shared by the console and the S3 gateway of that node | Signs the requests that the console and the S3 gateway send to storage nodes on behalf of users. Opens the tokens that users issue. Signs the requests of the console to change records on the FS chain. | | User key | Stored on the FS chain, encrypted with the user's password | Signs the tokens by which the user delegates rights to the gateways. | The three service wallets are files in the local state directory of the Morph container. They are encrypted with passwords that the container receives as environment variables. [Encrypt data](../how-to/secure/encrypt-data.md#where-the-keys-are-kept) lists the files. A gateway key becomes part of the system when it is registered on the FS chain. For a gateway-type node, a global administrator registers the public key of the gateway; see [Add a gateway-only node](../how-to/deploy/add-a-gateway-node.md). From then on, new tokens are encrypted for this gateway too, and the inner ring accepts its requests. ## Users are accounts on the FS chain A Morph user is a record in a contract on the FS chain. The record holds the role, a public key, and the matching private key encrypted with the user's password in the NEP-2 format. Morph stores no password and no password hash. A login succeeds when the password decrypts the key. The identity that owns buckets is not the key itself. It is an account address derived from the user name, the namespace and the contract. A signature of this account is valid when the contract confirms that it was made with the user's current key. This has three consequences: - A password change replaces the key pair but keeps the account. The user's buckets stay the user's buckets. - The contract keeps the history of a user's public keys, and a signature is checked against the key that was current when it was made. Tokens issued before a password change remain verifiable, which is why Morph revokes session tokens explicitly at that moment. - Whoever can read the FS chain can read the encrypted key records. The password is what protects them. Morph enforces no password rule, so the strength of the passwords and the reach of the chain RPC port are the operator's responsibility. Only the inner ring can write user records. The console that receives an administrative request, for example to create a user, checks the administrator's token and role and then asks the inner ring to record the change. The inner ring nodes accept such a request only from a registered gateway key and when the request is well formed, and the change is committed when a quorum of them (3 of 4, 5 of 7) has signed it. The decision whether the caller is an administrator is therefore made by the console; the inner ring trusts registered gateways for it. A user who signs in through single sign-on is the same kind of account. The email address from the identity provider is the user name, and Morph sets a fresh random password at each sign-in instead of asking for one. Morph relies on the identity provider for the email address. ## From a login to an object ### The session token When a user logs in, the console decrypts the user's key with the password and uses it once: it signs a session token. A session token is a statement by the user's account that names the registered gateway keys, lists operations (read, write, delete and search objects; create and delete buckets; set access rules), optionally one bucket, and an expiry time. Any storage node can verify this statement against the FS chain without contacting the console. The console then stores a small object, called a box, in the system bucket `access-box-storage`. The box contains the session token, the console permissions of the token (for example whether it may manage users), and the user's key encrypted with a random 32-byte secret. The secret itself is in the box once per registered gateway, encrypted for that gateway's key with HPKE (P-256, HKDF-SHA256, AES-256-GCM). The token that the client receives is the address of the box and the secret. It is a bearer credential: whoever holds the string can use it until it expires or is revoked. Revoking a token deletes the box. A personal access token is the same construction with permissions chosen by the user. ### A request to the console For each request, the console reads the box named by the token and opens it with its own gateway key and the secret from the token. It rejects the request when the box is gone, when the token has expired, or when the token lacks the permission for the operation. For the administration of users, quotas, single sign-on providers, namespaces, system storage policies, the license and nodes it also reads the user's current role from the FS chain. A demotion through the API also revokes all tokens of the user. The console then acts in one of two ways. For object operations it sends the request to the storage node signed with the gateway key and attaches the user's session token. For bucket operations, which the inner ring must approve, it signs with the user's key from the box. In both cases the storage layer sees a request that is authorized by the user's account, not by the console's own authority. Every console caches an opened box for 10 seconds. ### A request to the S3 gateway S3 credentials follow the same pattern. The access key ID is the address of a box in `access-box-storage`. The secret access key is the random secret. The box holds a session token signed by the user. Unlike a console token, it does not hold the user's key. The S3 client never sends the secret. It signs each request with AWS Signature Version 4. The gateway reads the box, decrypts the secret with its gateway key, recomputes the signature and compares. It then forwards the operation to the storage node with the session token attached. A gateway caches an opened box, for 5 minutes with the configuration that Morph generates. Because a box is encrypted for the gateways that were registered when it was created, a token or credential works on those Morph nodes and not on a node that was added later. ### The checks on the storage node The storage node makes the decision. For each object request it does the following. It verifies the signatures of the request. If a session token is attached, it verifies that the token is signed by its issuer, that it names the sender of the request, that it is within its lifetime, and that it covers the operation and the bucket. A request with a valid session token is treated as a request of the issuer. It classifies the sender. The owner of the bucket has the role *owner*. The storage nodes that hold the bucket and the inner ring nodes have the role *system*. Everyone else is *others*. It applies the basic ACL of the bucket. The basic ACL is a fixed set of bits, set when the bucket is created, that says for each role which object operations are possible at all, and whether extended rules and bearer tokens may refine them. It applies the extended ACL (eACL) of the bucket, if the basic ACL permits one. The eACL is a table of allow and deny rules by operation, role or account, and object attributes. It is stored on the FS chain. The eACL cannot restrict the *system* role. If the request carries a bearer token, the node uses the rule table inside the bearer token in place of the bucket's eACL, provided that the bucket owner signed the token, that it is within its lifetime, and that the basic ACL permits bearer tokens for the operation. The access tokens for sharing that the console issues are bearer tokens of this kind. They are self-contained and not stored anywhere, which is why they cannot be revoked. A request that fails any of these checks gets the status *access denied*. See [Errors and status codes](../reference/errors.md). How to set these rules is described in [Control access to a bucket](../how-to/buckets-and-objects/control-access.md). ## What the inner ring enforces The inner ring runs the FS chain, and the chain is the source of truth for everything that authorization depends on: users and their keys, buckets with their owners, basic ACLs and storage policies, eACL tables, the registered gateway keys, and the network map. - For a request to create or delete a bucket or to set its eACL, the inner ring verifies that it is signed by the owner's account or carries a valid session token of the owner. A bucket whose basic ACL is final cannot receive an eACL. - Changes to user records, to the default storage quota and to the list of registered gateway keys are written only with the signatures of a quorum of the inner ring (3 of 4, 5 of 7). - Storage policies, single sign-on providers, namespaces and the license are records that the contracts accept from a registered gateway key. The gateway wallets protect them. - A new storage node needs a global administrator to admit its account before it can register in the network map, and the inner ring removes nodes that stop reporting. - The contracts themselves can be replaced only by the committee, that is by a majority of the inner ring keys. Below its quorum the inner ring records nothing, so no user, bucket or access rule can change. Existing tokens and rules keep working. See [Inner ring and FS chain](inner-ring-and-fs-chain.md). ## Who can do what in a running cluster | Party | Can | Cannot | |---|---|---| | A user | Everything with its own buckets and objects. Delegate parts of that through tokens, S3 credentials, eACL rules and access tokens for sharing. | Reach buckets of others unless their rules allow it. | | A namespace administrator | Manage users, quotas and single sign-on in its namespace. See the properties of all buckets there and delete them. Set a new password for any user of the namespace, and then log in as that user. | Read or write objects of other users by virtue of the role: the storage node treats an administrator as *others* in a bucket it does not own. Reach anything outside its namespace. | | A global administrator | Manage users, quotas and single sign-on in every namespace. Requests about buckets, such as deletion and bucket quotas, act on the namespace of its own session (see [Use namespaces](../how-to/buckets-and-objects/use-namespaces.md)). Admit and decommission storage nodes and gateways, manage system storage policies, namespaces and the license. | Read or write objects of other users by virtue of the role. | | Whoever controls a Morph host | Read the object data on the drives of that node, because the storage node does not encrypt it. Use the node's wallets. With the gateway wallet, open the boxes of all tokens and S3 credentials issued for that gateway and act for their users while those are valid. | Change user records, the registered gateway keys or the contracts alone, when the inner ring has more than one node. | | Whoever controls a majority of the inner ring nodes | Change any record on the FS chain, including users, roles and contracts. | Read objects that were encrypted by the client. | | Whoever can read the FS chain RPC | Read all chain records: user names, roles and password-encrypted keys, bucket names, owners and access rules, single sign-on provider settings. | Read objects or tokens. | Two points follow for an evaluation. First, the administrator role is separated from data access, but it includes the power to take over an account by setting its password. Second, confidentiality against the operators of the hosts requires encryption by the client before the upload, because Morph does not encrypt stored data. SSE-C is not an alternative on an installed node: the S3 gateway accepts it only on a TLS listener of its own, and Morph generates the gateway configuration without one. See [Encrypt data](../how-to/secure/encrypt-data.md). ## What Morph does not provide - Encryption at rest by the storage node, and integration with a key management service or a hardware security module. - An audit log. The components write application logs. See [Read logs](../how-to/observe/read-logs.md). - Roles other than `admin` and `user`, groups, or per-user policies in the console. Fine-grained access is expressed per bucket with eACL rules and per token with permissions. - A password rule, account lockout or multi-factor authentication of its own. With single sign-on, these are functions of the identity provider. - Authentication on the metrics endpoint and on the installer API, which serves port 9100 until a node is installed. Network controls cover both. See [Harden a deployment](../how-to/secure/harden-a-deployment.md). ## Related - [Manage users and roles](../how-to/secure/manage-users-and-roles.md) - [Manage API tokens](../how-to/secure/manage-api-tokens.md) - [Manage S3 credentials](../how-to/secure/manage-s3-credentials.md) - [How S3 maps onto Morph](s3-on-morph.md) - [Architecture](architecture.md) --- # Performance This page explains where time goes on the write path and the read path, and which settings and layout choices move the numbers. ## What a write costs A write does more work than a read, and most of it happens on the storage node that receives the request. **Pieces are handled one after another.** The storage node cuts an upload into pieces of at most 64 MiB. It collects a piece in memory, seals it as an object, encodes or replicates it, waits until the piece is stored, and then takes the next one. One upload stream therefore never has more than one piece in flight. Throughput of a single large upload is bounded by how fast one piece can be stored, however many nodes the cluster has. Parallel uploads are independent of each other, so total throughput grows with the number of streams until the drives or the network are saturated. **A piece is hashed and, for erasure coding, encoded.** The node computes the SHA-256 checksum of the payload. In an erasure-coded bucket it then runs Reed-Solomon over the piece, which produces the data parts and parity parts. This is CPU work on the receiving node. **Every holder must confirm.** A replicated bucket acknowledges a piece when each rule of the policy has its full number of replicas. An erasure-coded bucket acknowledges it when all data and parity parts are stored. The parts travel in parallel, so the time for a piece is the time of the slowest holder, not the sum. A bucket with an [initial placement](replication-and-consistency.md) setting acknowledges earlier and finishes the remaining copies in the background. **Writes are synchronized to the drive.** Each holder writes the part to one shard. With a write-cache the part first lands on the SSD and is flushed to the HDD afterwards. Without one, or when the cache is full, it goes to the HDD directly. The FSTree synchronizes writes unless `no_sync` is set, which the node documentation does not recommend for production. **Small objects are grouped on HDD.** Synchronizing every small file separately is slow on rotational drives. The FSTree can therefore combine objects below 128 KiB into one file, up to 128 objects or 8 MiB per file, written in batches every 10 ms. Morph turns this on for rotational drives and off for SSD, where it brings nothing. ## What a read costs **Location is computed.** The node that receives a GET derives the holders from the bucket's policy, the network map and the object ID. No lookup in a central index is needed, and no node is a bottleneck for locating data. **A healthy read touches only data parts.** For an erasure-coded object the node streams the data parts from their holders and passes them on in order. Parity parts are not read and nothing is decoded. Only when a data part is missing does the node fetch parity and reconstruct. A replicated object is read from one holder. **The index is on SSD.** Each holder finds the part through the shard's metabase. With the metabases on SSD, the HDD is left with reading the stored object. ## What the S3 layer adds The S3 gateway keeps no index of its own. It resolves a key to an object ID with an attribute search that storage nodes of the bucket answer from their metabases, and it caches recent results. Listing a bucket is the same kind of search. Requests that address many small objects pay for this lookup relative to their size; large objects do not notice it. [How S3 maps onto Morph](s3-on-morph.md) describes the caches and their lifetimes. ## What the cluster layout decides **A bucket's nodes.** A bucket uses the nodes its storage policy selects, at most the count of the rule times the placement factor. Load for one bucket spreads over that set, not over the whole cluster. A workload that must use many nodes needs a policy that selects many, or several buckets. See [Data placement](data-placement.md). **Metabases and write-caches on SSD.** The node documentation describes this as the expected layout. **Network between holders.** Every write sends parts or replicas to other nodes, and every erasure-coded read collects parts from several. Under `REP 3` a write sends at least two full copies to other nodes. Under `EC 4/2` it sends at least five of the six parts, which is 1.25 times the payload. **Background work.** The policer checks and repairs objects at a bounded pace, by default at most 10 objects per second on each node and 30 while it repairs. A higher pace speeds up recovery and expansion and takes capacity from client traffic. These internal defaults live in the Morph-managed [storage node settings](../reference/configuration/storage-node.md) and are not user-configurable without Morph support. ## Settings that matter | Setting | Effect | |---|---| | Storage policy: replicas or erasure coding | Erasure coding stores less and costs CPU on write. Replicas store more and read from one node. | | Placement factor and selectors | Set how many nodes share a bucket's load. | | Write-cache per shard | Absorbs bursts on SSD before the HDD. | | Combined writing | Groups small objects on rotational drives. | | `policer.object_batch_size`, `policer.replication_cooldown` (internal, Morph-managed) | Pace of repair and of moves after expansion; not user-configurable without Morph support. | | Number of client streams | Large uploads gain from parallel streams or multipart uploads with parallel parts. | --- # Design trade-offs and limitations Morph computes where data lives and keeps no central metadata. This removes components that would otherwise have to be sized, kept available and repaired. It also has consequences that you need to know before you size a cluster, write storage policies or plan an expansion. This page lists them. Each entry states the behavior, the reason for it, and what to do. ## A bucket lives on a bounded set of nodes **Behavior.** The data of a bucket is on the bucket's candidate nodes and on no others, apart from the time a node that stopped being a candidate needs to hand its data over. A rule of the storage policy selects at most *count × placement factor* nodes: with the default placement factor of 3, `REP 3` uses at most 9 nodes and `EC 4/2` at most 18. A policy can select at most 64 nodes per rule. A bucket does not spread over a cluster that is larger than that. **Reason.** The candidate set is what makes placement computable and searches bounded. Every node can derive it from the policy and the network map, and a listing asks only these nodes. **What to do.** - Expect many buckets, each on its own subset of nodes, to fill a large cluster evenly. The subsets differ from bucket to bucket because the selection is hashed by bucket ID. A few very large buckets fill only the nodes they selected. - For a bucket that must hold a large share of the cluster's capacity, raise the placement factor or select more nodes explicitly, within the limit of 64 per rule. - Check per-node fill levels, not only the cluster total. See [Check cluster health](../how-to/observe/check-cluster-health.md). ## A storage policy cannot be changed **Behavior.** The policy is fixed when the bucket is created. Changing redundancy or location means creating a new bucket and copying the objects. **Reason.** The policy is part of the record whose hash is the bucket ID, and every node derives object locations from it. **What to do.** Decide on the policy before loading data, and prefer policies that stay valid as the cluster changes. See [Choose a storage policy](../how-to/buckets-and-objects/choose-a-storage-policy.md). ## Expansion moves data in the background, and erasure coding moves more **Behavior.** New storage nodes receive their share of new writes from the first epoch in which they are in the network map. Existing objects are moved afterwards by the policers. For replicated buckets whose candidate set takes in all new nodes, the share of replicas that moves equals the share of the new nodes. For erasure-coded buckets more moves: with two nodes added to eight under `EC 4/2` and a ceiling of twelve candidates, 20% of the parts end up on the new nodes and 57% of the parts change node. **Reason.** There is no rebalancer. Each node corrects the placement of its own objects. An erasure-coded part belongs on the node whose position in the ranking matches its index (part 0 on the first node), so a new node that ranks above existing holders shifts the parts below it. **What to do.** - Expand in few, larger steps. Every change of a bucket's candidate set starts another round of movement. - Expand before the cluster is nearly full. During the move, old nodes still hold their previous share. - Plan the network between storage nodes for the background traffic, and expect reads of objects in motion to take extra hops. They do not fail while the nodes that hold the objects remain candidates of the bucket (see the next section). - [Data placement](data-placement.md) has the worked example and the figures, and [Add storage nodes](../how-to/operate/add-storage-nodes.md) the procedure. ## A bucket at its ceiling can exchange candidates **Behavior.** A bucket that already has its maximum number of candidates does not gain capacity from new nodes. When nodes that match its policy are added, the selection may replace some of its candidates by new ones. The replaced nodes hand their objects over through their policers. Until an object has been handed over, no read finds it on a replaced node: every node looks on the current candidates only, and a replaced node forwards a GET to them without looking in its own storage. Objects with a replica or enough parts on remaining candidates stay readable. An object that had all its replicas on replaced nodes is reported as not found until the hand-over. **Reason.** Candidates are chosen by rendezvous hashing on the bucket ID over the nodes that match the policy, and lookups use the candidates of the current epoch only. **What to do.** Avoid single-replica buckets on clusters that will be expanded. With `REP 2` or more, or with erasure coding, the exposure is limited to objects that have all their replicas, or more than `p` of their parts, on nodes replaced in the same step. Adding one node at a time replaces at most one candidate of a selector that picks single nodes. ## Distinct failure domains need the right policy form **Behavior.** `SELECT n IN DISTINCT rack` selects candidates from `n` racks. With a placement factor above 1, it does not guarantee that the replicas of each object are in `n` different racks. **Reason.** Each object ranks all candidates of a rule in one list, without regard to the grouping by which they were selected. **What to do.** Use placement factor 1 with as many domains as replicas, or one rule per domain. For erasure-coded buckets without rack-aware rules, keep the number of nodes per rack at or below the number of parity parts. See [Data placement](data-placement.md#distinct-failure-domains-with-a-placement-factor-above-1). ## A policy that cannot be satisfied stops the bucket **Behavior.** If the current network map does not contain enough nodes that match a bucket's policy, every operation on the bucket fails, including reads of objects whose holders are healthy. **Reason.** Locations are computed from the policy and the network map for each operation. When the selection fails, there is no result to work with. **What to do.** - Do not name in a policy more than you can afford to lose. A filter on one site makes the bucket depend on that site staying in the network map. - Where the purpose is "any two sites", write that, and keep more matching sites than the policy needs. - A node leaves the network map after more than 3 epochs of silence, 3 to 4 hours with the default epoch. An outage shorter than that does not change the map. - See [Recover from a site failure](../how-to/operate/recover-from-a-site-failure.md). ## Repair is paced **Behavior.** Redundancy is restored by the policer of each storage node, which checks 10 objects per second by default and 30 while it keeps finding shortages. The time until a lost drive or node is fully compensated depends on how many objects the surviving holders have to walk through. **Reason.** Repair is a continuous background check on every node. It is not a job that is started for a failure and aimed at the affected objects. **What to do.** - Choose redundancy with the repair time in mind. A bucket that tolerates one loss is exposed for the whole duration of a repair pass. - The policer pace settings (`policer.object_batch_size`, `policer.replication_cooldown`) live in the Morph-managed storage node configuration and should not be edited manually without advice from Morph support. See [Storage node settings](../reference/configuration/storage-node.md) and [Performance](performance.md). - Watch the policer's state after a failure. See [Set up alerts](../how-to/observe/set-up-alerts.md). ## A failed drive needs an operator step **Behavior.** With the default configuration, the objects of a failed data drive are not re-created until the operator switches the shard to `degraded-read-only`. **Reason.** The shard's index is on another drive and survives. While it is in use, the node treats re-created objects as already present. The automatic switch on errors is controlled by `storage.shard_ro_error_threshold`, which defaults to 0 (off) and is not set by Morph's installer. **What to do.** Alert on drive and shard errors and follow [Replace a failed drive](../how-to/operate/replace-a-failed-drive.md) when one fires. Treat the mode switch as part of the response to a drive failure and not as part of the later replacement. ## The inner ring is fixed in size and bound to a quorum **Behavior.** The number of inner ring nodes is decided at installation: 1 for tests, 4 or 7 in production. Other sizes are accepted but add no tolerance (5 or 6 tolerate one failure, like 4). Changes to cluster state need 3 of 4 or 5 of 7 of them. Below the quorum no bucket can be created or changed, no storage node joins or leaves the network map, and no epoch passes. Object reads and writes in existing buckets continue on storage nodes that can still read the chain from an inner ring node. A storage node caches bucket records for 15 seconds and reads them again after that. **Reason.** The inner ring nodes are the committee of the FS chain, and its consensus tolerates fewer than a third of faulty members. The committee is part of the chain's configuration from its first block. **What to do.** - Choose seven inner ring nodes where two simultaneous failures must be survived, and place them so that no single site or rack holds more than the tolerated number. - Size the cluster-type nodes for a long life. Storage-type nodes can be replaced freely. - Back up the chain data and keys of the inner ring nodes. See [Back up and restore](../how-to/operate/back-up-and-restore.md) and [Inner ring and FS chain](inner-ring-and-fs-chain.md). ## S3 names are resolved by search **Behavior.** A request by S3 key first finds the object ID by a search over the nodes of the bucket. Listings are searches too. Their cost grows with the number of candidate nodes of the bucket. Each gateway caches results for a short time and does not see changes made through other gateways until its entries expire. **Reason.** Objects are addressed by ID and no table from names to IDs exists. Names are attributes, indexed where the objects are. **What to do.** - Expect a read by key to cost a search in addition to the read, and a listing of a large bucket to involve every candidate node for every page. - Keep the candidate set of buckets that are listed heavily no larger than they need. - Where an application can keep object IDs, read by ID through the REST API. - Account for the cache lifetimes when one client writes through one node and another reads through a different node. See [Metadata](metadata.md) and [How S3 maps onto Morph](s3-on-morph.md). ## Acknowledging early trades durability for availability **Behavior.** A bucket with an initial placement policy acknowledges a write before all replicas exist. The remaining replicas are delivered from an in-memory queue with one attempt, and by the policer if that attempt does not succeed. **Reason.** Initial placement exists to keep latency low and to keep writes possible while some of the policy's nodes are unreachable. **What to do.** Use it where a short window with fewer copies is acceptable, for example to keep a two-site bucket writable through a site outage. Leave it out where an acknowledged write must already be on every replica. See [Replication and consistency](replication-and-consistency.md#initial-placement). ## Features that are not provided - **Replication between clusters.** A deployment is one network. Multi-site redundancy is expressed by storage policies within it. - **Changing the number of inner ring nodes** after installation. - **Changing the storage policy** of an existing bucket. - **Automatic rebalancing on a schedule or on demand.** Movement follows from the policers' continuous checks. [S3 compatibility](../reference/s3-compatibility.md) lists what the S3 API supports, and [Limits](../reference/limits.md) the numeric limits. --- # Release notes The changes of every release of the Morph console, installer and container image, newest first, as the console's changelog records them. Numbers in parentheses are issues (`#`) and merge requests (`!`) of the source repository. What an upgrade requires is on the [upgrade paths](upgrade-paths.md) page; the versions of the bundled components are on the [component versions](component-versions.md) page. | Release | Date | |---|---| | [0.30.1](#v0-30-1) | 2026-11-06 | | [0.30.0](#v0-30-0) | 2026-11-02 | | [0.29.0](#v0-29-0) | 2026-10-06 | | [0.28.0](#v0-28-0) | 2026-09-03 | | [0.27.0](#v0-27-0) | 2026-08-06 | | [0.26.1](#v0-26-1) | 2026-07-08 | | [0.26.0](#v0-26-0) | 2026-07-07 | | [0.25.0](#v0-25-0) | 2026-04-15 | | [0.24.0](#v0-24-0) | 2026-03-16 | | [0.23.0](#v0-23-0) | 2026-01-14 | | [0.22.0](#v0-22-0) | 2025-12-04 | | [0.21.1](#v0-21-1) | 2025-10-17 | | [0.21.0](#v0-21-0) | 2025-10-09 | | [0.20.1](#v0-20-1) | 2025-08-28 | | [0.20.0](#v0-20-0) | 2025-08-01 | | [0.19.1](#v0-19-1) | 2025-06-12 | | [0.19.0](#v0-19-0) | 2025-06-11 | | [0.18.1](#v0-18-1) | 2025-05-16 | | [0.18.0](#v0-18-0) | 2025-05-14 | | [0.17.0](#v0-17-0) | 2025-03-25 | | [0.16.0](#v0-16-0) | 2025-03-07 | | [0.15.0](#v0-15-0) | 2024-12-28 | | [0.14.0](#v0-14-0) | 2024-10-22 | | [0.13.1](#v0-13-1) | 2024-10-07 | | [0.13.0](#v0-13-0) | 2024-10-04 | | [0.12.0](#v0-12-0) | 2024-08-28 | | [0.11.1](#v0-11-1) | 2024-07-08 | | [0.11.0](#v0-11-0) | 2024-06-25 | | [0.10.1](#v0-10-1) | 2024-05-23 | | [0.10.0](#v0-10-0) | 2024-04-23 | | [0.9.0](#v0-9-0) | 2024-02-29 | | [0.8.1](#v0-8-1) | 2024-01-16 | | [0.8.0](#v0-8-0) | 2023-12-25 | | [0.7.0](#v0-7-0) | 2023-07-05 | | [0.6.0](#v0-6-0) | 2023-04-20 | | [0.5.0](#v0-5-0) | 2023-04-10 | | [0.4.0](#v0-4-0) | 2022-12-19 | | [0.3.0](#v0-3-0) | 2022-12-11 | | [0.2.0](#v0-2-0) | 2022-12-05 | | [0.1.0](#v0-1-0) | 2022-11-25 | | [0.0.1](#v0-0-1) | 2022-11-18 | ## 0.30.1 {#v0-30-1} Released 2026-11-06. **Fixed** - `sn-verificator` now loads licenses from ClusterConfig instead of a local configuration file (#762) **Upgraded** - NeoFS node to 0.58.1 (!906) ## 0.30.0 {#v0-30-0} Released 2026-11-02. **Added** - Bucket access tokens for objects sharing (#514, !879) - `disableAccessTokens` flag in bucket basic ACL (#746, !887) - Decommissioning storage node and registered Morph/S3 gateway accounts (#732, #690) - `POST /users` registering a user with the name in the request body (#751) - `PUT /users/{user}/quota` for setting user storage quota (#751) - `PUT /cluster/default-quota` for setting default storage quota (#751) - Namespace-specific default user storage quotas, inherited from the current default storage quota when a namespace is created (#744) - Separate API endpoints for storage node (`POST /v1/cluster/storage-nodes`) and gateway (`POST /v1/cluster/gateways`) grants (#690) - API endpoint for listing storage nodes (`GET /v1/cluster/storage-nodes`) (#690) - API endpoint for listing registered gateway keys (`GET /v1/cluster/gateways`) (#690) **Fixed** - Incorrect handling of internal process dying during startup (!877, !878) - Shutdown race during IR restart (!877) - Unauthenticated user listings requiring a token in every namespace after cluster initialization (#758) - Buckets removed outside the console (e.g. via the S3 gateway) being served from the stale name cache with 500 instead of 404 (!898) - UI for namespaced gateways (!899) **Changed** - S3 and session access boxes uses HPKE now (#727) - Installer-managed Storage Nodes support TLS for their public gRPC API when all advertised addresses use `grpcs://` (#133, !884) - Improved object GET speed (!890) - Payload length is now specified in uploaded objects if known (!886) - `POST /users/{user}` is deprecated in favor of `POST /users` (#751) - `POST /users/{user}/quota` is deprecated in favor of `PUT /users/{user}/quota` (#751) - `POST /cluster/default-quota` is deprecated in favor of `PUT /cluster/default-quota` (#751) - Deprecated `grant-access` on `POST /v1/cluster/storage-node` (#690) - Time-based object expiration is used instead of epoch-based one (#755) **Removed** - RANGE eACL support(#745) **Upgraded** - github.com/nspcc-dev/neofs-contract dependency to v0.28.0 (#756) - NeoFS node to 0.58.0 (!900) - NeoFS SDK dependency to RC24 (!900) - github.com/labstack/echo/v4 v4.15.4 => v4.16.3 (#755) - github.com/getkin/kin-openapi v0.147.0 => v0.152.0 (#755) - S3 gateway to 0.48.1 (!902, !903) ## 0.29.0 {#v0-29-0} Released 2026-10-06. **Added** - Optional namespace header for user token list and detail endpoints (#415) - Optional namespace header for pending transfer list endpoint (#415) - Total number of user's buckets in `GET /buckets` response (#532) - Paging for S3 and Bearer tokens (#372) - `maxItems` and `cursor` parameters for the user list request (#538) - Total number of users in the cluster metrics response (#531) - Total number of users in `GET /users` response (#708) - `get`, `head`, `put` and `search` operation flags for bucket basic ACL (#670, !858) - `get`, `head`, `put` and `search` object operation flags for bearer token (#670, !858) - `download` query parameter for `Content-Disposition` header for object GET and HEAD requests (#677) - Separate download/view object links in UI (!850) - Per-shard `combined_writing.enabled` installer option, with automatic HDD/SSD detection when omitted (#717) **Fixed** - Panic on attempt to delete an object without token (!799) - Authenticated requests without `X-Morph-Namespace` header now use the namespace from the session (!818) - Object pagination race in UI (!827) - Initial replica limits input in UI (!816) - Forbid user policy creation with an existing name (#535) - Bucket list returning the first page again if the bucket from the cursor was removed (#700) - Rare single-node startup problem for IR-enabled Morph nodes (!846) - Object upload returning 500 instead of 403 if the storage rejects it before the whole payload is sent (#700) - Storage node startup failure in some cases of IR unavailability (!853) - User registration failures in some cases (!867) **Changed** - Bucket creation accepts `lockUntil`, `lockHours` is deprecated (#688, !851) - Single NeoFS endpoint in the configuration to a list of multiple endpoints (#593) - Installer now uses one gateway wallet for Morph and S3. Added `MORPH_PATH_GATEWAY_WALLET` and `MORPH_GATEWAY_WALLET_PASS`, old S3 wallet env vars are still accepted (!799, !843) - Default number of tokens listed from 1000 to 100 (#372) - `$Object:payloadHash` search filter value is now hex-encoded, same as in search results (#699) - Token listing UI now uses paging (!833) - `cursor` is omitted in list responses on the last page instead of being empty (#700) - Bucket and user listings now reject out of range `maxItems` with 400, same as object and token listings (#700) - Administrators can view user token metadata in their permitted namespaces (#415) - Administrators can view user storage policy metadata in their permitted namespaces (#415) - Administrators can view pending transfer metadata in their permitted namespaces (#415) - Reserved attributes can't be used in search now (!835) - Objects can share a `FilePath`, deletion by `FilePath` is deprecated in favour of object IDs (#703) - `sticky` bucket basic ACL flag is deprecated and ignored on bucket creation (#670) - User listing in paged in UI now (!834) - UI modal windows no longer close when clicking outside of them (!854) - `MORPH_PORT_PROMETHEUS_COLLECTOR` is now optional and defaults to 5100 (#464) - Better side menu navigation in UI (!866) - Installer disables SN combined writing by default on non-rotational disks (#717) - Improved button placement in UI (!871) **Removed** - 409 response code for object uploads (#703) - Unused `config/prometheus-collector.config.yaml` with a hardcoded collector port (#464) **Upgraded** - NeoFS node to 0.57.0 (!865) - S3 gateway to 0.47.0 (!868) - github.com/nspcc-dev/neofs-contract dependency to v0.27.0 (#726) ## 0.28.0 {#v0-28-0} Released 2026-09-03. **Added** - Gateway-only installation with namespace binding support (experimental) (#593, #594, !796) **Fixed** - Inability to cancel object upload in UI (!793) - Missing placement factor in bucket details in UI (!807) - Bucket access rules ignored for anonymous object access (#631) - OAuth token lifetime not respected wrt session duration (!808) - S3 access-box container included into total bucket count (#561) - Placement factor not displayed in bucket details (!807) **Changed** - Go 1.26 is now required to build (#580) - Object upload progress bar (!793) - Improved contract-level key checks (!797, !804) **Removed** - v0.8 installer API (#676, !805) - Support for old (pre-0.25.0) access tokens (!786) **Upgraded** - github.com/aws/aws-sdk-go-v2/config v1.32.10 => v1.32.38 (#580) - github.com/aws/aws-sdk-go-v2/service/s3 v1.96.1 => v1.107.3 (#580) - go.uber.org/zap v1.27.1 => v1.28.0 (#580) - github.com/testcontainers/testcontainers-go v0.40.0 => v0.44.0 (#580) - google.golang.org/protobuf v1.36.11 => v1.36.12 (#580) - golang.org/x/mod v0.38.0 => v0.40.0 (#580) - github.com/prometheus/client_golang v1.23.2 => v1.24.1 (#580) - github.com/labstack/echo/v4 v4.15.1 => v4.15.4 (#580) - github.com/oapi-codegen/runtime v1.1.2 => v1.7.0 (#580) - github.com/oapi-codegen/echo-middleware v1.0.2 => v1.1.0 (#580) - NeoFS to 0.56.0 (!806) - NeoFS SDK to RC22 (!806) - NeoGo dependency to 0.123.0 (!806) - S3 gateway to 0.46.0 (!810) ## 0.27.0 {#v0-27-0} Released 2026-08-06. **Added** - Backup of the old configuration before migration (#661) - Automatic hardfork configuration management (#597, !790) - Optional initial eACL table in the bucket creation request and UI (#641, !788) - MORPH_LOCAL_STATE_DIR variable support for installer (!772) **Fixed** - Concurrent container creation failing occasionally (!762, !757) - OAuth/SAML data migration from 0.25.0 storage scheme (!763) - Namespace creation with the same name as a deleted one (#657) - Default port configuration for meta chain (!770) **Changed** - OAuth/SAML client secrets are hidden in UI now (!767) - Use 640 permissions for generated configurations and wallets (#662) - UI images are smaller in size now (#665) - SSO login don't open a new window now (#663) - Setting up an unknown account in the EACL rules doesn't lead to an AccountNotFound error (#504) - Ranged object downloads use HTTP-like NeoFS ranges and return `416` for unsatisfiable ranges (#640) **Removed** - `object.put.pool_size_remote` option from produced SN config (!768) **Upgraded** - NeoFS node to 0.55.0 (!781) - S3 gateway to 0.45.1 (!783) - NeoFS SDK to RC21 (!766, !784) ## 0.26.1 {#v0-26-1} Released 2026-07-08. **Fixed** - Errors with GET from EC containers (!759) ## 0.26.0 {#v0-26-0} Released 2026-07-07. **Added** - Namespaces for users, admins and buckets with complete API and UI support (#591, #592, !755, #515, #618, #645, #648) - IR and SN config migration (#626, !727, #644) - X-Morph-Lifetime-Date attribute for object lifetime (#585) - Share link for objects in UI (#622) **Fixed** - Download blocking UI (#623) - Missing Content-Length header for objects (#624) - OAuth header validation (!724) - API handlers continuing execution after error return in some cases (!741) - Insufficient time for new SNs to join the initial network map (!733) - Inability to accept bucket transfer to new account (#643) **Changed** - Return status code `404` instead of `400` when updating a user if the user does not exist (!692) - Return status code 409 when deleting a namespace if it has OAuth or SAML providers (!711) - Return status code 404 when updating an existing OAuth or SAML provider (!711) - Object upload timeouts (#621) - Prevent deleting users with buckets (#612) - Get bucket quota requests are available only to admins and bucket owners (!735) - Checksum verification is omitted in Morph gateway (!752) - Return status code 400 when policy name is too long in bucket creation (#634) - Return status code 400 when the user policy name is too long in GET and DELETE requests (#633) - Return status code 400 when the system policy name is too long in GET and DELETE requests (#633) - Object attributes can be base64-encoded now (#609) **Removed** - RANGEHASH and RANGE EACL support (#638) **Upgraded** - NeoFS SDK to RC20+ (!714, !752) - NeoGo dependency to 0.119.0 (!714) - NeoFS node to 0.54.0 (!714, !746) - S3 gateway to 0.45.0 (!714, !750) ## 0.25.0 {#v0-25-0} Released 2026-04-15. **Added** - Namespace management API (#590) - UI for locked (undeletable) containers (#572) - Initial placement policy (#601, #602) - Morph config migration (#608) **Fixed** - Incorrect installation.txt permissions (#586) - Missing error when opening inexistent bucket in UI (#579) - Missing token access rights in UI (#603) - Incorrect UI redirects on logout (#605) - Uploading objects into EC buckets via Morph API (#570) **Changed** - Renamed env MORPH_PORT_IR_P2P to MORPH_PORT_IR_RPC (#595) - OAuth provider create method changed to POST. Updates HTTP method changed to PUT (#587, #599) - Using v2 session tokens for S3 gate (!672) - Bucket transfer destination isn't checked against real users now (#574) - Morph is using session tokens v2 now for login (#600) **Removed** - Deprecated endpoint `/v1/buckets/{bucket}/objects/{object}/metadata` (#588, !688) **Upgraded** - google.golang.org/grpc dependency from v1.75.1 to v1.79.3 (!672) - NeoFS node to 0.52.0 (!690) - S3 gateway to 0.43.1 (!690, !697) - NeoFS SDK to RC18 (!690) **Updating from 0.24.0** Config parameter `neofs.sessionTTL` has duration format (30s, 24m, 1h35m), instead of epochs. This is handled automatically on container update. ## 0.24.0 {#v0-24-0} Released 2026-03-16. **Added** - Bucket transfer API (#556, !659) - Return status code 409 to delete user and delete bucket requests (#571) - Optional parameters `lockHours` on bucket creation and date-time `lockUntil` in get bucket requests (#571) - Endpoint `/v1/buckets/{bucket}/timelock` for GET and PUT requests, handling bucket lock time (#571) - Header `Location` in the response to PUT requests to the endpoint: `/v1/cluster/oauth` (!667) - Header `Location` in the response to POST requests to the endpoints: `/v1/users/{user}`, `/v1/users/{user}/storage-policies`, `/v1/buckets`, `/v1/buckets/{bucket}/objects`, `/v1/cluster/storage-policies`, `/v1/cluster/saml` (!667) - Bucket transfer UI (#564) **Fixed** - Delay in IR node joining the network (#562) - EC storage policy not shown in bucket details (#566) - Licensing API not working via regular SN (#560) - Cluster start in multi-inner ring setup (#565) - Deletion of user storage policies upon user removal (!664) - Bucket creation taking too much time (!670) **Changed** - Go 1.25 is now required to build (#484) - More robust Morph transaction checks (#573) - Successful PUT requests to `/v1/users/{user}`, `/v1/users/{user}/storage-policies/{policyName}`, `/v1/buckets/{bucket}/eacl`, `/v1/cluster/storage-policies/{policyName}` now return `204` instead of `200` (!667) - Successful POST requests to `/v1/users/{user}/quota`, `/v1/cluster/default-quota`, `/v1/cluster/storage-node` now return `204` instead of `200` (!667) - Successful POST requests to `/v1/cluster/license` now return `204` instead of `201` (!667) - Restrict user names (#589) **Upgraded** - NeoFS to 0.51.1 (!649, !660) - S3 gateway to 0.42.0 (!656) - NeoGo dependency to 0.118.0 (!657, !673) - go.uber.org/zap to v1.27.1 (#484) - golang.org/x/oauth2 to v0.35.0 (#484) - google.golang.org/protobuf to v1.36.11 (#484) - github.com/testcontainers/testcontainers-go to v0.40.0 (#484) - github.com/nspcc-dev/neofs-sdk-go to v1.0.0-rc.17 (#484) - github.com/nspcc-dev/neofs-contract to v0.26.1 (#484) - github.com/nspcc-dev/neo-go/pkg/interop to v0.0.0-20260218115215-56735eb66168 (#484) - github.com/labstack/echo/v4 to v4.15.1 (#484) - github.com/prometheus/common to v0.67.5 (#484) - github.com/aws/aws-sdk-go-v2/config to v1.32.10 (#484) - github.com/aws/aws-sdk-go-v2/service/s3 to v1.96.1 (#484) - github.com/docker/docker to v28.5.2+incompatible (#484) ## 0.23.0 {#v0-23-0} Released 2026-01-14. **Added** - Current/default labels for lists in UI (#545) - Object counter to bucket data (#365, #559) - Object attributes and search to UI (#552) - Visual hint for quotas (#549) **Fixed** - Metric collector errors during startup (#541, !626) - Status code in user metrics retrieval API for deleted or expired token (#544) - Startup errors for standalone SN (#543) - Default policy detection (#554) - X-Attributes documentation (!629) - User impersonation by admin (#408) - EC policy representation in API (#558) - Bucket counting (#564) - Missing checks for notary approvals of Morph contract calls (#222) **Changed** - Tuned log message severity (#542) **Removed** - Inappropriate neofs-contract/common package usage (#555) ## 0.22.0 {#v0-22-0} Released 2025-12-04. **Added** - Optional query parameter `type` to the GET `/v1/users/{user}/tokens` request (#442) - Endpoint `/v1/users/{user}/metrics` for GET requests, returning the user's bucket count in the response (#343) - Default flag for system storage policy (#449, #523, !621) - HEAD request for `/v1/buckets/{bucket}/objects/{object}` with a new header format (#511) - Storage metrics for users in UI (#528, #169) - API link in UI (#529) - Support for object range requests for the endpoint `/v1/buckets/{bucket}/objects/{object}` (#510) - usedSpace for user metrics request (#533) - Arbitrary object attributes for POST/GET/HEAD (#512) - Bucket count in UI (#534) - Erasure coding rules for the container (!600, !611, !616, #540) - Login with SAML (#524, #539) - Endpoint `/v1/buckets/{bucket}/objects/search` for POST object search requests (#513) **Fixed** - Used space in the list bucket response (!581) - EACL and quota settings in UI (!580) - Mobile support in UI (!584) - UI Translation (!584) - Problems processing hundreds of simultaneous container creation requests (!586, !588) - Check system policy name on creation (!592) - Incorrect container size reported (#530) - Missing replay protections in OAuth handling (#459) - "Incomplete" NeoFS status handling (#537) - Incorrect description of maxItems in bucket listing (#550) - Missing WWW-Authenticate headers in 401 responses (!613) - Response status code for object list and search in an EACL-restricted bucket (#356) - Failure to login with the first attempt after the cluster setup (#553) **Changed** - Headers in the GET response of the `/v1/buckets/{bucket}/objects/{object}` endpoint (#511) - GET requests to `/v1/buckets/{bucket}/objects/{object}/metadata` are deprecated (#511) - Bearer tokens are split into categories now in UI (#522) - More optimal initial epoch tick handling for added SNs (!587, !588) - Optimized UI for slow connections (#536) - Added auth check for some endpoints (#521, #551) - Increased the maximum available page size for object listing to 1000 (!607) **Removed** - Object upload via `multipart/form-data` request body (!594) **Upgraded** - github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.15 => v1.0.0-rc.16.0.20251118140059-e93276588b67 (#537) - S3 gateway to 0.41.5 (#449, !605) - NeoFS to 0.50.2 (!606, !610) ## 0.21.1 {#v0-21-1} Released 2025-10-17. **Added** - License management UI (!573, #506) - License keys (!577) **Fixed** - Failure to start 7-IR cluster (!569, !574) - Zombie processes in case of service restarts (!575) - Minor UI glitches (!576) - Inability to specify node port in installer UI (#520) **Changed** - Service monitoring reacts to process failures faster now (#476) - Deduplicated API structures (#507) **Upgraded** - NeoFS to 0.49.1 (!572) - Go 1.25.3 is used for builds now (!578) ## 0.21.0 {#v0-21-0} Released 2025-10-09. **Added** - Yandex OAuth (#457) - VK OAuth (#458, #505) - Google OAuth (#456, !536) - Search buckets by prefix (#465, #447) - "Edit EACL" button to bucket menu (#473) - Demo licensing period (#480) - Auth management UI (#454) - Language toggle for installer (#472) - Ability to specify object lifetime in UI (#470) - API for uploading license (#483) **Fixed** - Static network magic number (#146) - Inability to access objects from non-owner buckets via UI (#475) - UI popover going offscreen in some cases (#491) - Incorrect file name when downloading object via UI (#492) - File uploading form not reset after process finish (#495) - Response status code for object get and metadata requests from an EACL-restricted bucket (#499) - Not following the original URL when login is required and done (#494) **Changed** - Object creation accepts file name in `x-morph-path` header base64 encoded (!510) - Reduced the image size by removing unnecessary components (#432) - Merged the metrics collector and SN Verificator into morphentry (#433) - Use accounts instead of public keys for EACL targets (#478, #490) - UI menu structure (#414) - Check policy applicability during bucket creation (#435) - It's possible to choose open/download browser behavior for objects now (#493) - Go 1.24 is now required to build (#374) - Setting up accounts to EACL target doesn't require role any more (#502) - Storage limits uses soft and hard quotas for users and containers (#381, !562, !564, #501) **Removed** - Deprecated `name` field from object creation and listing (#450) - RANGE/RANGEHASH EACL settings in UI (#498) **Upgraded** - S3 gateway to 0.41.2 (!506, !516, !534) - NeoGo to v0.113.0 (!547) - NeoFS contract to v0.24.0 (!547, !556) - NeoFS SDK to v1.0.0-rc.15 (!547) - NeoFS to 0.49.0 (!556, !557, !561) ## 0.20.1 {#v0-20-1} Released 2025-08-28. **Added** - Add simplified installer API to start the node (#430, !472) - GitHub OAuth (#452, !494) - Object creation without multipart/form-data (#440, !495) - Add OAuth email domain filters (#453, !500) **Fixed** - Account creation (#463, !493) **Changed** - License verification (#434, !473) - GC configuration in SN for optimal performance (!491) - Token removal logic on user update (#462, !501) **Upgraded** - NeoFS to 0.48.3 (!497) ## 0.20.0 {#v0-20-0} Released 2025-08-01. **Added** - SN Verificator service (#402, #405) - Russian UI translation (#400, !476, !485) - S3-GW service to metrics collector (#416) - `logger.sampling.enabled` config option (#404) - PlacementPolicyName parameter in bucket creation API (#411, !470) - PlacementPolicyName parameter in bucket retrieval API (#412, !475) - Users can change their passwords now without admin privileges (!474) - Configuration parameter `license` and license checking in `/v1/cluster/storage-node` (#405) **Fixed** - Bucket-level token restrictions (!463) - S3 token signing method (#428) - TERM signal handling in services (!457) - S3 token removal with any Morph node (#348) - Panic during access granting routine for SN (#446) **Changed** - Users account management. Using contract instead of wallets (#401, !447, !486) - Clarified some error responses (!465) - Behaviour for user's password and role changing. It can be done independently (#421, !466) - Home page design (!467) - Incorrect application version in UI (!469) - UI performs logout on password change now (!471) - Dynamic 50ms/2s block time is used now for all networks (!479) - UI asks to relogin instead of displaying an error if token is no longer valid (!478, !487) - Notification positioning in UI (!485) - UI logout drops the token now (!487) **Removed** - IR block time configuration (!479, !483) **Upgraded** - NeoFS SDK to v1.0.0-rc.13.0.20250710125524-3779db10c349 (#428) - S3 gateway to 0.40.0 (#428, !479) - NeoGo to 0.111.0 (!479) - NeoFS to 0.48.1 (!479, !481, !488) ## 0.19.1 {#v0-19-1} Released 2025-06-12. **Upgraded** - NeoFS node to 0.47.1 (!455) ## 0.19.0 {#v0-19-0} Released 2025-06-11. **Added** - Consistency setting for buckets in UI (!431) - `prefix` as a query parameter to filter list objects by `path` (#376) - Block duration configuration to the installer config (#396, !442) - `writecache` section options to installer config (#397, !445) - Shard configuration to installer config (#398) **Fixed** - Missing INFO-level logs from IR and metrics collector (!436) **Changed** - "installer_config" directory was removed from image, use regular config directory instead (!426) - Return `404` status code instead of `200` when a non-existent page is requested in Morph `/api` (#391, !444) - Object-related parameters in S3 token creation and S3 token details requests (#350, !451, !446, !450) - SNs use FSTree depth of 3 by default now (!448) **Removed** - Unused garbage from the Docker image (!435, !426) **Upgraded** - NeoGo dependency to 0.109.1 (!434) - NeoFS contracts dependency to 0.22.0 (!434) - S3 gateway to 0.38.0 (!443) - NeoFS node to 0.47.0 (!452) ## 0.18.1 {#v0-18-1} Released 2025-05-16. **Fixed** - Return placement policy metadata consistency with policies (!432) **Upgraded** - NeoFS node to 0.46.1 (!433) ## 0.18.0 {#v0-18-0} Released 2025-05-14. **Added** - Bearer tokens restrictions for managing user actions, quota actions, storage policies actions, S3 access token actions and Bearer token actions (#364, !417) **Fixed** - Missing horizontal scrollbar on bucket page (!411) - Rare P2P synchronization problems (!413) - READ-ONLY S3-tokens (#369) - S3-token restriction to function exclusively within specified bucket (!414) - Deletion of S3-tokens in a configuration with several SN (#348) - Morph main UI appearing in installer (!427) **Changed** - Node 18 and Vite are used for UI now (!409) - Optimized search for user tokens (!416) - `ContainerName` to `BucketName` in S3 token and Bearer token requests (!414, !419) - Return `404` status code if a non-existent page is requested in the installer (#380, !421) - Homomorphic hashing is disabled now (!420) - Placement policy format to store inside contract (#389) **Upgraded** - S3 gateway to 0.37.0 (!412, !415, !425) - NeoFS node to 0.46.0 (!428) ## 0.17.0 {#v0-17-0} Released 2025-03-25. **Added** - API endpoints to handle new Bearer tokens (#363) - Path field for object, it will replace name field in the next release (#367) - Multifile uploads in UI (#368) **Fixed** - Failing EACL update from UI (!395) **Changed** - Return status code 403 instead of 400 if the token wasn't found for the verb in bucket operations (!394) - Epoch duration to 1h (#371) - Go 1.23 is now required to build (#374) - Deprecated name field for object (#367, !405, !404) **Removed** - FileName field for object (#367) **Upgraded** - github.com/labstack/echo/v4 v4.12.0 => v4.13.3 - github.com/getkin/kin-openapi v0.127.0 => v0.131.0 - NeoFS to 0.45.2 (!406) ## 0.16.0 {#v0-16-0} Released 2025-03-07. **Added** - Token expiration in user-related operations (#316) - Bucket contents paging (#358, !390) - Healthchecks for internal container services (!381, !389) - Bucket EACL editor in UI (!380) **Fixed** - Error in the S3 tokens list if the token was revoked (#341) - Incorrect Content-Type block shown for objects missing Content-Type attribute (!372) - Text overflow handling in UI (!373) - System storage policy name check (!375) **Changed** - Return status code 404 instead of 500 in S3 token details if the token was suddenly revoked (#341) - Return status code 401 (instead of 403) in user-related operations with outdated token (after changing role or password) (#316) - The internal user session storage system has been improved. Now, the login and obtained token can be used across all nodes, whereas previously, the token was valid only within a single node (#316) **Removed** - Deprecated header `XMorphSessionToken`; use `Authorization: Bearer ` instead (#345) - Deprecated POST request for setting bucket EACL (use PUT instead) (#345) **Upgraded** - S3 gateway to 0.35.0 (!371, !375, !392) - NeoGo to 0.108.0 (!371, !378, !386) - NeoFS to 0.45.1 (!371, !378, !386, !391) ## 0.15.0 {#v0-15-0} Released 2024-12-28. **Added** - S3 token configuration for objects operations (!333, !335) - GET and PUT bucket EACL requests (#312) - The `Authorization` header and Bearer token usage, along with the `WWW-Authenticate` header in responses (#317) - User S3 token listing, detail view and revoking (#315, #331, #337, #336) - Paging for bucket list request (#313, #338) **Fixed** - Check `XMorphSessionToken` expiration in the GET bucket request (!336) - Log sampling enabled by default (!340) - Outdated README.md is now bright and shiny (#156, #292) - Incorrect greeting page in some cases (#327) - Token expiration in object operations (#321) - Inability to reset storage limit (#328) - Returned status for an already registered first admin is now 409 in all cases (previously, it was 403 in some) (#317) - Object uploading with a negative `lifetime` is now impossible (return 400) (!360) - Access token expiration handling in UI (#336) **Changed** - Return status code 400 (instead of 500) and a "bucket name is invalid" response during bucket creation (#271) - Storage policy listing UI (#310) - The POST request for setting bucket EACL is now deprecated (use PUT instead) (#312) - Notifications handling in UI (#307, #329) - Returned status code from 403 to 401 for an invalid `XMorphSessionToken` in set bucket EACL requests (!343) - Returned status code from 500 to 404 for a non-existent bucket in set bucket EACL requests (!343) - Returned status code from 500 to 403 if user is not the bucket owner in set bucket EACL requests (!343) - Returned status code from 400 to 401 on expired token in all bucket requests (!350) - Returned status code from 403 to 401 for an invalid token in all bucket requests (#317) - Returned status code from 400 to 401 for a missing token in registration (when it is not initial registration) (#317) - Returned status code from 403 to 401 for an invalid token in registration, user list, update and delete, setting user's and default storage quota, user and cluster storage policies, apply actions on the SN, metrics (#317) - Metrics page no longer shows unavailable data (#288) - Header `XMorphSessionToken` is now deprecated; use `Authorization: Bearer ` instead (#317) - Icons (#335) - Default epoch duration to 1 hour (#334) - Bucket list methods requires mandatory user parameter in the query (!358) **Upgraded** - NeoFS to 0.44.1 (!352, !359) - S3 gateway to 0.33.0 (!356) ## 0.14.0 {#v0-14-0} Released 2024-10-22. **Added** - Parameter for metadata in the external configuration file for the Docker image and the ability to run it in read-only mode (#281) - Object retrieval by OID (!320, #309) - Placement factor control in UI (#291) **Fixed** - Missing expiration for S3 access box objects (!317) - S3 access-box-storage container basic ACL (#301) - SN not joining the network in rare cases (!319) - Incorrect setting management leading to basic settlement errors in IR (#299) - Failure to save S3 gateway key leading to Morph service stop (#306) - Concurrent initial registration (#251) - 0B storage limit in UI (#303) - Tombstone and lock objects appearing in object list (!332) **Changed** - S3 credentials now work for any gateway in a cluster (#287) - Optimized tokens, hashes and network requests in S3 credentials service (!316, !317) - 204 is returned now for successful deletion requests (#279) - OID is returned now for successful object creation requests (#277) - EACLs use accounts instead of keys now (#302) - "containerBackupFactor" renamed to "placementFactor" (!328) **Removed** - Unneccessary components from the Docker image (!312, !314) - Warning about servers section in openapi yaml (#298) - MB-level storage limit setting from UI (#304) **Upgraded** - NeoFS SDK to v1.0.0-rc.12.0.20241001195242-3a8e90ffe366 (!323, !331) **Updating from 0.13.1** You must drop `access-box-storage` container for S3 gate access keys. You may use `neofs-cli` for this. ./neofs-cli container delete --cid <CID> -w /path/to/sn/node/wallet/which/owned/the/container.json -r <RPC_ENDPOINT> The container CID can be found in the network. ## 0.13.1 {#v0-13-1} Released 2024-10-07. **Fixed** - Incorrect input padding used in UI (!309) ## 0.13.0 {#v0-13-0} Released 2024-10-04. **Added** - Initial architectural documentation (!277) - Basic ACL validation for bucket creation (#273) - External configuration file for Docker image (!289) - System-wide storage policies (#269, #274) - Additional logs (!222) - Morph storage policies can be used via S3 gateway now (!293, #270) - Warning when leaving UI page with inputs (#283) **Fixed** - Error codes for bucket operations (#264, !271) - Response status code for object creation should be 201 (!281) - Validation of `XMorphSessionToken` in object operations (#256) - Incorrect pluralization used in UI (#278) - Large object removal via Morph API (#290) - Initial SN (alongside IR node) failing to start sometimes (#293) - Inability to handle 100 storage nodes (!307) **Changed** - Go 1.22 is now required to build (#267, #268) - Modal screens in UI (#170) - User storage policies are stored on the backend now (#262, #282, #274) - Role selector in user creation menu (#272) - Default bucket storage policy uses CBF 3 instead of 1 now (#286) - Morph container name from nspccdev/neofs-morph to morphbits/morph (!303) - Filename input handling in UI (#280) **Removed** - Default storage limit for users. Now it's unlimited by default (#248) - Base64 schema format for x-morph-session-token in API specification (#275) **Upgraded** - github.com/deepmap/oapi-codegen v1.14.0 => v1.16.3 - github.com/docker/docker v24.0.9+incompatible => v27.3.1+incompatible - github.com/getkin/kin-openapi v0.120.0 => v0.127.0 - github.com/labstack/echo/v4 v4.11.4 => v4.12.0 - golang.org/x/crypto v0.26.0 => v0.27.0 - golang.org/x/sys v0.23.0 => v0.25.0 - github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240727093519-1a48f1ce43ec => v0.0.0-20240926120645-9a383608244a - github.com/nspcc-dev/neofs-contract v0.19.2-0.20240427112531-286b14199fd0 => v0.20.0+ - github.com/prometheus/client_golang v1.19.0 => v1.20.4 - github.com/prometheus/client_model v0.5.0 => v0.6.1 - github.com/prometheus/common v0.48.0 => v0.59.1 - google.golang.org/protobuf v1.33.0 => v1.34.2 - github.com/testcontainers/testcontainers-go v0.24.1 => v0.33.0 - S3 gateway to 0.32.0 (!287, #270) ## 0.12.0 {#v0-12-0} Released 2024-08-28. **Added** - Check the role during the first registration (#257) - Popover for select block (#254) - Allow to set "delete" access without "create" and "Read headers" (#229) - Selection MB/GB/TB in Configuration/Storage limit (#205) **Fixed** - S3 init problem (#261) - XMorphSessionToken shouldn't work after changing admin's password (#255) - Delete user failed when deleting yourself (#246) - Bucket page shows unclear information when entering w/o `Read` permission (#241) - Expired token does not allow interaction with the interface (#239) - No metrics on startup (#238) **Changed** - Text errors in bucket operations (#263) - Changing user data returns 200 instead of 201 (#258) - Only owner and admin cat get bucket details (#249) - User management API improvements (#243) - UI looks strange on bucket page w/o `Create` rights (#240) - Adapt login screen to ultrawides displays (#237) - Redesign of the user management menu (#203) - Redesign of storage policies (#202) - Npm audit warns about severity vulnerabilities (#23) **Removed** - /v1/initial-registration API route (#252) - v0.8 API (#244) **Upgraded** - User checking for login/reg screen (#253) - S3 gate and adapted to HKDF change (#247) ## 0.11.1 {#v0-11-1} Released 2024-07-08. **Added** - Autorelease pipeline to GibLab CI (#226) - Sync of access rights of the S3 access box container on network map change (#221) - `version` method to the User management contract (#233) **Fixed** - Dark web UI theme rendering on 2K+ screens (#236) - Bucket tooltip freezing and text overflow in web UI (#232) **Changed** - S3 access box container is now checked through NNS resolving (#219) - S3 access box container now limits GET rights to storage nodes (#220) - `morph` and `installer` apps are now built independently (#165) - Prometheus and pprof are now served asap during startup (#230) ## 0.11.0 {#v0-11-0} Released 2024-06-25. **Added** - Additional logs for error cases (!159) - v1 API with reworked authentication (!144, !160, !162, !163, !161, !164, !177, !166, !179, !180, !181, !182, !191, !198, !202, !203, !214) - User management contract autodeploy and autoupdate (!152) - Dark UI theme with switcher (!169, !210) - Drag&drop for uploading objects (!175) - S3 support (!168, !195, !199, !204, !208, !220) - Object sorting by column (!197) **Fixed** - UI scrolling issue (!167) - Documentation URL not working correctly (!170) - Local cluster metrics (!174) - Browser-specific UI problems (!176, !187, !218) - Input handling in UI (!185, !201) - UI state issue on cluster reinstall (!186) - Same-name user registration (!182) - User's containers not removed with the user (!183) - Address hints in UI (!188) - Topping up SN account in multi-IR setup (!181, !194, !207, !206) - Non-JSON error handling in UI (!205) - User registration failures starting from some number of active ones (!206, !211, !212) - Installer failure with newer Alpine images (!206) - Missing installer logs (!216) - Inability to process schemas in RPC endpoint configurations (!216, !217, !219) - UI exiting before installation completes (!223, !224) **Changed** - Listen configuration allows to set host:port (!171) - Error on attempt to delete bucket by non-owner (!172) - Bucket page allows to see bucket details now (!190) - Admins can list all buckets and delete any of them now (!189) **Removed** - `clusterprotobuf` support as well as the following configuration parameters: `api.internal.port`, `cluster.ports`, `buckets` (!192, !200) **Upgraded** - NeoFS node dependency to 0.42.1 (!173, !204) - NeoGo dependency to 0.106.2 (!203, !204) **Updating from 0.10.1** Please change api.port configuration to api.listenAddress. 0.11.0 will not start without `s3.accessBoxContainerPolicy` and `s3.accessBoxContainerName` configured, so please provide them as well. ## 0.10.1 {#v0-10-1} Released 2024-05-23. **Upgraded** - github.com/nspcc-dev/neo-go from v0.105.1 to v0.106.0 ## 0.10.0 {#v0-10-0} Released 2024-04-23. **Added** - `--version` flag support to morph and installer apps (!129) - MB label for limit inputs (!132) - Pprof service (!133) - Prometheus metrics (!141) - Multi-IR installation support (!140, !155) - Prometheus metrics collector (!145) **Fixed** - UI error for empty buckets (!131) - Handling of requests for unsupported enum values (!142) - Webpack source map disclosure (!150) **Changed** - Go 1.20 is now required to build, 1.22 used for builds by default (!130) - UI design (!143, !153) - Domain registration to have 10 years of validity period (!148) - Micro-optimizations (!138) **Removed** - neofs-api-go module uses (!138) **Upgraded** - github.com/labstack/echo/v4 dependency from v4.11.3 to v4.11.4 (!130) - go.uber.org/zap dependency from v1.26.0 to v1.27.0 (!130) - github.com/google/uuid dependency from v1.4.0 to v1.6.0 (!130) - github.com/deepmap/oapi-codegen dependency from v1.13.4 to v1.14.0 (!130) - github.com/getkin/kin-openapi dependency from v0.118.0 to v0.120.0 (!130) - google.golang.org/grpc dependency from v1.59.0 to v1.62.0 (!130) - NeoGo dependency from 0.103.1 to 0.105.1 (!130) - NeoFS SDK dependency to 7f940dcb37d8 (!139) - oapi-codegen tool to v2.1.0 (!134) - NeoFS node to 0.41.0 (!140, !154, !157, !158) ## 0.9.0 {#v0-9-0} Released 2024-02-29. **Added** - Update method to user management contract (#109) - Per-container size to container data and page (#121, #131) - Swagger API documentation (#130) - Witness check into user management contract (#103) - Per-user quotas (#134) **Fixed** - Duplicating candidate nodes on metrics page (#115) - Used space calculation in case of many containers (!112, #139) - Human-friendly size calculation (!120) **Changed** - Container name is retrieved directly from contract now (#46) - Alphabet settings are available in config file now (previously only via environment, #111) - Single RPC host:port is configured for a new SN now (#126, #112, !117, !121, !122) - More GAS is available to storage nodes now (!124) - idb-keyval is used for Indexed DB access intead of obsolete react-indexed-db (#74) **Upgraded** - NeoGo dependency to 0.105.1 (!117) ## 0.8.1 {#v0-8-1} Released 2024-01-16. **Added** - Removing admin user (#108) - Add lifetime parameter for object upload (#113) - Waiting usermanagement contract execution result, for changing operations (#123) **Fixed** - Hide monitoring page from ordinary users (#118) - Limit bucket list to the ones owned by user by default (#117) - Add loader for user delete operation in WEB (#114) **Changed** - Updated used space visibility (#120) ## 0.8.0 {#v0-8-0} Released 2023-12-25. Added the contract to manage users in the system. **Added** - Unified session token (#60, #81) - Installer app to start a new cluster (#84, #87) - Cluster setup screen (#83) - Peapod instead of blobovnicza (#92) - User management API (#92, #96, #97, #95) - User management contract (#94) - User used space in bucket overview - Global logger (#30) **Fixed** - Cluster statistic (#105) - Not admin password changing (#107) **Removed** - Account data management from frontend side (#66, #76, #75, #77) - Dependency from AIO container (#79) - Temporary fields and headers (#95) **Upgraded** - NeoFS SDK Go to RC-11 (#78) - NeoFS Contracts to 0.19.1 (#86) - Neo-go to v0.104.0 (#96) ## 0.7.0 {#v0-7-0} Released 2023-07-05. Improved authentication/authorization mechanism replacing hard-coded server-side key with client-side signatures. **Added** - Web UI reaction to sudden backend death (#18) - Persistent storage for private keys managed by Web UI (#45) - Bucket owner to the bucket info response (#55) **Fixed** - Server now correctly responds with `400 Bad Request` status (#20) - Last admin cannot make himself a general user now (#53) - Memory leak warning in Web UI (#57) - Sidebar is no longer available when the modal is open (#68) **Changed** - Simplify basic ACL model in Morph API (#15, #39) - Client provides its own credentials instead of hard-coded server-side ones (#24, #33, #34, #48, #51) - Error toasts replaced pop-ups (#28) - Full information about the bucket is shown in the Web UI (#29) - Name of the system bucket to `xxxmanagment` (#49) **Upgraded** - NeoFS SDK Go to RC-9 (#50) - Morph API version to 0.7.0 ## 0.6.0 {#v0-6-0} Released 2023-04-20. Storage operations conducted through the NeoFS RPC. **Added** - New fields to `GetBucketResponse` message: name, ACL, storage policy (!11) - Loading interfaces for storage actions in web UI (#21) **Fixed** - Missing timestamp of the bucket creation in backend (!18) **Changed** - Bucket operations are served using NeoFS RPC (#9) - Object operations are served using NeoFS RPC (#19) **Removed** - Synthetic delays from web UI (!20) **Upgraded** - `cityofzion/neon-js` to 5.4.0 (!20) - Morph API version to 0.6.0 ## 0.5.0 {#v0-5-0} Released 2023-04-10. ACL and policies for buckets, basic IAM. The last release with the stub backend. **Added** - Processing of audio and PDF content in web UI - Storage policy settings for bucket creation - ACL settings for bucket creation - Initial cluster setup with admin registration and basic cryptography (#1) - Basic identity management with user registration/removal on behalf of the admin (#2) - Password change feature (#4, #6) - NeoFS entrypoint in config - Example YAML config file **Fixed** - Incorrect reading of object data leading to data corruption - linter complaints (!12) **Changed** - Using schemas in OpenAPI definition - Logo in web UI **Upgraded** - Morph API version to `0.5.0` ## 0.4.0 {#v0-4-0} Released 2022-12-19. Support simple cluster expansion mechanism which allows to add new nodes to the Morph network. **Added** - Configuration which allows to attach Morph node to the existing cluster - Multi-node/multi-drive metrics in Console **Upgraded** - Morph API version to `0.4.0` ## 0.3.0 {#v0-3-0} Released 2022-12-11. Exposing cluster metrics. **Added** - Metric request in Morph API specification - `Monitoring/Metrics` page in Morph Console rendering cluster metrics **Upgraded** - Morph API version to `0.3.0` ## 0.2.0 {#v0-2-0} Released 2022-12-05. Extended Morph API specification with object resources and operations. **Added** - Object resources and operations in Morph API specification - Object handlers in Morph server - `Browse` bucket page in Morph Console providing all operations with objects **Upgraded** - Morph API version to `0.2.0` ## 0.1.0 {#v0-1-0} Released 2022-11-25. New Morph API specification with bucket resources and operations. **Added** - Bucket resources and operations in Morph API specification - Bucket handlers in Morph server - `Buckets` page in Morph Console providing all operations with buckets **Removed** - Greeting service as no longer needed **Upgraded** - Morph API version to `0.1.0` ## 0.0.1 {#v0-0-1} Released 2022-11-18. Initial release of the repository containing sources of the object storage Morph. **Added** - Implement framework for Morph API protocol definition which is compliant with the OpenAPI 3.0 specification - Implement `morph` application providing Morph API server - Implement Morph Console: web UI compliant with the Morph API - Serve Morph Console from the `morph` application --- # Upgrade paths This page collects things known about upgrading: the "Updating from" sections of the console's changelog, the configuration migrations in `morphentry`, and the upgrade notes of the NeoFS node and S3 gateway versions that each Morph release bundles (see [component versions](component-versions.md)). The procedure is in [Upgrade a cluster](../how-to/operate/upgrade.md). ## What happens at an upgrade | Part | Behavior | Since | |---|---|---| | Installer | Does not run again. The files it wrote at installation stay in the local state directory. | - | | Console configuration | `morphentry` applies the pending configuration migrations before it starts the console. | 0.25.0 | | Inner ring and storage node configuration | `morphentry` applies the pending configuration migrations before it starts each process. | 0.26.0 | | Backup of a migrated configuration | The previous file is saved next to it as `.pre--migration`. | 0.27.0 | | Chain hardforks | `morphentry` writes a scheduled hardfork into the inner ring configuration and restarts the inner ring. See [Hardforks](../explanation/inner-ring-and-fs-chain.md#hardforks). | 0.27.0 | | Storage node data | The bundled storage node migrates its own data files (shard indexes, session records) when it starts. These migrations are the reason some releases cannot be skipped. | - | Configuration migrations are cumulative. The console's file records the version of its format in a `configVersion` key, the inner ring's file in a first-line comment `# configVersion: `. `morphentry` applies every migration newer than that version, in order. A file without a version counts as 0.24.0. The installer writes the storage node's file without a version, so its first start applies all storage node migrations; the migration then adds the same first-line comment to it. ## Configuration migrations | Migration | File | Change | |---|---|---| | 0.25.0 | console | `neofs.sessionTTL` given as a number of epochs becomes a duration in hours: `100` becomes `100h`. | | 0.26.0 | inner ring | `experimental.chain_meta_data: true` or `false` becomes a section with `enabled`, `seed_port: 20334`, `p2p_port: 20334`, `rpc_port: 30334`. | | 0.26.0 | storage node | Adds `metadata.seed_port: 20334`, `metadata.p2p_addresses` and `metadata.rpc_addresses` where they are missing. | | 0.27.0 | inner ring | Adds `fschain.consensus.hardforks` with `Faun: 0` when the section is missing. Sets `fschain.consensus.max_time_per_block` to `20s`, replacing any other value. | | 0.27.0 | storage node | Sets `metadata.p2p_addresses` to `0.0.0.0:21334`, replacing any other value. Removes `metadata.rpc_addresses`. Removes the top-level `object` section. | | 0.29.0 | console | `neofs.endpoint` becomes the list `neofs.endpoints`; `neofs.sidechain.endpoint` becomes the list `neofs.sidechain.endpoints`. | | 0.30.1 | console | Removes the top-level `license` section. | Details per file: [console](../reference/configuration/console.md#migrations), [inner ring](../reference/configuration/inner-ring.md#changes-after-installation), [storage node](../reference/configuration/storage-node.md#persistence-and-migrations). Generated component configuration files are managed by Morph, so manual edits are not supported and can break on future upgrades and migrations. A migration replaces hand-made changes to the keys it sets; the inner ring migration of 0.27.0 and the storage node migration of 0.27.0 are two examples that overwrite an existing value. ## Starting points The console's changelog states no minimum version for any upgrade. The limits below come from the upgrade notes of the bundled NeoFS node: a storage node or inner ring that skips a release can miss a data migration that a later release no longer contains. | Upgrade to | Bundled node | Requirement stated by the node's notes | In Morph releases | |---|---|---|---| | 0.30.0, 0.30.1 | 0.58.0, 0.58.1 | No starting version is named. Session records are migrated at start and cannot be read by earlier versions. | Back up the storage node state file before the upgrade (see [0.30.0](#to-0-30-0)). | | 0.29.0 | 0.57.0 | The shard index migration introduced in node 0.52.0 is gone: "upgrade to 0.56.0 first if using earlier versions". | Morph 0.28.0 bundles node 0.56.0. The note does not say whether a node of 0.52.0 to 0.55.0 (Morph 0.25.0 to 0.27.0), which has already applied that migration, may skip 0.56.0. | | 0.28.0 | 0.56.0 | Storage nodes older than 0.52.0 must first run a release from 0.52.0 to 0.55.0 and let the session storage migration complete. Shard indexes older than node 0.51.0 must first be migrated with 0.55.0 or earlier. | Start from Morph 0.25.0, 0.26.0, 0.26.1 or 0.27.0. | | 0.27.0 | 0.55.0 | Inner ring nodes older than 0.51.0 must first run a release from 0.51.0 to 0.54.0 and let the migration of bucket (NeoFS container) records complete. | Start from Morph 0.24.0, 0.25.0, 0.26.0 or 0.26.1. | | 0.26.0 | 0.54.0 | No starting version is named. The notes of node 0.53.0 apply as well, because no Morph release bundles 0.53.0. | - | | 0.25.0 | 0.52.0 | Shard indexes written by nodes older than 0.48.1 are no longer migrated: "migrate using SN 0.51.1 or resynchronize". The separate session file, deprecated in node 0.50.0, is no longer read: "migrate with 0.51.1 if needed". | Morph 0.24.0 bundles node 0.51.1. | | 0.24.0 | 0.51.1 | Shard indexes written by nodes older than 0.46.0 are no longer migrated: "resynchronize or migrate using SN 0.50.2". | Morph 0.22.0 and 0.23.0 bundle node 0.50.2. | Taken together, these requirements are met by the sequence 0.23.0, 0.24.0, 0.27.0, 0.28.0, 0.29.0, 0.30.1: each release in it still contains the migrations that the next one has dropped. ## Notes per release ### To 0.30.1 {#to-0-30-1} From the console's changelog and migrations: - The storage node verificator reads licenses from the cluster configuration on the chain. It no longer reads them from a local configuration file. - The migration 0.30.1 removes the `license` section from the console's configuration file. The console of this release does not start with that key in the file. - Bundled node: 0.58.1. Its notes name nothing to do when coming from 0.58.0. ### To 0.30.0 {#to-0-30-0} From the console's changelog: - S3 credentials and sessions are stored in a new sealed format (HPKE). - Objects expire by time. Earlier releases expired them by epoch. - Access rules for the RANGE operation are no longer supported. - Four REST API operations are deprecated in favor of new ones. See [deprecations](deprecations.md). From the notes of NeoFS node 0.58.0: - The storage node migrates the session records in its state file (`node.persistent_state.path`, in Morph `/morph/local_state/neofs-storage-state`) at start. Earlier versions cannot read the migrated file. The notes say to stop the node and back up this file before the upgrade, and to restore that backup before going back to an earlier version. - Compressed objects in the object store are no longer supported. The notes point to the `fstree-decompress` utility of node 0.57.0 for a store that contains compressed objects. The storage node configuration that Morph 0.30.1 generates does not turn compression on. - Node addresses in multiaddress form are no longer accepted. Use plain addresses such as `grpc://host:port`. - `neofs-cli`: the `--xhdr` (`-x`) flag is deprecated, and the notes say to remove it from all invocations. From the notes of S3 gateway 0.48.0: the gateway requires NeoFS node 0.58.0. ### To 0.29.0 {#to-0-29-0} From the console's changelog and migrations: - The console's configuration takes lists of endpoints. The migration 0.29.0 converts the single-endpoint keys. - The installer uses one gateway wallet for the console and the S3 gateway. The variables `MORPH_PATH_GATEWAY_WALLET` and `MORPH_GATEWAY_WALLET_PASS` name it; the earlier variables `MORPH_PATH_S3_WALLET` and `MORPH_S3_WALLET_PASS` are still read when the new ones are not set. - `MORPH_PORT_PROMETHEUS_COLLECTOR` is optional and defaults to `5100`. - List operations reject an out-of-range `maxItems` with status `400`, omit `cursor` on the last page, and return 100 tokens by default where they returned 1000. - The value of the `$Object:payloadHash` search filter is hex-encoded. - Object uploads no longer answer with status `409`; several objects can share one `FilePath`. From the notes of NeoFS node 0.57.0: - The shard index moves to version 12 at start. "This can take some time for large shards with many objects." - The migration to index version 10, introduced in node 0.52.0, is removed (see the table above). - The storage node no longer serves the `GetRange` operation. Clients of the NeoFS API use `Get` with a range. - Network maps can differ from earlier ones because addresses are converted from multiaddress form. From the notes of S3 gateway 0.47.0: the gateway requires NeoFS node 0.57.0. Support for S3 credentials in the format used before HPKE "will be removed in half a year". ### To 0.28.0 {#to-0-28-0} From the console's changelog: - Access tokens created before 0.25.0 are no longer accepted. - The installer API of version 0.8 is removed. From the notes of NeoFS node 0.56.0: - The session storage migration introduced in node 0.52.0 and the shard index migrations of node 0.49.0 and 0.51.0 are removed (see the table above). - `grpc.tls.key` is no longer a storage node setting. The TLS key is the node key from the wallet. - The inner ring does not approve some bucket operations created by storage nodes older than 0.51.0. ### To 0.27.0 {#to-0-27-0} From the console's changelog and migrations: - The migrations 0.27.0 change the inner ring and storage node configuration (see the table above). From this release on, a migration saves the previous file. - Generated configuration files and wallets get mode `0640`. - `morphentry` manages chain hardforks in the inner ring configuration. - Ranged object downloads answer an unsatisfiable range with status `416`. From the notes of NeoFS node 0.55.0: - The storage node settings `object.put.pool_size_remote`, `storage.shard_pool_size`, `storage.put_retry_timeout` and `object.search.pool_size` are no longer supported. The storage node migration 0.27.0 removes the `object` section; the two `storage` keys are not removed by a migration. - The compression settings of the object store are no longer used. - The inner ring's migration of bucket records, introduced in node 0.51.0, is removed (see the table above). ### To 0.26.0 {#to-0-26-0} From the console's changelog and migrations: - Namespaces are introduced for users, administrators and buckets. - Configuration migration for the inner ring and the storage node is introduced, with the migrations 0.26.0. - Access rules for the RANGE and RANGEHASH operations are no longer supported. From the notes of NeoFS node 0.53.0 (node 0.54.0 has no notes of its own): - The shard index moves to version 11 at start, to update object counters. "This can take a while for shards with a lot of objects." - `policer.max_workers` is no longer a storage node setting. - The storage node no longer serves the first version of the `Search` operation and the `GetRangeHash` operation. ### To 0.25.0 {#to-0-25-0} From the console's changelog ("Updating from 0.24.0"): > Config parameter `neofs.sessionTTL` has duration format (30s, 24m, 1h35m), instead of > epochs. This is handled automatically on container update. Also from the changelog: - The variable `MORPH_PORT_IR_P2P` is renamed to `MORPH_PORT_IR_RPC`. - OAuth providers are created with `POST` and updated with `PUT`. - The operation `GET /v1/buckets/{bucket}/objects/{object}/metadata` is removed. From the notes of NeoFS node 0.52.0: - Storage nodes delete the objects of buckets (NeoFS containers) that are not paid for. "Data will permanently be deleted from shards, recovery isn't possible." - The settings `node.persistent_sessions.path`, `storage.shards.resync_metabase` and `replicator.pool_size` are removed from the storage node. - `neofs-lens` is renamed to `neofs-lancet`. ### To 0.24.0 {#to-0-24-0} From the notes of NeoFS node 0.51.0: the inner ring settings `fschain_autodeploy`, `without_mainnet`, `governance.disable`, `fee.main_chain` and `contracts` are removed, and an inner ring with one of them in its configuration does not start. From the console's changelog: several operations answer `204` where they answered `200` or `201`, and user names are restricted. ### Earlier releases with an "Updating from" section | Release | Section | Text of the changelog | |---|---|---| | 0.14.0 | Updating from 0.13.1 | "You must drop `access-box-storage` container for S3 gate access keys. You may use `neofs-cli` for this." | | 0.11.0 | Updating from 0.10.1 | "Please change api.port configuration to api.listenAddress." and "0.11.0 will not start without `s3.accessBoxContainerPolicy` and `s3.accessBoxContainerName` configured, so please provide them as well." | ## Going back to an earlier release There is no known downgrade procedure. Two facts bear on it: - Since 0.27.0, each configuration migration leaves the previous file as `.pre--migration`. - The storage node of Morph 0.30.0 and later rewrites its session records in a form that earlier versions cannot read. The node's notes require the backup taken before the upgrade for going back. ## Related pages - [Release notes](release-notes.md): all changes of every release. - [Component versions](component-versions.md) - [Deprecations](deprecations.md) - [Upgrade a cluster](../how-to/operate/upgrade.md) - [Back up and restore](../how-to/operate/back-up-and-restore.md) --- # Component versions A Morph image contains the Morph programs (`morphentry`, `installer`, `morph`) and three NeoFS programs taken from the upstream release images: the storage node, the inner ring and the S3 gateway. This page lists which upstream versions each Morph release bundles. ## Current release Morph 0.30.1, image `morphbits/morph:0.30.1`. | Component | Program in the image | Version | Taken from | |---|---|---|---| | Console, installer, entry point | `morph`, `installer`, `morphentry` | 0.30.1 | built from the console repository | | REST API specification | - | v0.30.1 | `api/morph.yaml` | | Storage node | `neofs-node` | 0.58.1 | `nspccdev/neofs-storage:0.58.1` | | Inner ring | `neofs-ir` | 0.58.1 | `nspccdev/neofs-ir:0.58.1` | | S3 gateway | `neofs-s3-gw` | 0.48.1 | `nspccdev/neofs-s3-gw:0.48.1` | | Base image | - | `alpine`, no version pinned | - | Libraries the console is built with: | Library | Version | |---|---| | Go | 1.26 | | NeoFS SDK (`neofs-sdk-go`) | v1.0.0-rc.24 | | NeoFS contracts (`neofs-contract`) | v0.28.0 | | neo-go | v0.123.0 | The storage node and the inner ring are two programs of one upstream project, NeoFS node, and are released together under one version number. ## All releases The table is derived from the "Upgraded" entries of the console's changelog. An entry names the version a release moved to; a release without an entry keeps the version of the release before it. The changelog has one entry, "NeoFS node", for the storage node and the inner ring together. | Morph | Date | NeoFS node (storage node and inner ring) | S3 gateway | |---|---|---|---| | 0.30.1 | 2026-11-06 | 0.58.1 | 0.48.1 | | 0.30.0 | 2026-11-02 | 0.58.0 | 0.48.1 | | 0.29.0 | 2026-10-06 | 0.57.0 | 0.47.0 | | 0.28.0 | 2026-09-03 | 0.56.0 | 0.46.0 | | 0.27.0 | 2026-08-06 | 0.55.0 | 0.45.1 | | 0.26.1 | 2026-07-08 | 0.54.0 | 0.45.0 | | 0.26.0 | 2026-07-07 | 0.54.0 | 0.45.0 | | 0.25.0 | 2026-04-15 | 0.52.0 | 0.43.1 | | 0.24.0 | 2026-03-16 | 0.51.1 | 0.42.0 | | 0.23.0 | 2026-01-14 | 0.50.2 | 0.41.5 | | 0.22.0 | 2025-12-04 | 0.50.2 | 0.41.5 | | 0.21.1 | 2025-10-17 | 0.49.1 | 0.41.2 | | 0.21.0 | 2025-10-09 | 0.49.0 | 0.41.2 | | 0.20.1 | 2025-08-28 | 0.48.3 | 0.40.0 | | 0.20.0 | 2025-08-01 | 0.48.1 | 0.40.0 | | 0.19.1 | 2025-06-12 | 0.47.1 | 0.38.0 | | 0.19.0 | 2025-06-11 | 0.47.0 | 0.38.0 | | 0.18.1 | 2025-05-16 | 0.46.1 | 0.37.0 | | 0.18.0 | 2025-05-14 | 0.46.0 | 0.37.0 | | 0.17.0 | 2025-03-25 | 0.45.2 | 0.35.0 | | 0.16.0 | 2025-03-07 | 0.45.1 | 0.35.0 | | 0.15.0 | 2024-12-28 | 0.44.1 | 0.33.0 | For releases before 0.15.0 the changelog does not record a complete pair of versions. It records S3 gateway 0.32.0 for Morph 0.13.0, NeoFS node 0.42.1 for Morph 0.11.0 and NeoFS node 0.41.0 for Morph 0.10.0. Morph 0.26.0 moved from NeoFS node 0.52.0 to 0.54.0. No Morph release bundles 0.53.0, so the upgrade notes of both node releases apply to that step (see [upgrade paths](upgrade-paths.md)). ## Requirements between the components | Requirement | Stated by | |---|---| | S3 gateway 0.48.0 requires NeoFS node 0.58.0. | S3 gateway changelog, 0.48.0 | | S3 gateway 0.47.0 requires NeoFS node 0.57.0. | S3 gateway changelog, 0.47.0 | Each Morph release bundles a pair that meets these requirements. They matter when a gateway-type node and the cluster it connects to run different Morph releases. ## The unstable image `morphbits/morph:unstable` is built with a second Dockerfile that compiles the storage node, the inner ring and the S3 gateway from the current `master` branches of the upstream repositories. Its component versions are whatever those branches contain on the day of the build. ## Related pages - [Release notes](release-notes.md) - [Upgrade paths](upgrade-paths.md) - [Command-line tools](../reference/command-line-tools.md): the programs in the image, and the tools that are not in it. --- # Deprecations This page lists what is deprecated in Morph 0.30.1 and what earlier releases removed. It is based on the console's changelog, the `deprecated` marks in the REST API specification, and the changelogs of the bundled NeoFS node and S3 gateway (see [component versions](component-versions.md)). "Removal" is the release that removes the item. Deprecated items can be removed in any subsequent release if there are no specific notes. ## REST API operations The specification marks four operations as deprecated. For the three quota and user operations it says: "This method will be removed in a future version." | Operation | Deprecated in | Replacement | Removal | |---|---|---|---| | [`POST /v1/users/{user}`](../reference/rest-api/users.md#post-v1-users-user) | 0.30.0 | [`POST /v1/users`](../reference/rest-api/users.md#post-v1-users), with the user name in the request body | not recorded | | [`POST /v1/users/{user}/quota`](../reference/rest-api/users.md#post-v1-users-user-quota) | 0.30.0 | [`PUT /v1/users/{user}/quota`](../reference/rest-api/users.md#put-v1-users-user-quota) | not recorded | | [`POST /v1/cluster/default-quota`](../reference/rest-api/cluster.md#post-v1-cluster-default-quota) | 0.30.0 | [`PUT /v1/cluster/default-quota`](../reference/rest-api/cluster.md#put-v1-cluster-default-quota) | not recorded | | [`POST /v1/cluster/storage-node`](../reference/rest-api/cluster.md#post-v1-cluster-storage-node) with the header `x-morph-action` | 0.30.0 | For `grant-access`: [`POST /v1/cluster/storage-nodes`](../reference/rest-api/cluster.md#post-v1-cluster-storage-nodes) for a storage node, [`POST /v1/cluster/gateways`](../reference/rest-api/cluster.md#post-v1-cluster-gateways) for a gateway. For `decommission`: [`DELETE /v1/cluster/storage-nodes/{address}`](../reference/rest-api/cluster.md#delete-v1-cluster-storage-nodes-address) and [`DELETE /v1/cluster/gateways/{address}`](../reference/rest-api/cluster.md#delete-v1-cluster-gateways-address). | not recorded | The changelog of 0.30.0 records the deprecation of `grant-access` on `POST /v1/cluster/storage-node`. The specification marks the whole operation as deprecated and describes `decommission` on it as "retained for legacy requests". ## REST API fields and behavior | Item | Where | Deprecated in | Replacement | Behavior while deprecated | |---|---|---|---|---| | `lockHours` | request body of [`POST /v1/buckets`](../reference/rest-api/buckets.md#post-v1-buckets) | 0.29.0 | `lockUntil`, a date and time | Accepted. Cannot be combined with `lockUntil`. | | `sticky` | [BasicACL](../reference/rest-api/schemas.md#basicacl) | 0.29.0 | none | Ignored when a bucket is created. | | `readContent` | [ACLGroup](../reference/rest-api/schemas.md#aclgroup), in a bucket's basic ACL | marked in the specification; the replacement was added in 0.29.0 | `get` | Merged with `get`: the operation is allowed when either flag is set. | | `readHeaders` | ACLGroup | as above | `head` and `search` | Merged with `head` and `search`. | | `create` | ACLGroup | as above | `put` | Merged with `put`. | | `readContent` | [CreateBearerTokenRequest](../reference/rest-api/schemas.md#createbearertokenrequest) and the token details | as above | `get` | Ignored when `get` is set. | | `readHeaders` | CreateBearerTokenRequest and the token details | as above | `head` and `search` | `head` overrides it for HEAD, `search` overrides it for SEARCH. | | `create` | CreateBearerTokenRequest and the token details | as above | `put` | Ignored when `put` is set. | | Deleting an object by its `FilePath` | [`DELETE /v1/buckets/{bucket}/objects/{object}`](../reference/rest-api/buckets.md#delete-v1-buckets-bucket-objects-object) | 0.29.0 | Delete by object ID | Supported. When several objects share the `FilePath`, the one with the greatest `Timestamp` is deleted, then the greatest object ID. | For the six permission flags the changelog records the new flags (`get`, `head`, `put`, `search`, added in 0.29.0) and no entry for the deprecation of the old ones. The specification of 0.30.1 marks the old ones as deprecated. ## Environment variables | Variable | Deprecated in | Replacement | Behavior while deprecated | |---|---|---|---| | `MORPH_PATH_S3_WALLET` | 0.29.0 | `MORPH_PATH_GATEWAY_WALLET` | Read when the replacement is not set. | | `MORPH_S3_WALLET_PASS` | 0.29.0 | `MORPH_GATEWAY_WALLET_PASS` | Read when the replacement is not set. | The image sets both replacements, so the earlier variables take effect only in an image or container definition that removes them. ## Bundled components Items that the changelogs of the bundled NeoFS node and S3 gateway mark as deprecated and that reach a Morph operator or a client. | Item | Component | Deprecated in | In Morph since | Replacement | Removal | |---|---|---|---|---|---| | S3 credentials stored in the format used before HPKE | S3 gateway | 0.47.0 | 0.29.0 | Credentials issued by Morph 0.30.0 or later, which use the new format | "will be removed in half a year" (S3 gateway changelog, 2026-10-01); no release named | | `--xhdr` (`-x`) flag of `neofs-cli` | NeoFS node | 0.58.0 | 0.30.0 | `--ec-part RULE[/PART]` for reading one part of an erasure-coded object | not recorded | | `neofs-cli object searchv2` | NeoFS node | 0.53.0 | 0.26.0 | `neofs-cli object search` | "will be removed in future" | | `--await` flag of `neofs-cli container` commands | NeoFS node | 0.52.0 | 0.25.0 | none needed with servers of NeoFS API 2.21 and later | "will be removed in a future release" | `neofs-cli` is not part of the Morph image (see [command-line tools](../reference/command-line-tools.md)); the three `neofs-cli` rows apply to the version an operator brings. ## Removed Items that earlier releases removed. ### With a recorded deprecation | Item | Deprecated in | Removed in | Replacement | |---|---|---|---| | Request header `XMorphSessionToken` | 0.15.0 (2024-12-28) | 0.16.0 (2025-03-07) | `Authorization: Bearer ` | | `POST` for setting a bucket's extended access rules | 0.15.0 (2024-12-28) | 0.16.0 (2025-03-07) | `PUT /v1/buckets/{bucket}/eacl` | | `name` field of an object in creation and listing | 0.17.0 (2025-03-25) | 0.21.0 (2025-10-09) | `path` | | `GET /v1/buckets/{bucket}/objects/{object}/metadata` | 0.22.0 (2025-12-04) | 0.25.0 (2026-04-15) | The headers of the `GET` and `HEAD` responses for the object | | NeoFS API: `GetRange` operation of the storage node | node 0.53.0 (Morph 0.26.0) | node 0.57.0 (Morph 0.29.0) | `Get` with a range | | Node addresses in multiaddress form | node 0.57.0 (Morph 0.29.0) | node 0.58.0 (Morph 0.30.0) | Plain addresses such as `grpc://host:port` | | Compression in the storage node's object store | node 0.55.0 (Morph 0.27.0) | node 0.58.0 (Morph 0.30.0) | none | ### Without a recorded deprecation | Item | Removed in | |---|---| | Access rules for the RANGE operation. The changelog of 0.30.0 lists "RANGE eACL support" as removed (#745) | 0.30.0 | | Status `409` as an answer to an object upload | 0.29.0 | | Installer API of version 0.8 | 0.28.0 | | Access tokens created before 0.25.0 | 0.28.0 | | Access rules for the RANGEHASH and RANGE operations. The changelog of 0.26.0 lists "RANGEHASH and RANGE EACL support" as removed (#638); RANGE appears in both releases | 0.26.0 | | Variable `MORPH_PORT_IR_P2P`, renamed to `MORPH_PORT_IR_RPC` | 0.25.0 | | Object upload with a `multipart/form-data` request body | 0.22.0 | | Inner ring block time configuration | 0.20.0 | | `FileName` field of an object | 0.17.0 | | REST API of version 0.8, and the route `/v1/initial-registration` | 0.12.0 | ## How deprecations have been handled Most of the time the window between deprecation and removal spans one or two releases, but in general it's case-specific. The changelog shows the following for historic deprecations: - A deprecation is recorded under "Changed", a removal under "Removed". - Four items of the console were first deprecated and later removed. The time between the two was one release (about ten weeks) for two of them, four minor releases (about six months) for one, and three minor releases (about four months) for one. - For the `name` field the changelog of 0.17.0 said that `path` "will replace name field in the next release". The field was removed in 0.21.0. - The removals in the second table above have no earlier deprecation entry. - The specification says of deprecated operations that they "will be removed in a future version" and names no version. - The S3 gateway and NeoFS node changelogs announce removals in terms of time ("in half a year") or not at all, and name no release. ## Related pages - [Release notes](release-notes.md) - [Upgrade paths](upgrade-paths.md) - [REST API](../reference/rest-api/index.md)