You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
158 lines
5.0 KiB
158 lines
5.0 KiB
version: '3.9'
|
|
|
|
services:
|
|
# FoundationDB cluster nodes
|
|
fdb1:
|
|
image: foundationdb/foundationdb:7.1.61
|
|
platform: linux/amd64
|
|
environment:
|
|
- FDB_NETWORKING_MODE=host
|
|
- FDB_COORDINATOR_PORT=4500
|
|
- FDB_PORT=4501
|
|
ports:
|
|
- "4500:4500"
|
|
- "4501:4501"
|
|
volumes:
|
|
- fdb1_data:/var/fdb/data
|
|
- fdb_config:/var/fdb/config
|
|
networks:
|
|
- fdb_network
|
|
command: |
|
|
bash -c "
|
|
# Initialize cluster configuration
|
|
if [ ! -f /var/fdb/config/fdb.cluster ]; then
|
|
echo 'testing:testing@fdb1:4500,fdb2:4500,fdb3:4500' > /var/fdb/config/fdb.cluster
|
|
fi
|
|
# Start FDB processes
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb1:4501 --listen_address=0.0.0.0:4501 --coordination=fdb1:4500 &
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb1:4500 --listen_address=0.0.0.0:4500 --coordination=fdb1:4500 --class=coordination &
|
|
wait
|
|
"
|
|
|
|
fdb2:
|
|
image: foundationdb/foundationdb:7.1.61
|
|
platform: linux/amd64
|
|
environment:
|
|
- FDB_NETWORKING_MODE=host
|
|
- FDB_COORDINATOR_PORT=4502
|
|
- FDB_PORT=4503
|
|
ports:
|
|
- "4502:4502"
|
|
- "4503:4503"
|
|
volumes:
|
|
- fdb2_data:/var/fdb/data
|
|
- fdb_config:/var/fdb/config
|
|
networks:
|
|
- fdb_network
|
|
depends_on:
|
|
- fdb1
|
|
command: |
|
|
bash -c "
|
|
# Wait for cluster file from fdb1
|
|
while [ ! -f /var/fdb/config/fdb.cluster ]; do sleep 1; done
|
|
# Start FDB processes
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb2:4503 --listen_address=0.0.0.0:4503 --coordination=fdb1:4500 &
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb2:4502 --listen_address=0.0.0.0:4502 --coordination=fdb1:4500 --class=coordination &
|
|
wait
|
|
"
|
|
|
|
fdb3:
|
|
image: foundationdb/foundationdb:7.1.61
|
|
platform: linux/amd64
|
|
environment:
|
|
- FDB_NETWORKING_MODE=host
|
|
- FDB_COORDINATOR_PORT=4504
|
|
- FDB_PORT=4505
|
|
ports:
|
|
- "4504:4504"
|
|
- "4505:4505"
|
|
volumes:
|
|
- fdb3_data:/var/fdb/data
|
|
- fdb_config:/var/fdb/config
|
|
networks:
|
|
- fdb_network
|
|
depends_on:
|
|
- fdb1
|
|
command: |
|
|
bash -c "
|
|
# Wait for cluster file from fdb1
|
|
while [ ! -f /var/fdb/config/fdb.cluster ]; do sleep 1; done
|
|
# Start FDB processes
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb3:4505 --listen_address=0.0.0.0:4505 --coordination=fdb1:4500 &
|
|
/usr/bin/fdbserver --config_path=/var/fdb/config --datadir=/var/fdb/data --logdir=/var/fdb/logs --public_address=fdb3:4504 --listen_address=0.0.0.0:4504 --coordination=fdb1:4500 --class=coordination &
|
|
wait
|
|
"
|
|
|
|
# Initialize and configure the database
|
|
fdb-init:
|
|
image: foundationdb/foundationdb:7.1.61
|
|
platform: linux/amd64
|
|
volumes:
|
|
- fdb_config:/var/fdb/config
|
|
networks:
|
|
- fdb_network
|
|
depends_on:
|
|
- fdb1
|
|
- fdb2
|
|
- fdb3
|
|
command: |
|
|
bash -c "
|
|
# Wait for cluster file
|
|
while [ ! -f /var/fdb/config/fdb.cluster ]; do sleep 1; done
|
|
|
|
# Wait for cluster to be ready
|
|
sleep 10
|
|
|
|
# Configure database
|
|
echo 'Initializing FoundationDB database...'
|
|
fdbcli --exec 'configure new single ssd'
|
|
|
|
# Wait for configuration to complete
|
|
sleep 5
|
|
|
|
# Verify cluster status
|
|
fdbcli --exec 'status'
|
|
|
|
echo 'FoundationDB cluster initialization complete!'
|
|
|
|
# Keep container running for debugging if needed
|
|
tail -f /dev/null
|
|
"
|
|
|
|
# SeaweedFS service with FoundationDB filer
|
|
seaweedfs:
|
|
image: chrislusf/seaweedfs:local
|
|
ports:
|
|
- "9333:9333"
|
|
- "19333:19333"
|
|
- "8888:8888"
|
|
- "8333:8333"
|
|
- "18888:18888"
|
|
command: "server -ip=seaweedfs -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
|
|
volumes:
|
|
- ./s3.json:/etc/seaweedfs/s3.json
|
|
- ./filer.toml:/etc/seaweedfs/filer.toml
|
|
- fdb_config:/var/fdb/config
|
|
environment:
|
|
WEED_LEVELDB2_ENABLED: "false"
|
|
WEED_FOUNDATIONDB_ENABLED: "true"
|
|
WEED_FOUNDATIONDB_CLUSTER_FILE: "/var/fdb/config/fdb.cluster"
|
|
WEED_FOUNDATIONDB_API_VERSION: "720"
|
|
WEED_FOUNDATIONDB_TIMEOUT: "5s"
|
|
WEED_FOUNDATIONDB_MAX_RETRY_DELAY: "1s"
|
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 1
|
|
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
|
|
networks:
|
|
- fdb_network
|
|
depends_on:
|
|
- fdb-init
|
|
|
|
volumes:
|
|
fdb1_data:
|
|
fdb2_data:
|
|
fdb3_data:
|
|
fdb_config:
|
|
|
|
networks:
|
|
fdb_network:
|
|
driver: bridge
|