分类
devops

FoundationDB guide

FoundationDB guide

fdb.cluster 的格式是什么?

FoundationDB 的 cluster 配置文件(一般命名为 fdb.cluster)的格式是一个连接字符串,格式如下:

description:ID@IP:PORT,IP:PORT,...
  • description 是数据库的逻辑描述,包含字母、数字和下划线。
  • ID 是一个唯一的随机标识符,通常是8位的随机字符,用于区分不同集群。
  • IP:PORT 是协调服务器(coordination servers)的地址列表,多个服务器通过逗号分隔。协调服务器用于集群的协调和管理,通常建议奇数个,以保证容错和一致性。
fdbserver --listen-address 0.0.0.0:4500 --public-address 172.17.0.7:4500 --datadir /var/fdb/data --logdir /var/fdb/logs --locality-zoneid 7fd02c700b6a --locality-machineid 7fd02c700b6a --class unset
env |grep ^FDB
FDB_NETWORKING_MODE=container
FDB_PROCESS_CLASS=unset
FDB_PORT=4500
FDB_CLUSTER_FILE_CONTENTS=
FDB_COORDINATOR=
FDB_COORDINATOR_PORT=4500
FDB_CLUSTER_FILE=/var/fdb/fdb.cluster
fdbserver --help
FoundationDB 7.3 (v7.3.69)
Usage: fdbserver -p ADDRESS [OPTIONS]

  -p ADDRESS, --public-address ADDRESS
                 Public address, specified as `IP_ADDRESS:PORT' or `auto:PORT'.
  -l ADDRESS, --listen-address ADDRESS
                 Listen address, specified as `IP_ADDRESS:PORT' (defaults to
                 public address).
  -C CONNFILE, --cluster-file CONNFILE
                 The path of a file containing the connection string for the
                 FoundationDB cluster. The default is first the value of the
                 FDB_CLUSTER_FILE environment variable, then `./fdb.cluster',
                 then `/etc/foundationdb/fdb.cluster'.
  --seed-cluster-file SEEDCONNFILE
                 The path of a seed cluster file which will be used to connect
                 if the -C cluster file does not exist. If the server connects
                 successfully using the seed file, then it copies the file to
                 the -C file location.
  --seed-connection-string SEEDCONNSTRING
                 The path of a seed connection string which will be used to
                 connect if the -C cluster file does not exist. If the server
                 connects successfully using the seed string, then it copies the
                 string to the -C file location.
  --data-filesystem PATH
                 Turns on validation that all data files are written to a drive
                 mounted at the specified PATH. This checks that the device at
                 PATH is currently mounted and that any data files get written
                 to the same device.
  -d PATH, --datadir PATH
                 Store data files in the given folder (must be unique for each
                 fdbserver instance on a given machine).
  -L PATH, --logdir PATH
                 Store log files in the given folder (default is `.').
  --logsize SIZE
                 Roll over to a new log file after the current log file exceeds
                 SIZE bytes. The default value is 10MiB.
  --maxlogs SIZE, --maxlogssize SIZE
                 Delete the oldest log file when the total size of all log files
                 exceeds SIZE bytes. If set to 0, old log files will not be
                 deleted. The default value is 100MiB.
  --loggroup LOG_GROUP
                 Sets the LogGroup field with the specified value for all events
                 in the trace output (defaults to `default').
  --trace-format FORMAT
                 Select the format of the log files. xml (the default) and json
                 are supported.
  --tracer       TRACER
                 Select a tracer for transaction tracing. Currently disabled
                 (the default) and log_file are supported.
  -i ID, --machine-id ID
                 Machine and zone identifier key (up to 16 hex characters).
                 Defaults to a random value shared by all fdbserver processes on
                 this machine.
  -a ID, --datacenter-id ID
                 Data center identifier key (up to 16 hex characters).
  --locality-LOCALITYKEY LOCALITYVALUE
                 Define a locality key. LOCALITYKEY is case-insensitive though
                 LOCALITYVALUE is not.
  -m SIZE, --memory SIZE
                 Resident memory limit. The default value is 8GiB. When
                 specified without a unit, MiB is assumed.
  --memory-vsize SIZE
                 Virtual memory limit. The default value is unlimited. When
                 specified without a unit, MiB is assumed.
  -M SIZE, --storage-memory SIZE
                 Maximum amount of memory used for storage. The default value is
                 1GiB. When specified without a unit, MB is assumed.
  --cache-memory SIZE
                 The amount of memory to use for caching disk pages. The default
                 value is 2GiB. When specified without a unit, MiB is assumed.
  -c CLASS, --class CLASS
                 Machine class (valid options are storage, transaction,
                 resolution, grv_proxy, commit_proxy, master, test, unset,
                 stateless, log, router, and cluster_controller).
  --profiler-
                 Set an actor profiler option. Supported options are: collector
                 -- None or FluentD (FluentD requires collector_endpoint to be
                 set) collector_endpoint -- IP:PORT of the fluentd server
                 collector_protocol -- UDP or TCP (default is UDP)
  --tls-certificate-file CERTFILE
                 The path of a file containing the TLS certificate and CA
                 chain.
  --tls-ca-file CERTAUTHFILE
                 The path of a file containing the CA certificates chain.
  --tls-key-file KEYFILE
                 The path of a file containing the private key corresponding
                 to the TLS certificate.
  --tls-password PASSCODE
                 The passphrase of encrypted private key
  --tls-verify-peers CONSTRAINTS
                 The constraints by which to validate TLS peers. The contents
                 and format of CONSTRAINTS are plugin-specific.
  -v, --version
                 Print version information and exit.
  -h, -?, --help
                 Display this help and exit.
  --dev-help
                 Display developer-specific help and exit.

SIZE parameters may use one of the multiplicative suffixes B=1, KB=10^3,
KiB=2^10, MB=10^6, MiB=2^20, GB=10^9, GiB=2^30, TB=10^12, or TiB=2^40.
bash-5.1# fdbcli --help
FoundationDB CLI 7.4 (v7.4.3)
usage: fdbcli [OPTIONS]

  -C CONNFILE    The path of a file containing the connection string for the
                 FoundationDB cluster. The default is first the value of the
                 FDB_CLUSTER_FILE environment variable, then `./fdb.cluster',
                 then `/etc/foundationdb/fdb.cluster'.
  --log          Enables trace file logging for the CLI session.
  --log-dir PATH Specifies the output directory for trace files. If
                 unspecified, defaults to the current directory. Has
                 no effect unless --log is specified.
  --log-group LOG_GROUP
                 Sets the LogGroup field with the specified value for all
                 events in the trace output (defaults to `default').
  --trace-format FORMAT
                 Select the format of the log files. xml (the default) and json
                 are supported. Has no effect unless --log is specified.
  --exec CMDS    Immediately executes the semicolon separated CLI commands
                 and then exits.
  --no-status    Disables the initial status check done when starting
                 the CLI.
  --api-version  APIVERSION
                 Specifies the version of the API for the CLI to use.
  --tls-certificate-file CERTFILE
                 The path of a file containing the TLS certificate and CA
                 chain.
  --tls-ca-file CERTAUTHFILE
                 The path of a file containing the CA certificates chain.
  --tls-key-file KEYFILE
                 The path of a file containing the private key corresponding
                 to the TLS certificate.
  --tls-password PASSCODE
                 The passphrase of encrypted private key
  --tls-verify-peers CONSTRAINTS
                 The constraints by which to validate TLS peers. The contents
                 and format of CONSTRAINTS are plugin-specific.
  --tls-disable-plaintext-connection
                 Disable non-TLS connections. All plaintext connection attempts will timeout.
  --knob-KNOBNAME KNOBVALUE
                 Changes a knob option. KNOBNAME should be lowercase.
  --debug-tls    Prints the TLS configuration and certificate chain, then exits.
                 Useful in reporting and diagnosing TLS issues.
  --build-flags  Print build information and exit.
  --memory       Resident memory limit of the CLI (defaults to 8GiB).
  --use-future-protocol-version
                 Use the simulated future protocol version to connect to the cluster.
                 This option can be used testing purposes only!
  -v, --version  Print FoundationDB CLI version information and exit.
  -h, --help     Display this help and exit.
configure new triple ssd

bash-5.1# fdbcli --exec "status details"
Using cluster file `/var/fdb/fdb.cluster'.

Configuration:
  Redundancy mode        - triple
  Storage engine         - ssd-2
  Log engine             - ssd-2
  Encryption at-rest     - disabled
  Coordinators           - 3
  Usable Regions         - 1

Cluster:
  FoundationDB processes - 6
  Zones                  - 6
  Machines               - 6
  Memory availability    - 8.0 GB per process on machine with least available
  Fault Tolerance        - 1 machines
  Server time            - 08/28/25 06:58:38

Data:
  Replication health     - Healthy
  Moving data            - 0.000 GB
  Sum of key-value sizes - 0 MB
  Disk space used        - 944 MB

Operating space:
  Storage server         - 1074.4 GB free on most full server
  Log server             - 1074.4 GB free on most full server

Workload:
  Read rate              - 9 Hz
  Write rate             - 0 Hz
  Transactions started   - 4 Hz
  Transactions committed - 0 Hz
  Conflict rate          - 0 Hz

Backup and DR:
  Running backups        - 0
  Running DRs            - 0

Process performance details:
  172.224.0.2:4500       (  1% cpu; 29% machine; 0.000 Gbps;  5% disk IO; 0.1 GB / 8.0 GB RAM  )
  172.224.0.3:4500       (  1% cpu; 29% machine; 0.000 Gbps;  6% disk IO; 0.1 GB / 8.0 GB RAM  )
  172.224.0.4:4500       (  3% cpu; 29% machine; 0.000 Gbps;  6% disk IO; 0.1 GB / 8.0 GB RAM  )
  172.224.0.5:4500       (  1% cpu; 27% machine; 0.000 Gbps;  4% disk IO; 0.1 GB / 8.0 GB RAM  )
  172.224.0.6:4500       (  1% cpu; 26% machine; 0.000 Gbps;  4% disk IO; 0.1 GB / 8.0 GB RAM  )
  172.224.0.7:4500       (  2% cpu; 27% machine; 0.000 Gbps;  4% disk IO; 0.1 GB / 8.0 GB RAM  )

Coordination servers:
  fdb-coord1:4500  (reachable)
  fdb-coord2:4500  (reachable)
  fdb-coord3:4500  (reachable)

Client time: 08/28/25 06:58:38