Connecting a new partition for storing records
Overview
Storage of large volumes of records should be organized on external file storages, connecting them to the platform via S3 or NFS.
This article will show you what you can do if you have not configured write storage allocation in a particular way and write to local disks in the cluster and you need to increase storage or change the server partition.
Change the write path on the server (new extended section).
Starting point:
-
Incoplax stores records locally (not in the S3).
-
Incoplax writes inside the container to the filesystem directory /var/lib/era_files/recpath (default in the config, or different).
-
In the container, the internal file system directory /var/lib/era_files/recpath (default at installation, or different) is connected as a volumetric directory to the folder specified at installation (default is /opt/era/era_recpath).
-
A new disk/partition is attached to the server, mounted to some system directory (for example, /mnt/storageN).
Required to be run on each server, or on those that may host record files and where new partitions are connected. |
The right way
Use procedure to update the container. That is, reinstall the container with the distribution, connecting it during the installation to the existing (the same as in the initial installation) postgresql master-domain database, with the same installation parameters as before, only specifying a new directory for the recpath volum: for example, instead of /opt/era/era_recpath specify /mnt/storageN.
Shortcut
Does not require reinstalling the container, but does require restarting the container at a convenient time. Symlink is used (optionally mount can be used with bind).
Step 1: In the host, the /opt/era/era_recpath folder (default, otherwise specified during installation) should be moved to /opt/era/era/era_recpath.old. The current container will continue to work with it due to the inode binding during the previous container startup.
mv /opt/era/era_recpath /opt/era/era_recpath.old
Step 2 Create a new folder with the same name:
mkdir -p /mnt/storage/era/recpath
Step 3. Create a symlink to the folder where the newly mounted disk/partition is mounted:
ln -s /mnt/storage/era/recpath /opt/era/era_recpath
Step 4. copy to the folder rshare.sign (signal for the service to correctly place the path for records)
cp /opt/era/era_recpath.old/rshare.sign /opt/era/era_recpath
Step 5. At the appropriate time, restart the containers, or the entire system via the web interface, so that the newly started containers switch to the new folder on the link.
docker restart era
Step 6. Transfer files and accesses to them from /opt/era/era_recpath.old to /opt/era/era/era_recpath (or identically to /opt/era/era_recpath) if necessary /mnt/storage/era/recpath).
mv -r /opt/era/era_recpath.old/domains /opt/era/era_recpath
If you plan to use several different mounted disks/partitions to store records, you can use a single folder /opt/era/era_recpath, within which you can have subfolders (subsections), each of which is a symlink to the directory where a separate disk/partition is mounted. In the configuration you should add aliases to the corresponding paths, e.g. instead of /var/lib/era_files/recpath use /var/lib/era_files/recpath/volN, and for each of them add in the server configuration parameter recstorepaths. |