Set Up NFS Shared Storage
When you upload files to the Moogsoft Onprem UI, it writes them to the disk on the UI Server. For example, Situation Room thread entry attachments and User Profile Pictures.
In an HA configuration running multiple UI roles, the files reside on the disk for the UI server where the user is connected. To ensure attachments are available to users on any UI servers as part of an HA/Load Balancer setup, configure the location of these attachments on a shared disk (NFS) available to all UI servers.
The following example below demonstrates a sample configuration consisting of three servers - NFS_SERVER, Server1, and Server2
The configuration below assume that /mnt/nfs/shared is the shared location exposed by the NFS Server called NFS_SERVER
Ensure that the moogsoft:moogsoft user/group has the same uid/gid combination across all 3 servers and has ownership of the shared directory.
Choose a server to be the source of the user and group id values and record them using these commands (referenced by <USER_ID> and <GROUP_ID> later in this document):
echo "USER ID FOR MOOGSOFT IS: $(id -u moogsoft)" echo "GROUP ID FOR MOOGSOFT IS: $(id -g moogsoft)"
NFS Server
Run the following commands, replacing <Server1> and <Server2> with the hostnames of the servers and <USER_ID> and <GROUP_ID> with the values returned above
service apache-tomcat stop
service moogfarmd stop
service opensearch stop
find / -user moogsoft -group moogsoft -exec chown <USER_ID>:<GROUP_ID> {} + 2>/dev/null
usermod -u <USER_ID> moogsoft
groupmod -g <GROUP_ID> moogsoft
mkdir /shared
chown moogsoft:moogsoft /shared/
chmod 755 /shared/
yum install -y nfs-utils
systemctl enable nfs-server --now
Edit /etc/exports and set: /shared <Server1>(rw,sync,no_subtree_check,insecure) <Server2>(rw,sync,no_subtree_check,insecure)
Then run: exportfs -a
Restart services:
service rpcbind start service nfs-server start service apache-tomcat start service moogfarmd start service opensearch start
Server 1
Run the following commands to configure Server 1, replacing <USER_ID> and <GROUP_ID> with the values returned above:
service apache-tomcat stop
service moogfarmd stop
service opensearch stop
find / -user moogsoft -group moogsoft -exec chown <USER_ID>:<GROUP_ID> {} + 2>/dev/null
usermod -u <USER_ID> moogsoft
groupmod -g <GROUP_ID> moogsoft
yum install -y nfs-utils
mkdir -p /mnt/nfs/shared
mount <NFS_SERVER>:/shared /mnt/nfs/shared
echo "<NFS Server>:/shared /mnt/nfs/shared nfs defaults,_netdev 0 0" >> /etc/fstab
Edit $MOOGSOFT_HOME/config/servlets.conf and set cache_root: "/mnt/nfs/shared",
Restart services:
service apache-tomcat start service moogfarmd start service opensearch start
Server 2
Run the following commands to configure Server 2, replacing <USER_ID> and <GROUP_ID> with the values returned above:
service apache-tomcat stop
service moogfarmd stop
service opensearch stop
find / -user moogsoft -group moogsoft -exec chown <USER_ID>:<GROUP_ID> {} + 2>/dev/null
usermod -u <USER_ID> moogsoft
groupmod -g <GROUP_ID> moogsoft
yum install -y nfs-utils
mkdir -p /mnt/nfs/shared
mount <NFS_SERVER>:/shared /mnt/nfs/shared
echo "<NFS Server>:/shared /mnt/nfs/shared nfs defaults,_netdev 0 0" >> /etc/fstab
Edit $MOOGSOFT_HOME/config/servlets.conf and set cache_root: "/mnt/nfs/shared",
Restart services:
service apache-tomcat start service moogfarmd start service opensearch start