Sharing the Harmony Database Files Using NFS on GNU/Linux
Once you have a database file structure and the Harmony database server daemon, you can access the database from the machine on which it was created. To allow other client machines on your network to access the database, you must share its folders using NFS.
If the GNU/Linux firewall is enabled, you must add rules to allow remote connections to the NFS server so as to allow other machines to connect to the NFS shares.
-
Make sure the NFS service and its utilities are installed:
$ sudo yum install nfs-utils
-
Enable and start the rpcbind daemon, the NFS daemon, the NFS lock daemon:
$ sudo chkconfig rpcbind on
$ sudo service rpcbind start
$ sudo chkconfig nfs on
$ sudo service nfs start
$ sudo chkconfig nfslock on
$ sudo service nfslock start
-
Then, open the configuration file /etc/exports in vi to add your database's share directories:
$ sudo vi /etc/exports
-
Add the following line to allow clients to access the database files:
/USA_DB *(rw,sync)
-
If your database server also has a scene data storage space, add a line with a similar syntax to share it. For example, if the scene data storage space is named /usadata000, add the following line:
/usadata000 *(rw,sync)
- Save and exit.
-
Run the export command to update the NFS daemon with the new configuration:
$ sudo exportfs -r
-
Type this command to verify that the new configuration is in effect:
$ showmount --exports
The utility will list all the directories currently shared through NFS.
-
Open the NFS configuration file in a text editor:
$ sudo vi /etc/sysconfig/nfs
- In the NFS configuration file, remove the hash # sign before the lines with the following content, so as to uncomment them. This will make sure the NFS service always uses the same ports, and hence, will allow us to safely open those ports in the firewall:
- RQUOTAD_PORT=875
- LOCKD_TCPPORT=32803
- LOCKD_UDPPORT=32769
- MOUNTD_PORT=892
- STATD_PORT=662
- STATD_OUTGOING_PORT=2020
-
Add the ports and their protocols to the list of open ports with the following commands:
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
$ sudo iptables -I INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT
$ sudo service iptables save
$ sudo service iptables restart
Other machines should now be able to mount the NFS shares.
-
In a terminal, enter the following commands:
$ firewall-cmd --permanent --add-service=nfs
$ firewall-cmd --permanent --add-service=mountd
$ firewall-cmd --permanent --add-service=rpc-bind
$ firewall-cmd --reload
Other machines should now be able to mount the NFS shares.