Applies to VoipNow 3.X.X!
With distributed environments, some of the folders need to be shared between nodes. For that, you can either use a NAS /SAN server and mount a shared disk on all nodes form the distributed environment, or you may use a NFS server that can reside on the main node, infrastructure controller (IC), or a dedicated server.
For the sake of simplicity, we'll assume that the NFS server will be installed on the IC, which is the main node, but all the files will be stored on a faster drive, like a SSD disk, mounted under the /home/storage folder.
Step-by-step guide
Using the Infrastructure Controller
Install the NFS utilities and supporting clients and daemons for the NFS server on the main node (the IC), that will became the NFS server for the distributed environment.
yum install nfs-utils
When working with NFS, you must take into consideration the total number of NFS threads that are available on the NFS server. By default, this number is set to 8. However, it's better to increase the number of threads on the NFS server. To do this, increase the value of RPCNFSDCOUNT in /etc/sysconfig/nfs
RPCNFSDCOUNT=32
Once the files are installed and the number of processes is set, start the NFS daemon on the IC.
service nfs start service rpcbind start
- Before exporting the shared storage disk, you need to make sure that all the shared files and folders are available there.
Assuming that /home/storage/ is the storage home directory, the following command will copy all the required files in the shared location.
cp -Rap /var/spool/asterisk/ /home/storage/ --parents cp -Rap /var/lib/asterisk/ /home/storage/ --parents cp -Rap /var/lib/voipnow/ /home/storage/ --parents cp -Rap /var/lib/voipnowquota/ /home/storage/ --parents cp -Rap /var/lib/faxmsg/ /home/storage/ --parents cp -Rap /var/spool/fax/ /home/storage/ --parents cp -Rap /usr/local/voipnow/scache /home/storage/ --parents cp -Rap /usr/local/voipnow/stmp /home/storage/ --parents cp -Rap /usr/local/voipnow/tmp /home/storage/ --parents
After running all these commands, the structure should look something like this:
/home/storage/ ├── usr │ └── local │ └── voipnow │ ├── scache │ ├── stmp │ └── tmp └── var ├── lib │ ├── asterisk │ │ ├── agi-bin │ │ ├── certs │ │ ├── documentation │ │ ├── firmware │ │ ├── images │ │ ├── keys │ │ ├── moh │ │ ├── music │ │ ├── phoneprov │ │ ├── sounds │ │ └── static-http │ ├── faxmsg │ ├── voipnow │ │ ├── core │ │ ├── dumps │ │ ├── prorepo │ │ ├── provisioning │ │ └── templates │ └── voipnowquota │ └── spool ├── asterisk │ ├── dictate │ ├── fax │ ├── meetme │ ├── monitor │ ├── outgoing │ ├── system │ ├── tmp │ ├── vm -> voicemail/default/ │ └── voicemail └── fax
The folders from the shared location must be mounted on the IC as well on the other nodes. For the IC, which is the main node also used as th eNFS server, the following lines must be added in /etc/fstab
/home/storage/var/spool/asterisk /var/spool/asterisk none bind 0 0 /home/storage/var/lib/asterisk /var/lib/asterisk none bind 0 0 /home/storage/usr/local/voipnow/stmp /usr/local/voipnow/stmp none bind 0 0 /home/storage/usr/local/voipnow/scache /usr/local/voipnow/scache none bind 0 0 /home/storage/var/lib/faxmsg /var/lib/faxmsg none bind 0 0 /home/storage/usr/local/voipnow/tmp /usr/local/voipnow/tmp none bind 0 0 /home/storage/var/lib/voipnowquota /var/lib/voipnowquota none bind 0 0 /home/storage/var/spool/fax /var/spool/fax none bind 0 0 /home/storage/var/lib/voipnow /var/lib/voipnow none bind 0 0
In order to export the shared folder to all the nodes from the distributed environment, the line below must be added to /etc/exports. This line says that /home/storage will be exported and that it can be used by any NFS client from then network 10.150.12.0/24. Basically, any NFS client can mount the shared folder and use it.
/home/storage 10.150.12.0/255.255.255.0(rw,async,no_root_squash,no_all_squash)
To increase the writing performance of the NFS server, the share was exported using async as the method of writing. Keep in mind, however, that async can cause data loss and corruption of the saved files.
Once the fstab and exports lines were added, the folders must be mounted and shared on the network. The following commands are required:
mount -a exportfs -a
Using any node from the distributed infrastructure
Before mounting the shared location, you need to install all the NFS utilities and supporting clients on the current node. To do this, run the following:
yum install nfs-utils
Let's assume that you want to add a dedicated PBX node which must have access to all the media files of the infrastructure and, at the same time, must be able to add new files, voicemail, call recordings, etc. In order to mount the shared folder exported form the IC and, also, the shared location mounted under the required folders, enter the following in the /etc/fstab file:
10.150.12.35:/home/storage /home/storage nfs proto=tcp,rw,async,hard,intr,rsize=65536,wsize=65536,noatime 0 0 /home/storage/var/spool/asterisk /var/spool/asterisk none bind 0 0 /home/storage/var/lib/asterisk /var/lib/asterisk none bind 0 0 /home/storage/usr/local/voipnow/stmp /usr/local/voipnow/stmp none bind 0 0 /home/storage/usr/local/voipnow/scache /usr/local/voipnow/scache none bind 0 0 /home/storage/var/lib/faxmsg /var/lib/faxmsg none bind 0 0 /home/storage/usr/local/voipnow/tmp /usr/local/voipnow/tmp none bind 0 0 /home/storage/var/lib/voipnowquota /var/lib/voipnowquota none bind 0 0 /home/storage/var/spool/fax /var/spool/fax none bind 0 0 /home/storage/var/lib/voipnow /var/lib/voipnow none bind 0 0
10.150.12.35 is the IP address of the main node. It should be replaced with the real IP address.
Once all changes are saved, the following command is required:
mount -a
- The command above will mount all the shared folders on the local node.
Related articles
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.