Network-attached Storage or Local Storage

Prev Next

Network-attached storage or local storage setup

The location of the file store should be specified in the ".env" file:

FORMS_STORAGE_MODE=<FILE OR FILE_EX OR FILE_LEGACY>
HS_PATH=/mnt/hs/

In order for the media storage to be visible across the cluster, ${HS_PATH}/media should be a network storage mount (and not a local folder).

Value of FORMS_STORAGE_MODE

In v36.0.6+ and v37 and later, file stores have a six-level directory structure. This structure minimizes the number of files in each directory, allowing for faster data retrieval and improving performance in high-volume instances.

The value of FORMS_STORAGE_MODE depends on the version of Hyperscience you're running:

  • v36.0.6 + or v37 or later: FILE_EX

  • v36.0.5 or earlier: FILE

If you are upgrading to v36.0.6+ or v37 or later, your file store will use the optimized directory structure by default. If you want to continue using the older directory structure, set FORMS_STORAGE_MODE to FILE_LEGACY.

Samba/CIFS share

If you are using a Samba/CIFS mount, in the mount options, specify for the mounted network share to use user 1000 and group ID 1000 (i.e., uid=1000, gid=1000).

SELinux verification

To check if you are running SELinux on your RHEL machine run, the following command:

sudo sestatus
# Sample Output
# SELinux status:     enabled / disabled
# Current mode:       enforcing / permissive

SELinux operates on the principle of default denial: anything not explicitly allowed is denied. When enabled, SELinux can operate in two global modes:

  • Permissive mode, in which permission denials are logged but not enforced.

  • Enforcing mode, in which permission denials are both logged and enforced.

If SELinux is enabled in permissive mode or disabled, no further action is needed.

If SELinux is enabled in enforcing mode, you also need to give your application containers access to the media directory.

When SELinux is enabled in enforcing mode, you need to configure an additional setting to allow access from within a Docker container. The configuration depends on the type of networked file store you are using.

  • For an NFS share:

    • setsebool -P virt_use_nfs 1
  • For a CIFS share:

    • setsebool -P virt_use_samba 1

In addition, when SELinux is enabled in enforcing mode, you need to add the following exception:

chcon -t container_file_t /mnt/hs/media