Command line¶
Every command takes --data-dir PATH, the directory holding the store, data by default. leblob --help lists the commands, leblob COMMAND --help describes one, and leblob --version prints the version.
| Command | What it does |
|---|---|
serve |
Run the S3 server |
key |
Manage access keys |
volume |
Manage the disks blobs are stored on |
backup |
Copy the metadata to a new file, while the server may be running |
restore |
Put a backup in place of lost metadata |
fsck |
Compare the metadata with the disk |
scrub |
Check every copy against its MD5 now |
serve¶
Runs the S3 server. It creates the store if the directory holds none, and on the first start creates an access key and prints it once.
| Option | Default | Meaning |
|---|---|---|
--data-dir PATH |
data |
Directory holding all stored data |
--host STR |
127.0.0.1 |
Address to listen on |
--port INT |
9000 |
Port to listen on |
--workers INT |
number of CPUs, 4 at most | Number of worker processes. Each takes about 30 MiB. Writes wait on the disk and gain nothing from more; reads do |
--domain STR |
none | Base domain enabling virtual-hosted addressing (bucket.domain) |
--ssl-certfile PATH |
none | TLS certificate, to serve HTTPS directly |
--ssl-keyfile PATH |
none | TLS private key |
--shutdown-grace INT |
20 |
Seconds to let requests finish on shutdown. Without a limit, one client that stops reading would prevent the server from ever exiting |
--lifecycle-day-seconds INT |
86400 |
How long a day lasts for lifecycle rules. For tests, which can't wait for one |
--allow-sse-c-over-http / --no-allow-sse-c-over-http |
off | Accept encryption keys over plain HTTP. Only behind a proxy that terminates TLS, or for tests: otherwise the key can be read off the network |
key¶
Manages access keys. A key has full access unless created as scoped. A scoped key has no rights until granted some, per bucket. See Access keys.
key create¶
Creates an access key and prints it. The secret isn't shown again.
| Option | Default | Meaning |
|---|---|---|
--scoped / --no-scoped |
off | Give the key no rights until key grant gives it some, instead of full access |
key list¶
Lists access keys and what each may do.
key delete¶
Deletes an access key.
key grant¶
Gives a scoped key a level on a bucket, replacing any it had. LEVEL is read, write (which includes read) or admin (which includes write).
key revoke¶
Removes what a scoped key was granted on a bucket.
volume¶
Manages the disks blobs are stored on. A running server follows each change within a couple of minutes. See Disks and copies.
volume list¶
Lists volumes, with how full each is and any that can't be used.
volume add¶
Adds a volume for new blobs. PATH is an existing empty directory, usually the mount point of a disk. With one copy of each blob, losing a volume loses the objects with blobs on it: see volume copies.
volume copies¶
Sets how many volumes hold each blob, at most the number of volumes. A running server adds the missing copies of blobs already stored, and leaves extra ones in place. Each copy needs its own disk to protect against losing one.
volume drain¶
Stops using a volume, and has a running server move its blobs elsewhere. volume list shows when it is empty, and volume forget then removes it.
volume forget¶
Removes a volume that is empty, or whose disk is gone for good.
| Option | Default | Meaning |
|---|---|---|
--disk-lost / --no-disk-lost |
off | The disk is gone: forget the copies on it, for a running server to replace |
--accept-loss / --no-accept-loss |
off | Go ahead even though some blobs have no other copy, losing their objects |
backup¶
Copies the metadata to a new file, while the server may be running. DESTINATION is the file to create; put it on another disk. The file holds the access keys' secrets. Without it, losing the metadata loses every object, because blob files have random names. It doesn't hold the blobs. See Backup and restore.
restore¶
Puts a backup made by leblob backup in place of lost metadata. Stop the server first. Objects written since the backup are lost. Their files become orphans. Blobs collected since then are missing, which can only happen once the backup is older than the collector's grace period, an hour. fsck reports both.
fsck¶
Compares the metadata with the disk, and exits non-zero if they disagree.
| Option | Default | Meaning |
|---|---|---|
--delete-orphans / --no-delete-orphans |
off | Remove blob files that have no metadata and are over a day old |
scrub¶
Checks every copy against its MD5 now, at full speed. A running server does this slowly anyway. A bad copy is removed, and a running server replaces it. Exits non-zero if a blob's only copy is bad.