FoundationDB
Containerized Deployment of a Multi-Node FoundationDB Cluster and Operations
· ☕ 5 min read
1. Generate a Cluster ID 1 cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1 The examples below use CLUSTER_ID=fKbIga9RHP79OIx1. 2. On the First Node Configure environment variables 1 2 3 4 5 6 7 8 9 10 export CONTAINER_CLI=nerdctl export IMAGE=foundationdb/foundationdb:7.1.26 export CLUSTER_ID=fKbIga9RHP79OIx1 export FDB_INSTANCE_NAME=fdb_server export FDB_CLUSTER_FIRST_IP=$(hostname -I | awk '{print $1}') export FDB_PUBLIC_IP=$(hostname -I | awk '{print $1}') export FDB_PORT=4500 export FDB_DIR=/data/ops/fdb/$FDB_INSTANCE_NAME Clean up old data 1 2 3 $CONTAINER_CLI rm -f $FDB_INSTANCE_NAME mv $FDB_DIR $FDB_DIR.

FoundationDB Data Backup and Restore
· ☕ 2 min read
1. Set Environment Variables Set the foundationdb cluster name and version 1 2 3 4 5 export CLUSTER_NAME= export NAMESPACE= export DEPLOY_NAME=${CLUSTER_NAME}-deployment export SECRET_NAME=fdb-backup-secret export VERSION=7.1.26 Set the S3 backup bucket and credentials 1 2 3 4 5 export BUCKET= export HOST=s3.us-west-2.amazonaws.com export AK=x export SK=x export S3_BACKUP_URI="blobstore://${AK}:${SK}@${HOST}/fdb-backup?bucket=${BUCKET}&sc=0" 2. Create the Credentials 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Secret metadata: name: ${SECRET_NAME} namespace: ${NAMESPACE} type: Opaque stringData: credentials: | { "accounts": { "${BUCKET}@${HOST}": { "access_key": "${AK}", "secret": "${SK}", "endpoint": "${HOST}" } } } EOF 3.