mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
docs: operations manual for v1.1.x standalone volumes (#974)
Merge note (pull_request_target spec-trace workflow has a startup_failure on every branch since 2026-12-02 22:45Z, so its checks run locally): - Test run 47118093690 succeeded (go test (linux), process-level tests (real binaries)) on head 47614211 against main 459059b9, the current main head. - spec-trace-check.sh and public-text-check.sh, run with the main branch's scripts against this head and body: both exit 0. - Docs review ACCEPT on 783166a2: removal runs only after a successful, empty unit query, SeaweedFS removal requires its unit to be inactive, and the multi-host guidance keeps mutual TLS and loopback guests. - Independent first-time operator runs on earlier heads of this manual (Ubuntu 24.04 with an upgrade and a reboot, and AlmaLinux 9 with SELinux enforcing over iSCSI) completed with zero workarounds; the later commits fold in their documentation findings.
This commit is contained in:
1 parent
e4d28bd134
commit
f5fea69cf7
5 files changed
+868
-10
No files matched your search
+18
-8
@@ -20,25 +20,35 @@ before v1.1. Do not run it for data you keep. v1.0.x releases ship from the `rel
|
||||
|
||||
## Install
|
||||
|
||||
The binaries are `blockmaster`, `blockvolume` and the `sw-block` CLI. The commands on this page are for v1.0.0.
|
||||
**Option 1:** copy them from the v1.0.0 image,
|
||||
`ghcr.io/seaweedfs/seaweed-block:v1.0.0` (index digest
|
||||
`sha256:648980beb519a086349d44367e9d19ba6ae94b8939456ae3eb7b7bb5e4b3b28b`):
|
||||
The binaries are `blockmaster`, `blockvolume` and the `sw-block` CLI, all three from one release: replace `TAG`
|
||||
below with the release, for example `v1.1.0`.
|
||||
|
||||
**Option 1:** download the release tarball and check it. Releases from v1.1.0 onwards carry it:
|
||||
|
||||
```bash
|
||||
docker create --name swb-extract ghcr.io/seaweedfs/seaweed-block:v1.0.0
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/TAG/sw-block-TAG-linux-amd64.tar.gz
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/TAG/SHA256SUMS
|
||||
sha256sum -c --ignore-missing SHA256SUMS && tar -xzf sw-block-TAG-linux-amd64.tar.gz --strip-components=1
|
||||
./blockvolume --version
|
||||
```
|
||||
|
||||
**Option 1b:** copy them from the release image `ghcr.io/seaweedfs/seaweed-block:TAG` (the release page gives its
|
||||
index digest):
|
||||
|
||||
```bash
|
||||
docker create --name swb-extract ghcr.io/seaweedfs/seaweed-block:TAG
|
||||
for b in blockmaster blockvolume sw-block; do docker cp swb-extract:/usr/local/bin/$b .; done
|
||||
docker rm swb-extract && ./blockvolume --version
|
||||
```
|
||||
|
||||
**Option 2:** build from the tag `v1.0.0` (the Go version in `go.mod`):
|
||||
**Option 2:** build from the tag `TAG` (the Go version in `go.mod`):
|
||||
```bash
|
||||
git clone --branch v1.0.0 https://github.com/seaweedfs/seaweed-block && cd seaweed-block
|
||||
git clone --branch TAG https://github.com/seaweedfs/seaweed-block && cd seaweed-block
|
||||
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
|
||||
```
|
||||
|
||||
**Option 3:** Helm, see the [Kubernetes quick start](#quick-start-kubernetes-alpha).
|
||||
Services: [standalone deployment](docs/standalone-deployment.md). Operator guide (supported setup, sizing, recovery point, host loss, limits): [operator guide](docs/operator-guide.md).
|
||||
Services: [standalone deployment](docs/standalone-deployment.md). Operations manual (install, upgrade and finalize, isolation, monitoring, typed errors): [operations manual](docs/operations-manual.md). Operator guide (supported setup, sizing, recovery point, host loss, limits): [operator guide](docs/operator-guide.md).
|
||||
|
||||
## Try it
|
||||
|
||||
|
||||
@@ -0,0 +1,844 @@
|
||||
# Operations manual (v1.1.x, standalone walstore-chunk volumes)
|
||||
|
||||
This manual takes one host from nothing to a serving volume. It then covers snapshots, restore, stop, delete,
|
||||
upgrade and monitoring, all with systemd. Every step gives the command to run. Links are for background only; you
|
||||
should not need them to finish a step. They are relative to the repository's `docs/` directory.
|
||||
|
||||
The examples use one host, with everything on loopback. Where an address must change for several hosts, the step
|
||||
says so. For the Kubernetes alpha line, see the [Kubernetes quick start](quickstart-kubernetes.md).
|
||||
|
||||
**Two conventions:**
|
||||
|
||||
- **Absolute paths under sudo.** Every command run with `sudo` names its binary by absolute path
|
||||
(`sudo /usr/local/bin/sw-block ...`). On RHEL and its rebuilds, sudo's `secure_path` does not include
|
||||
`/usr/local/bin`, so `sudo sw-block` answers `command not found`. Commands without sudo use the short name.
|
||||
- **Device names.** `/dev/<device>` stands for a device name you read from `lsblk` on your host. Never copy a device
|
||||
name from an example.
|
||||
|
||||
Contents:
|
||||
|
||||
0. [Prerequisites](#0-prerequisites)
|
||||
1. [Install the binaries and units](#1-install-the-binaries-and-units)
|
||||
2. [Cluster spec and blockmaster](#2-cluster-spec-and-blockmaster)
|
||||
3. [Create and attach a volume](#3-create-and-attach-a-volume)
|
||||
4. [Stop a volume](#4-stop-a-volume)
|
||||
5. [Snapshots, restore and verification](#5-snapshots-restore-and-verification)
|
||||
6. [Delete a volume](#6-delete-a-volume)
|
||||
7. [Upgrade and finalize the v1.1 format](#7-upgrade-and-finalize-the-v11-format)
|
||||
8. [Isolation: one I/O share per process](#8-isolation-one-io-share-per-process)
|
||||
9. [Monitoring](#9-monitoring)
|
||||
10. [Typed errors and what to do](#10-typed-errors-and-what-to-do)
|
||||
11. [Known limitations](#11-known-limitations)
|
||||
12. [Remove everything](#12-remove-everything)
|
||||
|
||||
Appendix A. [Build from source](#appendix-a-build-from-source)
|
||||
|
||||
## 0. Prerequisites
|
||||
|
||||
This manual has been run end to end on Ubuntu 24.04 and on AlmaLinux 9 with SELinux enforcing. You need Linux with
|
||||
systemd and root access.
|
||||
|
||||
1. **Packages.** You need the guest initiator, synced clocks, git and curl:
|
||||
|
||||
```sh
|
||||
# Ubuntu / Debian
|
||||
sudo apt-get update && sudo apt-get install -y nvme-cli chrony git curl xfsprogs
|
||||
sudo apt-get install -y open-iscsi # iSCSI guests only
|
||||
# Ubuntu cloud kernels (azure, aws, gcp) ship nvme_tcp in a separate package:
|
||||
sudo apt-get install -y linux-modules-extra-$(uname -r) # if modprobe says "Module nvme_tcp not found"
|
||||
# RHEL 9 / AlmaLinux 9 / Rocky 9
|
||||
sudo dnf install -y nvme-cli chrony git curl tar
|
||||
sudo dnf install -y iscsi-initiator-utils # iSCSI guests only
|
||||
# both (harmless on an iSCSI-only host)
|
||||
sudo modprobe nvme_tcp
|
||||
echo nvme_tcp | sudo tee /etc/modules-load.d/nvme_tcp.conf # load it at every boot
|
||||
```
|
||||
|
||||
Lease safety needs bounded clock skew between hosts, and blockmaster's clock must be slewed, never stepped,
|
||||
while volumes are served ([clock safety](operator-guide.md#clock-safety-requirement)). Configure chrony to step
|
||||
only during its first updates at boot: `makestep 1 3`. Ubuntu ships that. EL9 ships `makestep 1.0 -1` (it may
|
||||
step at any time), so change it on RHEL hosts before blockmaster starts:
|
||||
|
||||
```sh
|
||||
grep '^makestep' /etc/chrony.conf /etc/chrony/chrony.conf 2>/dev/null # want: makestep 1 3
|
||||
sudo sed -i 's/^makestep .*/makestep 1 3/' /etc/chrony.conf # EL9
|
||||
sudo systemctl restart chronyd
|
||||
```
|
||||
|
||||
On a cluster that already serves volumes, make this change only while no volume is served: do not restart
|
||||
chronyd while leases are live.
|
||||
|
||||
2. **A SeaweedFS 4.53 cluster with exactly one filer.** A volume keeps its chunks in SeaweedFS, through the filer's
|
||||
gRPC port (18888 by default). You need one master and one filer; a second filer is refused. For a single-host
|
||||
trial, install `weed` and run it as a systemd unit:
|
||||
|
||||
```sh
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweedfs/releases/download/4.53/linux_amd64.tar.gz
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweedfs/releases/download/4.53/linux_amd64.tar.gz.md5
|
||||
md5sum linux_amd64.tar.gz; cat linux_amd64.tar.gz.md5 # the two sums must match
|
||||
tar -xzf linux_amd64.tar.gz # extracts ./weed
|
||||
sudo install -m 0755 weed /usr/local/bin/weed
|
||||
sudo mkdir -p /data/weed # SeaweedFS data: put it on a disk with room for the chunks
|
||||
sudo tee /etc/systemd/system/seaweedfs.service >/dev/null <<'EOF'
|
||||
[Unit]
|
||||
Description=SeaweedFS (single host)
|
||||
After=network-online.target
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/weed server -dir=/data/weed -ip=127.0.0.1 -filer -volume.max=200 -master.volumeSizeLimitMB=1024
|
||||
Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now seaweedfs
|
||||
sleep 10; ss -ltn | grep -c -E ':(9333|8888|18888) ' # 3: master, filer HTTP, filer gRPC
|
||||
```
|
||||
|
||||
`linux_amd64.tar.gz` is the plain build; the `_full` and `_large_disk` variants also work. The filer's gRPC
|
||||
address is then `127.0.0.1:18888`.
|
||||
|
||||
3. **A disk for the volume's local data.** Each volume keeps its WAL and local copy under
|
||||
`/var/lib/sw-block-volume/<volume>`. That is on the root disk by default; `--durable-root` moves it. To size the
|
||||
host, see [size a host](operator-guide.md#size-a-host).
|
||||
|
||||
4. **This manual is for one host.** Everything listens on loopback, and nothing needs a firewall port. Two limits
|
||||
apply to any layout:
|
||||
- **Guests attach on the volume's own host.** A standalone volume's NVMe/TCP and iSCSI targets bind loopback only;
|
||||
a non-loopback `--nvme-listen` is refused. Do not change the guest listeners to a host address.
|
||||
- **blockmaster on another host needs mutual TLS.** blockmaster refuses a non-loopback `SWB_MASTER_LISTEN`
|
||||
without it. Set up the certificates and roles first, following
|
||||
[authenticate the control API](operator-guide.md#authenticate-the-control-api); changing the address alone does
|
||||
not work. The holders then also reach SeaweedFS (its master, filer and volume servers) over the network.
|
||||
|
||||
## 1. Install the binaries and units
|
||||
|
||||
1. **Get the repository at the release tag, then the binaries.** The repository holds the units in `deploy/`. The
|
||||
binaries are `blockmaster`, `blockvolume` and `sw-block`, all three from the same release. `TAG` is the release,
|
||||
for example `v1.1.0`. Download the release tarball and check it:
|
||||
|
||||
```sh
|
||||
TAG=v1.1.0
|
||||
git clone --depth 1 --branch $TAG https://github.com/seaweedfs/seaweed-block && cd seaweed-block # git's detached-HEAD note here is expected
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/sw-block-$TAG-linux-amd64.tar.gz
|
||||
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/SHA256SUMS
|
||||
sha256sum -c --ignore-missing SHA256SUMS # sw-block-<TAG>-linux-amd64.tar.gz: OK
|
||||
tar -xzf sw-block-$TAG-linux-amd64.tar.gz --strip-components=1
|
||||
sha256sum -c SHA256SUMS # all four: OK
|
||||
|
||||
./blockvolume --version # revision=<commit>
|
||||
git rev-parse HEAD # the same commit (v1.1.0 is ff6b0b1bb481d22ee2abc9206bf1ef19938787f5)
|
||||
```
|
||||
|
||||
Releases without a tarball (v1.0.x) take the binaries from the **release image**, which needs Docker or Podman
|
||||
(`docker.io` on Ubuntu; `podman podman-docker` on RHEL):
|
||||
|
||||
```sh
|
||||
sudo docker create --name swb-extract ghcr.io/seaweedfs/seaweed-block:$TAG
|
||||
for b in blockmaster blockvolume sw-block; do sudo docker cp swb-extract:/usr/local/bin/$b .; done
|
||||
sudo docker rm swb-extract
|
||||
```
|
||||
|
||||
To build the binaries from source instead, see [appendix A](#appendix-a-build-from-source).
|
||||
|
||||
2. **Install them with the shipped units**, from the same directory:
|
||||
|
||||
```sh
|
||||
sudo useradd --system --no-create-home --shell /usr/sbin/nologin sw-block
|
||||
sudo install -m 0755 blockmaster blockvolume sw-block /usr/local/bin/
|
||||
sudo install -d -m 0750 -g sw-block /etc/sw-block
|
||||
sudo install -m 0640 -g sw-block deploy/config/*.env /etc/sw-block/
|
||||
sudo install -m 0644 deploy/systemd/*.service /etc/systemd/system/
|
||||
sudo install -m 0644 deploy/systemd/sw-block.tmpfiles.conf /etc/tmpfiles.d/sw-block.conf
|
||||
sudo systemd-tmpfiles --create /etc/tmpfiles.d/sw-block.conf # /run/sw-block/locks; blockvolume needs it
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
The units run `/usr/local/bin/blockmaster` and `/usr/local/bin/blockvolume`, so keep that path. Use
|
||||
`install`, not `mv`: with SELinux, a file moved from a home directory keeps its home label and systemd may refuse
|
||||
to run it.
|
||||
|
||||
Do **not** enable `sw-blockvolume.service`. It is the single-volume example for the `--topology` setup, which cannot
|
||||
serve a walstore-chunk volume. This manual runs each volume as the template unit `sw-blockvolume@<volume>.service`,
|
||||
which `sw-block volume start` creates (section 3). `sw-blockmaster.service` is enabled in section 2.
|
||||
|
||||
**Upgrade order** (for later upgrades too, see section 7): the `sw-block` CLI first, then `blockmaster`, then each
|
||||
`blockvolume`. A CLI works with holders of its own version and of one version older. An older CLI against a newer
|
||||
holder is not supported. (The v1.0.2 notes' "CLI last" applied to upgrades within v1.0.x.)
|
||||
|
||||
**Authentication.** For production, set up mutual TLS for the control API ([authenticate the control
|
||||
API](operator-guide.md#authenticate-the-control-api)). The examples here run on loopback without it.
|
||||
|
||||
## 2. Cluster spec and blockmaster
|
||||
|
||||
blockmaster needs two things: a cluster spec and a lifecycle store. The cluster spec lists the nodes, and each volume
|
||||
with its size and home placement. A volume's record comes from the cluster spec: no command creates a volume.
|
||||
|
||||
1. **Write `/etc/sw-block/cluster-spec.yaml`** (as root, for example `sudoedit /etc/sw-block/cluster-spec.yaml`, or
|
||||
`sudo tee /etc/sw-block/cluster-spec.yaml >/dev/null <<'EOF'` ... `EOF`). Later sections edit the same file
|
||||
the same way:
|
||||
|
||||
```yaml
|
||||
nodes:
|
||||
- server_id: s1
|
||||
data_addr: 127.0.0.1:9201 # this node's own data address (volume start's --data-addr); several hosts: never loopback
|
||||
ctrl_addr: 127.0.0.1:9202
|
||||
volumes:
|
||||
- id: v1
|
||||
size_bytes: 4294967296 # 4 GiB; volume start's --size must equal it
|
||||
replication_factor: 1
|
||||
placements:
|
||||
- server_id: s1
|
||||
replica_id: r1
|
||||
```
|
||||
|
||||
```sh
|
||||
sudo chgrp sw-block /etc/sw-block/cluster-spec.yaml && sudo chmod 0640 /etc/sw-block/cluster-spec.yaml
|
||||
```
|
||||
|
||||
2. **Replace all four of these lines in `/etc/sw-block/blockmaster.env`.** The shipped file sets the first and third lines
|
||||
differently, so replace them rather than adding new ones. The shipped unit turns these lines into flags.
|
||||
`--topology` and `--cluster-spec` together stop blockmaster, so the topology line must be empty:
|
||||
|
||||
```sh
|
||||
SWB_MASTER_TOPOLOGY=
|
||||
SWB_MASTER_EXPECTED_SLOTS=1
|
||||
SWB_MASTER_WORKSPACE_RPC=true
|
||||
SWB_MASTER_EXTRA_ARGS=--cluster-spec /etc/sw-block/cluster-spec.yaml --lifecycle-store /var/lib/sw-block-master/lifecycle --chunk-filer 127.0.0.1:18888 --chunk-path /swblock/chunks
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```sh
|
||||
sudo sed -i -e 's|^SWB_MASTER_TOPOLOGY=.*|SWB_MASTER_TOPOLOGY=|' \
|
||||
-e 's|^SWB_MASTER_EXPECTED_SLOTS=.*|SWB_MASTER_EXPECTED_SLOTS=1|' \
|
||||
-e 's|^SWB_MASTER_WORKSPACE_RPC=.*|SWB_MASTER_WORKSPACE_RPC=true|' \
|
||||
-e 's|^SWB_MASTER_EXTRA_ARGS=.*|SWB_MASTER_EXTRA_ARGS=--cluster-spec /etc/sw-block/cluster-spec.yaml --lifecycle-store /var/lib/sw-block-master/lifecycle --chunk-filer 127.0.0.1:18888 --chunk-path /swblock/chunks|' \
|
||||
/etc/sw-block/blockmaster.env
|
||||
sudo grep -E '^SWB_MASTER_(TOPOLOGY|EXPECTED_SLOTS|WORKSPACE_RPC|EXTRA_ARGS)=' /etc/sw-block/blockmaster.env
|
||||
```
|
||||
|
||||
The lifecycle store must be under `/var/lib/sw-block-master`, the unit's state directory. Any other path is
|
||||
read-only under the unit, and blockmaster then restarts in a loop with `read-only file system`.
|
||||
|
||||
3. **Start it and check:**
|
||||
|
||||
```sh
|
||||
sudo systemctl enable --now sw-blockmaster
|
||||
sudo journalctl -u sw-blockmaster -n 20 # "new cluster: format level 1 (no prior authority state ...)"
|
||||
sw-block cluster format-level --master 127.0.0.1:9180 # format level 1
|
||||
sw-block ops workspace show --master 127.0.0.1:9180 --volume v1 # exit 0
|
||||
```
|
||||
|
||||
blockmaster reads the cluster spec only when it starts. After editing the spec, run
|
||||
`sudo systemctl restart sw-blockmaster`. Serving volumes keep serving across that restart.
|
||||
|
||||
## 3. Create and attach a volume
|
||||
|
||||
1. **Add the volume to the cluster spec** with its `size_bytes` (edit it as root, as in section 2), and restart
|
||||
blockmaster. Check it with
|
||||
`sw-block ops workspace show --master 127.0.0.1:9180 --volume <volume>` (exit 0). (For a restore target, which has
|
||||
no `size_bytes`, the same command exits 1 with `workspace move requires an existing RF1 volume` until the restore.
|
||||
That is expected.)
|
||||
2. **Start it.** It needs root, and `--size` must equal the spec's `size_bytes`:
|
||||
|
||||
```sh
|
||||
sudo /usr/local/bin/sw-block volume start v1 --server-id s1 --replica-id r1 \
|
||||
--data-addr 127.0.0.1:9201 --ctrl-addr 127.0.0.1:9202 --status-addr 127.0.0.1:9203 \
|
||||
--size 4GiB --nvme-listen 127.0.0.1:4420 --chunk-filer 127.0.0.1:18888
|
||||
```
|
||||
|
||||
For an **iSCSI** guest, add `--iscsi-listen 127.0.0.1:3260 --iqn iqn.2026-12.io.seaweedfs:v1`.
|
||||
`--nvme-listen` stays required: the volume serves both protocols. With SELinux enforcing, `iscsid` may connect
|
||||
only to ports labeled `iscsi_port_t` (3260 by default). For any other iSCSI port, label it **before discovery**:
|
||||
|
||||
```sh
|
||||
sudo dnf install -y policycoreutils-python-utils
|
||||
sudo semanage port -a -t iscsi_port_t -p tcp <port>
|
||||
```
|
||||
|
||||
The command does four things:
|
||||
- writes `/etc/sw-block/volumes/v1.env`;
|
||||
- starts `sw-blockvolume@v1.service`;
|
||||
- waits until the volume is Healthy (2 minutes by default);
|
||||
- prints the attach command. (Its hints say `sudo sw-block ...`; on RHEL, use `sudo /usr/local/bin/sw-block ...`.)
|
||||
|
||||
Running it again with the same flags answers `unchanged`. Different flags are refused
|
||||
(`exists with other settings ... pass --replace`).
|
||||
|
||||
3. **Attach the guest.** For NVMe/TCP, use the command the start printed:
|
||||
|
||||
```sh
|
||||
sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n nqn.2026-05.io.seaweedfs:v1 --ctrl-loss-tmo=180 --reconnect-delay=2
|
||||
lsblk -o NAME,SIZE,MODEL # the new 4G device, model "SeaweedFS V3 BlockVol"
|
||||
```
|
||||
|
||||
For iSCSI:
|
||||
|
||||
```sh
|
||||
sudo iscsiadm -m discovery -t sendtargets -p 127.0.0.1:3260
|
||||
sudo iscsiadm -m node -T iqn.2026-12.io.seaweedfs:v1 -p 127.0.0.1:3260 --login
|
||||
lsblk -o NAME,SIZE,VENDOR,MODEL # the new 4G sd device, vendor "SeaweedF", model "BlockVol"
|
||||
```
|
||||
|
||||
- **iscsid and the initiator name.** `iscsid` starts on first use, and it creates `/etc/iscsi/initiatorname.iscsi`
|
||||
then. You don't need to enable or configure either.
|
||||
- **Boot.** Discovery records the target with `node.startup = automatic`, so the initiator logs in again at boot,
|
||||
possibly before the volume serves. To log in yourself once the volume serves, set it to manual:
|
||||
`sudo iscsiadm -m node -T iqn.2026-12.io.seaweedfs:v1 -p 127.0.0.1:3260 --op update -n node.startup -v manual`.
|
||||
- **Telling volumes apart.** With several volumes attached, find each device by its name instead of by order.
|
||||
For iSCSI, run `ls -l /dev/disk/by-path/ | grep <iqn>` (for example `...:3261-iscsi-iqn...:v2-lun-0 -> ../../sdc`).
|
||||
For NVMe/TCP, run `sudo nvme list-subsys`, which shows each NQN with its controller.
|
||||
|
||||
4. **Make a filesystem and mount it.** Run `mkfs` only the first time: it erases the volume.
|
||||
|
||||
```sh
|
||||
sudo mkfs.xfs /dev/<device> # or mkfs.ext4
|
||||
sudo mkdir -p /mnt/v1 && sudo mount /dev/<device> /mnt/v1
|
||||
```
|
||||
|
||||
Sizes and start time:
|
||||
|
||||
- **Size limit.** New volumes can be up to 1 TiB (1,099,511,627,776 bytes) once the cluster is at format level 1.
|
||||
New clusters start there; an upgraded cluster gets there with the finalize (section 7).
|
||||
- **Large volumes before the finalize.** A volume above 256 GiB in the cluster spec is **not registered**.
|
||||
blockmaster logs `size_requires_format_level_1 ... finalize the v1.1 format` and keeps running without it. Check
|
||||
blockmaster's log after adding a large volume. (`sw-block ops volume create` answers the same refusal with exit 78.)
|
||||
- **Start time.** It grows with size:
|
||||
- attach takes about 1.4 ms per GiB (about 4 s at 1 TiB);
|
||||
- a restart after a kill takes about 1.5 ms per GiB (about 2.1 s at 1 TiB).
|
||||
|
||||
Both are inside the 30 s startup window.
|
||||
- **`--recover-timeout`** (default 30 s) is a no-progress window, not a total deadline. Each completed recovery step
|
||||
renews it, and it pauses while the volume waits for blockmaster. A full window without progress reports
|
||||
`recovery_stalled` (section 10).
|
||||
- **One live process per volume per host.** A host lock keeps a second process for the same volume out. The
|
||||
assignment and the lease keep two hosts apart.
|
||||
|
||||
## 4. Stop a volume
|
||||
|
||||
```sh
|
||||
# NVMe/TCP guest
|
||||
sudo umount /mnt/v1
|
||||
sudo nvme disconnect -n nqn.2026-05.io.seaweedfs:v1
|
||||
sudo /usr/local/bin/sw-block volume stop v1
|
||||
```
|
||||
|
||||
```sh
|
||||
# iSCSI guest
|
||||
sudo umount /mnt/v1
|
||||
sudo iscsiadm -m node -T iqn.2026-12.io.seaweedfs:v1 -p 127.0.0.1:3260 --logout
|
||||
sudo /usr/local/bin/sw-block volume stop v1
|
||||
```
|
||||
|
||||
While a guest is connected, the stop refuses with exit 2 (`guests: 1 guest connection(s) ... disconnect them
|
||||
first`). Otherwise it:
|
||||
|
||||
1. takes a cut, so the object store has every write up to now;
|
||||
2. stops the unit;
|
||||
3. ends with `recovery point in the object store: the cut at <time>` (exit 0).
|
||||
|
||||
The unit stays enabled and starts again at boot. To start it now, run `sudo /usr/local/bin/sw-block volume start v1 ...`
|
||||
with the same flags.
|
||||
|
||||
Running the stop again on a stopped volume answers `not running (inactive): nothing to cut or stop` (exit 0). When
|
||||
you know no guest uses the volume (for example, a killed VM), add `--force`.
|
||||
|
||||
**blockmaster and the holders on one host.** A holder that loses blockmaster for about 20 s loses its lease. It
|
||||
exits 75 and systemd restarts it 5 s later. Its unit `Wants=` blockmaster, so that restart starts a stopped
|
||||
blockmaster again. To keep blockmaster down for maintenance, stop the volumes on that host first.
|
||||
|
||||
## 5. Snapshots, restore and verification
|
||||
|
||||
**Take a snapshot.** Snapshots are crash-consistent; there is no guest freeze.
|
||||
|
||||
```sh
|
||||
sw-block ops chunk snapshot --volume v1 --name snapA --status-addr 127.0.0.1:9203 --request-id snapA-1
|
||||
sw-block ops chunk snapshots --volume v1 --master 127.0.0.1:9180 --chunk-filer 127.0.0.1:18888
|
||||
```
|
||||
|
||||
`sudo /usr/local/bin/sw-block volume backup v1 --name bk1` takes the same kind of snapshot through the volume's unit.
|
||||
|
||||
- **Scheduled snapshots.** Holders take them by default, so a `sched-...` snapshot also appears.
|
||||
- **`chunkCount`.** v1.1.0 does not fill this field of the answer; it is always 0. To count a volume's chunks, run
|
||||
verify (below).
|
||||
- **Repeating a request.** The same name with a new request id is refused (`snapshot_exists`, exit 1). The same
|
||||
request id replays the first answer.
|
||||
|
||||
**Restore a snapshot into a new volume.** The source keeps serving. Use the two steps below.
|
||||
(`volume backup` also prints a one-command `sw-block volume restore`. That command needs blockmaster's lifecycle
|
||||
product loop, which this setup does not run.)
|
||||
|
||||
1. **Add the target to the cluster spec without `size_bytes`** (edit it as root, as in section 2), then restart
|
||||
blockmaster. An entry with
|
||||
`size_bytes` creates an empty volume, and the restore is then refused with `target_exists`. A target missing from
|
||||
the spec is refused with `not_admitted`.
|
||||
|
||||
```yaml
|
||||
- id: v2
|
||||
replication_factor: 1
|
||||
placements:
|
||||
- server_id: s1
|
||||
replica_id: r1
|
||||
```
|
||||
|
||||
Add a target only when you are about to restore into it. In v1.1.0, an entry removed again before any restore
|
||||
leaves its placement behind (section 6).
|
||||
|
||||
2. **Restore, then start the new volume with the source's size.** On the same host it needs its own ports:
|
||||
|
||||
```sh
|
||||
sw-block ops chunk restore --master 127.0.0.1:9180 --source v1 --snapshot snapA --target v2 \
|
||||
--chunk-filer 127.0.0.1:18888 --request-id restore-v2
|
||||
sudo /usr/local/bin/sw-block volume start v2 --server-id s1 --replica-id r1 \
|
||||
--data-addr 127.0.0.1:9211 --ctrl-addr 127.0.0.1:9212 --status-addr 127.0.0.1:9213 \
|
||||
--size 4GiB --nvme-listen 127.0.0.1:4421 --chunk-filer 127.0.0.1:18888
|
||||
```
|
||||
|
||||
For iSCSI, add `--iscsi-listen 127.0.0.1:3261 --iqn iqn.2026-12.io.seaweedfs:v2`.
|
||||
|
||||
3. **Attach it** as in section 3, but do **not** run `mkfs`: the data is the snapshot's.
|
||||
- **XFS next to its source.** The restored filesystem has its source's UUID, so mount it with
|
||||
`sudo mount -o nouuid /dev/<device> /mnt/v2`.
|
||||
- **SELinux and iSCSI.** Label the new port (3261 here) before discovery, as in section 3:
|
||||
`sudo semanage port -a -t iscsi_port_t -p tcp 3261`.
|
||||
|
||||
**Verify a store** read-only:
|
||||
|
||||
```sh
|
||||
sw-block ops chunk verify --master 127.0.0.1:9180 --volume v1 --chunk-filer 127.0.0.1:18888 --orphans
|
||||
sw-block ops chunk verify --master 127.0.0.1:9180 --volume v1 --chunk-filer 127.0.0.1:18888 --depth data --timeout 10m
|
||||
```
|
||||
|
||||
- **Exit codes:** 0 clean; 3 completed with findings; 1 could not complete (the answer says why); 2 usage.
|
||||
- **`--depth data`** needs `--timeout`.
|
||||
- **`--timeout` and `--deadline`.** `--timeout` is a no-progress window: each completed read renews it.
|
||||
`--deadline` optionally bounds the whole pass.
|
||||
- **ORPHAN findings.** `--orphans` can exit 3 with `ORPHAN` findings ("no reachable root names it") on a healthy
|
||||
volume. These are objects of superseded cuts that the next cleaning pass removes (hourly by default). They are a
|
||||
report only: no action is needed.
|
||||
|
||||
**Space.** A deleted snapshot is cleaned at the next maintenance pass (`--chunk-maintenance-interval`, default 1 h).
|
||||
The disk space returns when SeaweedFS vacuums its volumes. Never run SeaweedFS `volume.fsck` with its delete flags on a
|
||||
cluster holding chunk volumes.
|
||||
|
||||
**Delete a snapshot.** Give each delete its own request id:
|
||||
|
||||
```sh
|
||||
sw-block ops chunk snapshot-delete --master 127.0.0.1:9180 --volume v1 --chunk-filer 127.0.0.1:18888 \
|
||||
--name snapA --request-id delete-snapA-1
|
||||
```
|
||||
|
||||
A snapshot that a restored volume depends on cannot be deleted until that volume is deleted (section 6).
|
||||
|
||||
One snapshot delete per volume at a time: a second delete answers `no_progress ... another transaction is open` until
|
||||
the first one's cleaning pass (up to `--chunk-maintenance-interval`, 1 h). Keep retrying it with the same request id.
|
||||
|
||||
## 6. Delete a volume
|
||||
|
||||
A deleted name is never created again. To delete the restored volume `v2`:
|
||||
|
||||
1. **Unmount and disconnect its guest** (section 4). The volume must be serving: if you stopped it, start it again
|
||||
with the same flags first (a stopped volume answers `remote_unavailable` here, and retrying does not help). Then
|
||||
seal the volume. The answer prints its `headEpoch` (E) and
|
||||
`sealed HEAD generation: G`:
|
||||
|
||||
```sh
|
||||
sw-block ops chunk detach --plain --volume v2 --status-addr 127.0.0.1:9213 --timeout 120s
|
||||
```
|
||||
|
||||
2. **Revoke its lease and wait for the holder's acknowledgement.** Do not stop the holder yourself: it acknowledges
|
||||
and exits 0 on its own. Repeat `show` until it prints `recorded ACK: r1@E HEAD generation G`, with
|
||||
`lease state: revoking` (or `expired`, about 20 s later). Then disable the unit so that it does not start at boot:
|
||||
|
||||
```sh
|
||||
sw-block ops workspace revoke --master 127.0.0.1:9180 --volume v2 --replica r1 --epoch E --sealed-gen G
|
||||
sw-block ops workspace show --master 127.0.0.1:9180 --volume v2
|
||||
sudo systemctl disable sw-blockvolume@v2
|
||||
```
|
||||
|
||||
3. **Delete it** once its lease horizon has passed (about 60 s):
|
||||
|
||||
```sh
|
||||
sw-block ops chunk volume-delete --master 127.0.0.1:9180 --volume v2 --chunk-filer 127.0.0.1:18888 \
|
||||
--request-id delete-v2
|
||||
```
|
||||
|
||||
- It answers `{"volume":"v2-<id8>","state":"deleted"}`.
|
||||
- Before the horizon it answers `not_admitted ... live until <time>` and deletes nothing. Run the same command,
|
||||
with the same request id, after that time.
|
||||
- The delete removes the volume's data and snapshots. A small tombstone stays (`HEAD`, `VOLUME` and empty
|
||||
directories under `/swblock/chunks/v2-<id8>/`): it keeps the name from being created again. Do not remove it.
|
||||
- In v1.1.0, blockmaster keeps the deleted volume's authority record. After step 4, cluster status stays
|
||||
`degraded` for it (`observed_replicas_below_desired`), and `ops workspace show --volume v2` answers
|
||||
`workspace: volume is being deleted`, and `cluster.check` keeps failing the deleted volume's holder checks
|
||||
(`host.heartbeat`, `volume.lease`, `volume.frontend` and others). All of this is expected, and it does not
|
||||
affect other volumes.
|
||||
|
||||
4. **Remove the volume from the cluster spec** (edit it as root, as in section 2), restart blockmaster, and remove the settings file:
|
||||
|
||||
```sh
|
||||
sudo rm /etc/sw-block/volumes/v2.env
|
||||
```
|
||||
|
||||
5. **(v1.1.0) Remove the leftover list pages** (section 11). This step is needed only if a snapshot of the volume
|
||||
was deleted; otherwise there is nothing to remove, and the command answers the same way (HTTP 204). The `v2-<id8>`
|
||||
value is the directory from the delete's answer:
|
||||
|
||||
```sh
|
||||
curl -X DELETE 'http://127.0.0.1:8888/swblock/chunks/v2-<id8>/lists/?recursive=true'
|
||||
```
|
||||
|
||||
**Back out a restore target you never restored into.** In v1.1.0 you cannot remove such an entry cleanly. If you
|
||||
remove it from the spec, blockmaster keeps its placement: cluster status stays `degraded` for it, and
|
||||
`volume-delete` answers `volume_not_found`. Leave the entry in the spec, or restore into it.
|
||||
|
||||
## 7. Upgrade and finalize the v1.1 format
|
||||
|
||||
This section starts from a v1.0.2 cluster installed as in sections 1 and 2 with `TAG=v1.0.2`. Two differences apply
|
||||
to v1.0.x:
|
||||
|
||||
- **No tarball.** v1.0.x releases have no tarball and no `SHA256SUMS`, so take the binaries from the release image
|
||||
(or build them, appendix A), as in section 1. The image needs Docker: `sudo apt-get install -y docker.io`
|
||||
(Ubuntu) or `sudo dnf install -y podman podman-docker` (RHEL). To check them, `./blockvolume --version` must print the same commit
|
||||
as `git rev-parse HEAD` in the tag's clone (v1.0.2 is `2a91bfee...`).
|
||||
- **No format-level checks.** Section 2's format-level checks do not exist on v1.0.x: skip the `journalctl` line and
|
||||
`sw-block cluster format-level`. `sw-block ops workspace show` works.
|
||||
|
||||
Get the new release as in section 1, step 1, **in a new, empty directory** (the v1.0.2 clone already has the name
|
||||
`seaweed-block`), and run the commands below from that fresh clone. After the upgrade, the cluster keeps
|
||||
writing the v1.0 format until you finalize. Until then you can go back.
|
||||
|
||||
1. **The CLI first.** Install the new `sw-block`:
|
||||
|
||||
```sh
|
||||
sudo install -m 0755 sw-block /usr/local/bin/
|
||||
```
|
||||
|
||||
It works against the old blockmaster and holders, with two exceptions: `sw-block cluster format-level` and
|
||||
`finalize-format` answer `Unimplemented` (exit 1) until blockmaster is v1.1.
|
||||
|
||||
2. **The units.** Install the new tag's unit files, but not its `.env` files: those hold your settings. (The v1.1
|
||||
template unit adds `MemoryMax=2G`.)
|
||||
|
||||
```sh
|
||||
sudo install -m 0644 deploy/systemd/*.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
3. **blockmaster.** Install the new binary, restart, and check the level:
|
||||
|
||||
```sh
|
||||
sudo install -m 0755 blockmaster /usr/local/bin/
|
||||
sudo systemctl restart sw-blockmaster
|
||||
sw-block cluster format-level --master 127.0.0.1:9180 # format level 0
|
||||
```
|
||||
|
||||
Volumes keep serving.
|
||||
|
||||
4. **Each holder.** Install the new binary once per host, then restart each volume on that host:
|
||||
|
||||
```sh
|
||||
sudo install -m 0755 blockvolume /usr/local/bin/
|
||||
sudo systemctl restart sw-blockvolume@<volume>
|
||||
```
|
||||
|
||||
A connected guest can stay connected: the volume serves again in about a second, and guest I/O resumes about 2-3 s
|
||||
after the restart (the connect's `--reconnect-delay=2`), with its data.
|
||||
|
||||
**Going back** before the finalize: reinstall the v1.0.x binaries in reverse order (each holder, then
|
||||
blockmaster), restarting each the same way. The v1.1 CLI can stay.
|
||||
|
||||
5. **Finalize** once every holder runs v1.1:
|
||||
|
||||
```sh
|
||||
sw-block cluster finalize-format --master 127.0.0.1:9180 --json
|
||||
```
|
||||
|
||||
- **Refused** (exit 2, `FORMAT_HOSTS_TOO_OLD`) while a holder still runs v1.0.x. That holder reports format
|
||||
level 0 and is named in `hosts` (for example `"reported":"volume v1 reads level 0"`). Upgrade it, or move its
|
||||
volume, and run the finalize again.
|
||||
- **`listed`** names the hosts the master cannot confirm but that do not block the finalize: a held volume with no
|
||||
report or a stale one, a host with no report, and an old process that holds no volume.
|
||||
- **Exit codes:** **0** finalized or already finalized; **2** refused; **75** blockmaster unreachable, retry; **1**
|
||||
any other failure (the level is unchanged).
|
||||
- **JSON only.** The typed codes (`FORMAT_HOSTS_TOO_OLD`, and `HOST_HOLDS_WORK` below) appear only with `--json`.
|
||||
Plain output says `refused`.
|
||||
|
||||
6. **Restart each holder after the finalize** (`sudo systemctl restart sw-blockvolume@<volume>`). A holder keeps the
|
||||
format level it attached at until it restarts: its `/status` shows `"FormatLevel":0`. Until then, its cuts fail
|
||||
with `format_level_below_head_version`, and snapshots answer `no_progress ... snapshot stalled`. After the
|
||||
restart, the same snapshot request id settles within about a minute.
|
||||
|
||||
7. **Retire** a host that holds nothing and will not come back:
|
||||
|
||||
```sh
|
||||
sw-block cluster retire-host --server <id> --confirm <id> --master 127.0.0.1:9180 --json
|
||||
```
|
||||
|
||||
It is refused while the host holds a volume (`HOST_HOLDS_WORK`, each volume named).
|
||||
|
||||
The finalize is **one-way**. Afterwards, old binaries refuse the new format:
|
||||
|
||||
- **A v1.0.x blockmaster** on the store restarts in a loop, with `corrupt record: envelope version 2 unsupported` and
|
||||
`json: cannot unmarshal number into Go value of type master.attestedStores`.
|
||||
- **A v1.0.x holder with its local store** exits 1 on every start, with `storage: invalid superblock: neither
|
||||
descriptor slot is valid (... reserved byte 306 is nonzero ...)`.
|
||||
- **A v1.0.x holder without a local store** gets no volume and exits 75 (`assignment_timeout`).
|
||||
- **Cluster status** shows `binary_too_old` for either holder (section 9).
|
||||
|
||||
None of this means damage: do not rebuild anything. Install v1.1 again. A holder that restarted in a loop has hit its
|
||||
unit's start limit, so clear it before you restart:
|
||||
|
||||
```sh
|
||||
sudo systemctl reset-failed sw-blockvolume@<volume>
|
||||
sudo systemctl restart sw-blockvolume@<volume>
|
||||
```
|
||||
|
||||
## 8. Isolation: one I/O share per process
|
||||
|
||||
Give each volume process, blockmaster and SeaweedFS their own I/O share. Each systemd unit is already its own cgroup,
|
||||
but the shipped units set no I/O limit. Setting a property enables the `io` controller. Use a write bandwidth cap on
|
||||
the disk that holds each process's data. Read the disk from the mount, and never copy a device name:
|
||||
|
||||
```sh
|
||||
VDISK=$(findmnt -no SOURCE -T /var/lib/sw-block-volume) # or your --durable-root
|
||||
MDISK=$(findmnt -no SOURCE -T /var/lib/sw-block-master)
|
||||
WDISK=$(findmnt -no SOURCE -T /data/weed)
|
||||
sudo systemctl set-property sw-blockvolume@v1 "IOWriteBandwidthMax=$VDISK 400M"
|
||||
sudo systemctl set-property sw-blockmaster "IOWriteBandwidthMax=$MDISK 100M"
|
||||
sudo systemctl set-property seaweedfs "IOWriteBandwidthMax=$WDISK 400M"
|
||||
systemctl show -p IOWriteBandwidthMax sw-blockvolume@v1 sw-blockmaster seaweedfs
|
||||
```
|
||||
|
||||
- **When it applies.** The settings apply at once to running units and persist across restarts.
|
||||
- **One cap per instance.** Set it for each new volume (`sw-blockvolume@v2`, ...).
|
||||
- **A device that does not exist** is accepted silently and caps nothing. Check the `show` output.
|
||||
- **`IOWeight=` alone** gives no isolation on a default host. With the `none` I/O scheduler (the default for NVMe and
|
||||
SSDs), weights are not enforced unless BFQ or blk-iocost is configured.
|
||||
|
||||
Why each process needs its own share:
|
||||
|
||||
- **Per volume.** One cap shared by several volume processes is one queue. One volume's writeback burst can hold
|
||||
another volume's sync past its 30 s startup window, and that volume then reports `recovery_stalled`. Only the WAL
|
||||
fence's zero writes bypass the page cache, and only on Linux with aligned bytes, where the filesystem accepts
|
||||
O_DIRECT. Every other write goes through the page cache, and even direct writes wait in their cgroup's queue.
|
||||
- **blockmaster.** blockmaster writes two things durably before it answers: a volume's first lease grant and a
|
||||
primary's store attestation. On a master starved of I/O, those writes outlast the holder's 2 s request, and the
|
||||
volume serves nothing until they complete. At format level 1, lease renewals do not write.
|
||||
- **The filer.** Cuts, snapshots and moves go through it.
|
||||
|
||||
## 9. Monitoring
|
||||
|
||||
**One check command for a start-up failure.** Run it on the volume's host, with the server id, the filer and that
|
||||
volume's status address:
|
||||
|
||||
```sh
|
||||
sw-block shell -master 127.0.0.1:9180 -filer 127.0.0.1:18888 -server-id s1 -status-addr 127.0.0.1:9203 \
|
||||
-c "cluster.check"
|
||||
```
|
||||
|
||||
Each `FAIL` names its section in [Troubleshooting](troubleshooting.md). On a healthy single host in v1.1.0 it still
|
||||
exits 1, because of the known FAILs listed below.
|
||||
|
||||
- **Missing flags.** Without `-server-id` (it defaults to the hostname) and `-status-addr`, the holder's checks print
|
||||
`not checked here`. Without `-filer`, the filer check prints `not checked here`.
|
||||
- **One volume per run.** `-status-addr` takes one volume's address. On a host with several volumes, run the command
|
||||
once per volume and read that volume's lines: the other volumes' holder checks fail with `/status returned HTTP
|
||||
404`.
|
||||
- **A stopped volume** fails its holder checks (`host.heartbeat`, `volume.lease`, `volume.frontend`,
|
||||
`volume.chunkstore`, `volume.cut`, `versions.equal`, and others). Some of the printed cures do not apply. Cluster
|
||||
status shows the cluster `blocked` or `degraded` until the volume runs again. A volume deleted in v1.1.0 stays
|
||||
`degraded` (section 6).
|
||||
|
||||
These FAILs do not mean a fault in v1.1.0:
|
||||
|
||||
- **`master.lifecycle`** fails with `workspace move requires an existing RF1 volume` on a correct cluster-spec setup.
|
||||
Its printed cure (`blockmaster runs without --lifecycle-store`) does not apply. Check the setup with
|
||||
`sw-block ops workspace show --master 127.0.0.1:9180 --volume v1` (exit 0) instead.
|
||||
- **`volume.cleaning`** fails with `no cleaning pass completed since start` for up to `--chunk-maintenance-interval`
|
||||
(1 h) after each holder start.
|
||||
- **The holder checks of a deleted volume** keep failing (section 6, step 3).
|
||||
|
||||
**Cluster status.** `sw-block shell -master 127.0.0.1:9180 -c "cluster.status -o json"` prints every volume and node,
|
||||
with its conditions.
|
||||
|
||||
- A volume whose holder runs an old binary has a condition with reason `binary_too_old`. It names the server and the
|
||||
format level that server reported.
|
||||
- A node's `last_heartbeat_at` can show blockmaster's last start rather than the latest heartbeat.
|
||||
|
||||
**Holder status** comes from the `--status-addr` listener, which is loopback only. Every route needs `?volume=<id>`;
|
||||
without it the answer is HTTP 400 `missing volume query param`. Every field is in the
|
||||
[status schema](status-schema.md).
|
||||
|
||||
| Route | What it shows |
|
||||
|---|---|
|
||||
| `curl -s '127.0.0.1:9203/status?volume=v1'` | health and `FormatLevel`; `NotReadyReason`, `MasterWait` and `RecoveryWait` only while the volume is not ready |
|
||||
| `curl -s '127.0.0.1:9203/status/recovery-progress?volume=v1'` | `CounterProgressAt`, `LastProgress`, `Stalled`, `AwaitingAuthority`, `FenceBytes`, `ReplayRecords` |
|
||||
| `curl -s '127.0.0.1:9203/status/durable?volume=v1'` | `CheckpointPersistence` with the reclaim progress (`ReclaimedBytes`, `FlusherPhase`, `LastExtentWrite`) and the fence counters (`FenceZeroed`, `FenceSkips`) |
|
||||
| `curl -s '127.0.0.1:9203/status/peers?volume=v1'` | replication |
|
||||
|
||||
- **`CounterProgressAt`** is the time of the last completed WAL replay record or synced fence slice, and nothing else.
|
||||
**`LastProgress`** is the last progress of any recovery phase. An unchanged `CounterProgressAt` alone does not mean
|
||||
a stall.
|
||||
- **`/status/recovery`** exists only on a holder started with recovery enabled. On a standalone holder it answers 404.
|
||||
|
||||
**Logs:** `journalctl -u sw-blockmaster` and `journalctl -u sw-blockvolume@<volume>`
|
||||
([logs and verbosity](operator-guide.md#logs-and-verbosity)).
|
||||
|
||||
## 10. Typed errors and what to do
|
||||
|
||||
Volume status (`/status?volume=<id>`, heartbeats, cluster status):
|
||||
|
||||
| What you see | Meaning | What to do |
|
||||
|---|---|---|
|
||||
| `NotReadyReason: lease_not_held`, `MasterWait.Reason: unreachable` | The holder cannot reach blockmaster, so it has no lease and serves nothing. Until its lease expires (about 15-20 s after its last renewal) the old process still reports `Healthy: true`. Then it exits 75 and systemd restarts it 5 s later: the status page is gone for those seconds, the restarted process shows these fields, and the guest reconnects by itself. | Start or reach blockmaster. The volume serves again by itself. |
|
||||
| `RecoveryWait: awaiting_authority` (recovery-progress `AwaitingAuthority: true`) | Recovery finished, and the volume waits for blockmaster's assignment. The startup window is paused. | As above. |
|
||||
| `recovery_stalled` | No recovery step completed for a whole startup window. | Look for disk starvation (section 8). The volume serves no I/O and continues once the disk serves it. |
|
||||
| `binary_too_old` | The holder's binary reads an older format than the cluster's, so it gets no assignment. | Upgrade that host to v1.1 (section 7). |
|
||||
| `wal_corrupt` | The local WAL failed an integrity check. | Do not delete the store. Collect logs and status, and report it. |
|
||||
| `io_error` | A local I/O error latched the store. | Check the disk. Restart the volume once the disk is healthy. |
|
||||
| `store_format_newer`, `head_newer_version` (exit 78) | A later version wrote the store or HEAD. | Run the later version. The unit does not restart after a final exit. |
|
||||
|
||||
`sw-block` commands. The JSON answer carries a typed `code` or `reason`. `ops chunk` refusals exit 1 unless the row
|
||||
says otherwise.
|
||||
|
||||
| Code or reason | Seen from | Meaning | What to do |
|
||||
|---|---|---|---|
|
||||
| `FORMAT_HOSTS_TOO_OLD` (exit 2, `--json`) | finalize | A holder of a volume reports an older format. | Upgrade or move each host in `hosts`. |
|
||||
| `HOST_HOLDS_WORK` (exit 2, `--json`) | retire-host | The host still holds the volumes named. | Move or delete them first. |
|
||||
| `BINARY_TOO_OLD` | move preview | The move target runs an older binary. | Upgrade the target, or choose another. |
|
||||
| `SIZE_REQUIRES_FORMAT_LEVEL_1` (exit 78) | `ops volume create` | A volume above 256 GiB before the finalize. | Finalize (section 7), or use a smaller volume. (From the cluster spec, this is a blockmaster log line, section 3.) |
|
||||
| `deadline_exceeded` (retryable) | verify and others | The window or deadline passed: a verify pass stopped without progress. | Retry. If it repeats, look for a slow filer or a starved disk. |
|
||||
| `remote_unavailable` (retryable) | holder calls | The filer or master could not be reached. | Retry once it is reachable. |
|
||||
| `internal` | `ops chunk` commands with `--chunk-filer` | In v1.1.0, also what an unreachable filer gives (not yet typed `remote_unavailable`). `ops chunk verify` and `ops chunk snapshot-delete` instead answer `bad_request: ... needs exactly one filer ... connection refused` (exit 2) after 30-60 s. | Check the filer address and that the filer runs, then retry. |
|
||||
| `not_admitted` | restore | The target is not in the cluster spec. The printed cure (`--lifecycle-product-loop-interval`) does not apply to this setup. | Add the target without `size_bytes` and restart blockmaster (section 5). |
|
||||
| `not_admitted ... live until <time>` | volume-delete | The volume's lease horizon has not passed. | Repeat with the same request id after that time (section 6). |
|
||||
| `remote_full` | cuts, snapshots | The chunk store has no space. | Add capacity, then retry. |
|
||||
| `queue_full` | cuts, snapshots | Reclamation work must drain before another producer publishes. | Retry later. |
|
||||
| `format_level_below_head_version` | cuts, in the holder log | The holder still runs at the format level it attached at, from before the finalize. | Restart the holder (section 7). |
|
||||
| `no_progress` (retryable) | snapshot, snapshot-delete | Either (a) a snapshot stalled: retrying with the same request id settles it, which can take several minutes (for example right after a finalize, section 7); or (b) a snapshot delete is blocked by a restored volume that depends on the snapshot, and retrying does not help until that volume is deleted; or (c) `another transaction is open`: an earlier snapshot delete on the same volume waits for its cleaning pass, which can take up to `--chunk-maintenance-interval` (1 h). | (a) Keep retrying with the same id. (b) Delete the dependent volume first (section 6), or keep the snapshot. (c) Keep retrying with the same id; it settles after that pass. |
|
||||
| `outcome_unknown` | various | The request may or may not have taken effect. | See below. |
|
||||
| `snapshot_exists`, `snapshot_limit` | snapshot | The name is taken, or there are too many snapshots. | Use another name, or delete old snapshots. |
|
||||
| `snapshot_not_found` | restore | No snapshot has that name. (To see it, you need a target in the spec; there is no need to provoke it.) | Check `ops chunk snapshots`. |
|
||||
| `not_found` | snapshot-delete | No snapshot has that name. | Nothing to delete. |
|
||||
| `snapshot_deleting` | snapshot, restore | The snapshot is being deleted. | Wait for the delete. |
|
||||
| `target_exists` | restore | The target already exists: an entry with `size_bytes`, or another restore request's target. | Use a new target name (a deleted name is never created again). |
|
||||
| `volume_not_found` | volume-delete | No volume has that name. | Check the name. (A spec entry backed out before a restore, section 6.) |
|
||||
| `geometry_mismatch`, `not_chunk_volume`, `invalid_name` | restore, snapshot | The target or the name does not fit. | Correct the command. |
|
||||
| guests refusal (exit 2) | `volume stop` | A guest is still connected. | Unmount, disconnect (NVMe or iSCSI), and stop again (section 4). |
|
||||
| `exists with other settings` and `pass --replace` (exit 1) | `volume start` | The volume's settings file has other flags. | Use the same flags. To change them, stop the volume first (section 4), then start it with `--replace`. |
|
||||
|
||||
**After an unknown outcome.**
|
||||
|
||||
- **Commands with `--request-id`** (`ops chunk snapshot`, `snapshot-delete`, `restore`, `volume-delete`,
|
||||
`ops workspace move` with or without `--clean`, and `ops workspace force-move`): repeat the command with the same
|
||||
request id until it answers. The answer settles what happened. This can take several minutes.
|
||||
- **`ops chunk cut`** has no request id. Repeat the cut: a later cut gives a later durable point. It does not tell you
|
||||
whether the earlier cut committed; for that, check the volume's snapshots and its last cut in status.
|
||||
- **`volume stop`**: run the same `sudo /usr/local/bin/sw-block volume stop <volume>` again. The unit keeps running
|
||||
until a stop succeeds.
|
||||
|
||||
Exit codes differ per command, and each command's `--help` states them. Most commands use:
|
||||
|
||||
- **0** done;
|
||||
- **1** failed;
|
||||
- **2** usage or refused;
|
||||
- **75** transient (retry);
|
||||
- **78** final (do not retry).
|
||||
|
||||
## 11. Known limitations
|
||||
|
||||
As released in v1.1.0 ([release notes](https://github.com/seaweedfs/seaweed-block/releases/tag/v1.1.0)). A later
|
||||
v1.1.x may lift them:
|
||||
|
||||
- **Long manual cuts.** A manual cut whose upload runs longer than about five minutes ends `cut_aborted`. The chunks
|
||||
it uploaded are kept: repeat the cut, which reuses them, or give it a longer `--timeout`.
|
||||
- **Stopping right after a fill.** Stopping a large volume soon after it was filled can answer that the cut's outcome
|
||||
is unknown, with the unit left running. Run the same `sudo /usr/local/bin/sw-block volume stop` again.
|
||||
- **Cleaning near 1 TiB.** On volumes near 1 TiB, a cleaning pass may not finish.
|
||||
- **List pages after a volume delete.** The snapshot-delete list pages under the deleted volume's directory
|
||||
(`lists/`) may remain: up to about 21 MB per deleted snapshot of a fully written 1 TiB volume. Nothing reads them,
|
||||
so they are data-safe, and `verify --orphans` does not list them. Remove them as in section 6, step 5.
|
||||
- **CLI first.** The manual cut API changes in v1.1.1. Use the newest `sw-block` CLI, and upgrade it first
|
||||
(section 1).
|
||||
- **After the finalize**, restart each holder (section 7).
|
||||
- **Backing out an unused restore target** leaves its placement behind (section 6).
|
||||
- **`cluster.check` FAILs** that are not faults (section 9).
|
||||
|
||||
In every v1.1.x:
|
||||
|
||||
- **Volume size** is at most 1 TiB, and start time grows with size (section 3).
|
||||
- **The first restart right after a large fill** can take seconds longer than later restarts, while the kernel writes
|
||||
back the fill.
|
||||
- **One filer per chunk store.** It is a single point of availability for cuts, snapshots and moves.
|
||||
- **No guest freeze.** Snapshots are crash-consistent only.
|
||||
- **Shared I/O caps** can starve a volume or blockmaster (section 8).
|
||||
- **The finalize is one-way** (section 7).
|
||||
- **Unauthenticated chunk control endpoint.** Keep `--chunk-control-endpoint` on loopback.
|
||||
- **Cleaning is on by default.** Space returns only after the next maintenance pass and a SeaweedFS vacuum.
|
||||
|
||||
## 12. Remove everything
|
||||
|
||||
**Only for the dedicated single-host installation this manual built**: its own `seaweedfs` unit with data in
|
||||
`/data/weed`, and blockmaster and every volume on this one host. It deletes every volume's data, blockmaster's state
|
||||
and that SeaweedFS data, and nothing can be recovered. Do not use it on several hosts, or where SeaweedFS was
|
||||
already running before this manual (skip step 3's SeaweedFS lines then; that SeaweedFS and its data stay).
|
||||
|
||||
1. **Stop every volume** (each guest unmounted and disconnected first, section 4). Each stop must end with
|
||||
`recovery point in the object store: ...` or `nothing to cut or stop` (exit 0). If a stop refuses, fix the cause it
|
||||
names and run it again; do not go on. `disable` alone does not stop a running holder.
|
||||
|
||||
```sh
|
||||
sudo /usr/local/bin/sw-block volume stop v1 && sudo systemctl disable sw-blockvolume@v1
|
||||
# iSCSI guests: sudo iscsiadm -m node -T iqn.2026-12.io.seaweedfs:v1 -o delete
|
||||
```
|
||||
|
||||
2. **Stop blockmaster, and check that nothing of it runs.** The check must exit 0 and print `nothing runs`. If
|
||||
`systemctl` itself fails, or any unit is listed, do not go on:
|
||||
|
||||
```sh
|
||||
sudo systemctl disable --now sw-blockmaster
|
||||
units=$(systemctl list-units 'sw-blockvolume*' 'sw-blockmaster*' --state=active,activating,deactivating --no-legend) &&
|
||||
{ test -z "$units" && echo "nothing runs" || echo "still running: $units"; }
|
||||
```
|
||||
|
||||
3. **Remove sw-block.** The removal runs only after the same check succeeds in the same command. A failed query
|
||||
removes nothing:
|
||||
|
||||
```sh
|
||||
units=$(systemctl list-units 'sw-blockvolume*' 'sw-blockmaster*' --state=active,activating,deactivating --no-legend) &&
|
||||
test -z "$units" &&
|
||||
sudo rm -rf /var/lib/sw-block-volume /var/lib/sw-block-master /etc/sw-block &&
|
||||
sudo rm -f /etc/systemd/system/sw-blockmaster.service /etc/systemd/system/sw-blockvolume.service \
|
||||
/etc/systemd/system/sw-blockvolume@.service /etc/systemd/system/sw-blockvolume-ublk.service \
|
||||
/etc/tmpfiles.d/sw-block.conf /usr/local/bin/blockmaster /usr/local/bin/blockvolume /usr/local/bin/sw-block &&
|
||||
sudo systemctl daemon-reload && sudo userdel sw-block
|
||||
```
|
||||
|
||||
The SeaweedFS that section 0 created for this installation, and only that one:
|
||||
|
||||
```sh
|
||||
sudo systemctl disable --now seaweedfs &&
|
||||
state=$(systemctl show -p ActiveState --value seaweedfs) && test "$state" = inactive &&
|
||||
sudo rm -rf /data/weed && sudo rm -f /etc/systemd/system/seaweedfs.service /usr/local/bin/weed &&
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
## Appendix A. Build from source
|
||||
|
||||
Build in the clone from section 1, step 1. Use the Go version that `go.mod` names (`go 1.25` for v1.1.x): take the
|
||||
newest 1.25.x Linux archive from https://go.dev/dl/ and check its sha256 against the one that page lists.
|
||||
|
||||
```sh
|
||||
grep '^go ' go.mod # go 1.25
|
||||
GOVER=1.25.X # the newest 1.25 patch listed on https://go.dev/dl/
|
||||
curl -fsSLO https://go.dev/dl/go$GOVER.linux-amd64.tar.gz
|
||||
sha256sum go$GOVER.linux-amd64.tar.gz # must equal the sha256 shown on https://go.dev/dl/
|
||||
mkdir -p "$HOME/go$GOVER" && tar -C "$HOME/go$GOVER" -xzf go$GOVER.linux-amd64.tar.gz # leaves any other Go alone
|
||||
export PATH="$HOME/go$GOVER/go/bin:$PATH" # this Go first
|
||||
go version # must print go$GOVER
|
||||
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
|
||||
./blockvolume --version # revision=<the tag's commit>
|
||||
```
|
||||
|
||||
Then install them as in section 1, step 2.
|
||||
@@ -88,7 +88,7 @@ on a path v1.1 refuses or ships as a preview. v1.2 replaces them with progress w
|
||||
A move onto such a host is refused with the typed reason `BINARY_TOO_OLD` (`reason` in
|
||||
`sw-block ops workspace move --json` and `force-move --json`).
|
||||
- `finalize-format` answers with exit codes a script can rely on, and `--json` prints the same keys for every
|
||||
outcome (`result`, `reason`, `hosts`, `format_level`, `message`): **0** finalized or already finalized;
|
||||
outcome (`result`, `reason`, `hosts`, `listed`, `format_level`, `message`): **0** finalized or already finalized;
|
||||
**2** refused (`FORMAT_HOSTS_TOO_OLD`, each refused host in `hosts` with what it reported); **75** the master
|
||||
could not be reached, retry; **1** any other failure, a failed write of the format record included (the level
|
||||
is unchanged) and a usage error.
|
||||
|
||||
@@ -15,7 +15,8 @@ test, see [write test (scratch host only)](#write-test-scratch-host-only).
|
||||
|
||||
## Upgrade order
|
||||
|
||||
Upgrade `blockmaster` first, then `blockvolume`. Assignments and workspace
|
||||
Upgrade the `sw-block` CLI first: it works with holders of its own version and one older, not the reverse. Then
|
||||
upgrade `blockmaster`, then `blockvolume`. Assignments and workspace
|
||||
lease requests require the assigned server id. A new volume against an older
|
||||
pre-release master stays not serving until the master is upgraded; an older
|
||||
volume must also be upgraded to gain the assignment guard. Do not use endpoint
|
||||
|
||||
@@ -37,6 +37,9 @@ blockmaster answers no workspace query: start it with `--workspace-rpc=true` and
|
||||
|
||||
**What you see:** `FAIL master.lifecycle: lifecycle store unavailable`. The same check reports
|
||||
`workspace RPC disabled` when blockmaster runs without `--workspace-rpc`, which walstore-chunk volumes also need.
|
||||
In v1.1.0 this check also fails with `workspace move requires an existing RF1 volume` on a correct cluster-spec
|
||||
setup. That is not a fault, and the cure above does not apply: check the setup with `sw-block ops workspace show`
|
||||
(exit 0).
|
||||
|
||||
**Fix:** set `--lifecycle-store` and `--workspace-rpc` on blockmaster (see
|
||||
[standalone deployment](standalone-deployment.md#blockmaster-settings)) and restart it. The shipped unit makes only
|
||||
|
||||
Reference in new issue
Block a user