Skip to content

Setup and Configuration

The metadata server binary (meta.flexfs) is included in the flexFS installation. It is typically deployed via the admin server’s deploy endpoint or the manage.flexfs tool.

The metadata server requires credentials to authenticate with the admin server and (optionally) access block storage. Initialize them before starting:

Terminal window
meta.flexfs init creds \
--adminAddr admin.example.com:443 \
--token $TOKEN \
--blockUser $USERNAME \
--blockPass $PASSWORD

If --token is omitted, the command prompts interactively. This writes a TOML credentials file to the default location (~/.flexfs/meta/creds):

adminAddr = "admin.example.com:443"
blockPass = "$PASSWORD"
blockUser = "$USERNAME"
token = "$TOKEN"

init creds flags:

FlagTypeDefaultDescription
--adminAddrstring(required)Admin server address (host:port)
--blockPassstring(empty)Block storage password / secret key
--blockUserstring(empty)Block storage username / access key ID
--forceboolfalseOverwrite an existing credentials file
--tokenstring(prompts)Metadata server authentication token (UUID)
Terminal window
sudo meta.flexfs init systemd --now

This creates and enables a systemd unit at /etc/systemd/system/flexfs-meta.service and optionally starts it immediately. The metadata service unit includes a 1-second startup delay (ExecStartPre=/bin/sleep 1) to allow dependent services to initialize.

To pass additional flags:

Terminal window
sudo meta.flexfs init systemd --now \
--startFlags "--dbFolder /data/meta-db"

init systemd flags:

FlagTypeDefaultDescription
--forceboolfalseOverwrite an existing systemd unit file
--nowboolfalseStart the service immediately after enabling
--startFlagsstring(empty)Additional flags passed to meta.flexfs start

The meta.flexfs start command accepts the following flags:

FlagTypeDefaultDescription
--bindAddrstring0.0.0.0:443Address and port to bind the server
--dbFolderstring~/.flexfs/meta/dataPath to the metadata database folder
--noSSLboolfalseDisable TLS for the REST API and RPC
--sslCertstring~/.flexfs/ssl/certPath to the TLS certificate file
--sslKeystring~/.flexfs/ssl/keyPath to the TLS private key file
--syncboolfalseFsync every write for full crash durability
--verbose / -vboolfalseEnable verbose logging
FlagTypeDefaultDescription
--adminAddrstring(from creds)Admin server address (overrides credentials file)
--blockPassstring(from creds)Block storage password (overrides credentials file)
--blockUserstring(from creds)Block storage username (overrides credentials file)
--dbMemCapacitystring40%Memory allocated to the database cache (e.g. 5%, 64M, 4G)
--fallbackstring(empty)Fallback RPC protocol version for older mount clients (e.g. v1.4)
--noAdminSSLboolfalseDisable TLS for connections to the admin server
--pprofboolfalseEnable the Go pprof profiler
--pprofPortint6062Pprof server port
--sizeBinsboolfalseGroup volume size statistics into access-time bins
--tokenstring(from creds)Metadata server auth token (overrides credentials file)
SubcommandDescription
migrateMigrate the metadata database to a new format
verifyVerify the integrity of the metadata database

By default, the metadata server auto-generates a self-signed TLS certificate if none exists at the configured paths. To use custom certificates:

Terminal window
meta.flexfs start \
--sslCert /etc/ssl/meta.crt \
--sslKey /etc/ssl/meta.key

After starting, the metadata server logs its configuration:

meta.flexfs | v1.9.0
--------------------------------------------------------------------------------
adminAddr | admin.example.com:443
bindAddr | 0.0.0.0:443
credsFile | ~/.flexfs/meta/creds
dbFolder | ~/.flexfs/meta/data
sslCert | ~/.flexfs/ssl/cert
sslKey | ~/.flexfs/ssl/key
--------------------------------------------------------------------------------
Binding to 0.0.0.0:443 (encrypted)