Migrate Data to Another Disk
High disk load may lead to delays in event arrivals. In severe cases, it might result in complete inoperability of FindFace CIBR. One of the means for reducing the disk load is to migrate the FindFace CIBR data storages to another disk.
In this section:
Prepare Disk
To prepare a disk for the data migration, do the following:
Create a new mount point (
/mnt/ffdata
in our example).sudo mkdir /mnt/ffdata
Create a partition.
sudo parted /dev/sdb mklabel gpt mkpart primary ext4 1MiB 100% q sudo mkfs.ext4 /dev/sdb1
Learn the UUID of the partition (
sdb1
in our example).sudo blkid | grep sdb1 /dev/sdb1: LABEL="data" UUID="0638ebe0-853e-43ea-8f35-bfae305695d1" TYPE="ext4" PARTUUID="8cebaacc-77d7-4757-b4c6-14147e92646c"
Add the partition to fstab to make it automatically mount on booting.
sudo vi /etc/fstab ------------ #DATA mount UUID=0638ebe0-853e-43ea-8f35-bfae305695d1 /mnt/ffdata/ ext4 auto,user,rw 0 2 -------------
Mount all the filesystems.
sudo mount -a
Migrate Photo Storage
To migrate the FindFace CIBR photo storage, do the following:
Inside the mount point, create a directory to store photos.
sudo mkdir /mnt/ffdata/ffupload -p
Mount the created directory (
/mnt/ffdata/ffupload
in the example) into thefindface-cibr-findface-upload-1
container. To do so, open the/opt/findface-cibr/docker-compose.yaml
configuration file and list it in the volumes of thefindface-upload
section instead of the default/opt/findface-cibr/data/findface-upload
directory.sudo vi /opt/findface-cibr/docker-compose.yaml findface-upload: ... volumes: ['./configs/findface-upload/40-ffupload.sh:/docker-entrypoint.d/40-ffupload.sh:ro', '/mnt/ffdata/ffupload:/var/lib/ffupload']
Rebuild all FindFace CIBR containers.
cd /opt/findface-cibr sudo docker-compose down sudo docker-compose up -d
Migrate Main Database (PostgreSQL)
To migrate the PostgreSQL database, do the following:
Inside the mount point, create a directory to store the PostgreSQL data.
sudo mkdir /mnt/ffdata/postgresql -p
Mount the created directory (
/mnt/ffdata/postgresql
in the example) into thefindface-cibr-postgresql-1
container. To do so, open the/opt/findface-cibr/docker-compose.yaml
configuration file and list it in the volumes of thepostgresql
section instead of the default/opt/findface-cibr/data/postgresql
directory.sudo vi /opt/findface-cibr/docker-compose.yaml postgresql: ... volumes: ['./configs/postgresql/40-init.sql:/docker-entrypoint-initdb.d/40-init.sql:ro', '/mnt/ffdata/postgresql:/bitnami/postgresql/data']
Rebuild all FindFace CIBR containers.
cd /opt/findface-cibr sudo docker-compose down sudo docker-compose up -d