Menu

Set Up a Shared Directory Using NFS - Windows

 

Setup Shared Server

Access the shared server (whose private IP address is 10.0.10.230) and install the following applications and/or packages.

Install PostgreSQL

qTest requires PostgreSQL database engine 9.5 or 9.6 (preferred) to be installed. Skip this step if you have already installed PostgreSQL.

Go to this page to download PostgreSQL. After downloading, run the installer to install PostgreSQL on the Shared Server.

Configure PostgreSQL

Make sure you enable remote access to PostgreSQL database server. 

  1. Open file C:\Program Files\PostgreSQL\<version>\data\pg_hba.conf. Note: replace <version> place holder with the actual version that you have installed.
  2. Look for the following line and if it does not exist, append the line to the file.
    host all all 0.0.0.0/0 md5
    host all all ::1/0 md5
  3. Your C:\Program Files\PostgreSQL\<version>\data\pg_hba.conf now looks like below:
    pg-hba-conf.png
  4. Open the file C:\Program Files\PostgreSQL\<version>\data\postgresql.conf.
  5. Look for the following line, and if it does not exist, append it to the file:
    listen_addresses = '*'
  6. Save and close the file when you have finished.

Restart PostgreSQL Service

Restart PostgreSQL service for the changes to take effect.
Important: By default, PostgreSQL runs on port 5432. You will configure the firewall for this later.

  1. Open the Start menu, and locate your Windows System.
  2. Select Run and type services.msc to open the Services window.
  3. Assume you have installed PostgreSQL 9.5, therefore, on the Services window look for the service named postgresql-x64-9.5.
  4. Right-click on the postgresql-x64-9.5 service and select Restart in the popup menu.

pg-restart.png

 

Install and Configure NFS

Network File System (NFS) is a Windows component that is used to share files across machines. Follow the instructions below to install and setup NFS.

Install NFS

  1. Open Server Manager, and navigate to the Dashboard.
  2.  Select Add Roles and Features.
    NFS-01.png
  3. Select Next on the 'Before you begin' window.
    NFS-02.png
  4. On the Select installation type screen, make sure the option 'Role-based or feature-based installation' is selected, then select Next.
    NFS-03.png
  5. On the Select destination server screen, make sure the option 'Select server from the server pool' is selected, and select Next.
    NFS-04.png
  6. From the Select server roles screen, locate and expand 'File and Storage Services (2 of 12 installed)' item then expand 'File and iSCSI Services (1 of 11 installed).'
  7. Select the checkbox for 'Server for NFS.'
    NFS-05.01.png
  8. Select 'Add Features' in the popup.
    NFS-05.02.png
  9. The 'Server for NFS' is now selected. Click Next.
    NFS-05.03.png
  10. On the 'Select features' screen, select Next.
    NFS-06.png
  11. On the 'Confirm installation selections' screen, select Install.
    NFS-07.png
  12. On the 'Installation progress' screen, wait for the installation to complete then Close.
    NFS-09.png

Create and Configure the Shared Folder

Next, you are going to create a folder to store data created by multiple qTest Sessions instances and use NFS to share the folder between instances.

  1. Open Fire Explorer and create a folder named "sessions-storage" in C:\ drive.
  2. Right-click on the sessions-storage folder and select Properties.
  3. On the 'sessions-storage Properties' windows, select the 'NFS Sharing' tab.
  4. Select the 'Manage NFS Sharing...' button.
    NFS-Sharing-Server-01.png
  5. In the NFS Advanced Sharing widget, check the 'Share this folder' checkbox, then select Permissions.
    NFS-Sharing-Server-02.png
  6. From the NFS Share Permissions screen, do the following:
    • Select 'Read-Write' option in the 'Type of access:' field
    • Select the checkbox 'Allow root access.'
      NFS-Sharing-Server-03.png
  7. Select OK, then Close, to complete sharing the folder sessions-storage.

Configure Shared Server's Firewall

You need to configure the Firewall on the Shared Server to enable qTest Sessions to access the components you just installed. You need to open the ports of the following components:

  • PostgreSQL: the running port is 5432
  • NFS: the running port is 2049
  1. From the Control Panel, open Windows Firewall.
  2. Select Advanced settings.
    configure-firewall-01.png
  3. On the Windows Firewall with Advanced Security window, select Inbound Rules from the left panel.
  4. Select New Rule... in the Inbound Rules from the right panel.
    configure-firewall-02.png
  5. On the New Inbound Rule Wizard screen, select the option 'Port' and click Next.
    configure-firewall-03.png
  6. On the Protocol and Ports screen, do the following:
    • Select TCP option
    • Select Specific local ports option, and enter the port values of PostgreSQL and NFS, separate each value by a comma.
      Example: 5432, 2049.
    • Click Next when you are done.
      configure-firewall-04.png
  7. On the Action screen, make sure the option Allow the connection is selected, then click Next.
    configure-firewall-05.png
  8. In the Profile screen, make sure all the options for Domain, Private and Public are checked, then click Next.
    configure-firewall-06.png
  9. In Name screen, enter a name for your new rule, e.g. 'Shared Ports for qTest Sessions', then click Finish.
    configure-firewall-07.png
  10. You have finished setting up the Shared Server.

Important: You need to restart the server for the changes and configurations to take effect, then move on to Installing qTest Sessions on a separate server.

Configure the shared directory

  1. Right click on the directory which you want to share to other machines, select Properties
  2. Choose tab NFS Sharing then click Manage NFS Sharing... button
  3. On the NFS Advanced Sharing dialog, select the options as the image below:
    1 - Share Dir
  4. Click Permissions button
  5. On the NFS Share Permissions, grant Read-Write access and Allow root access to ALL MACHINES like this:
    2 - Set share permissions
  6. Click OK and then Apply these settings on the shared directory

Map the shared directory on the NFS client machines

  1. On each NFS client machines, create a batch file (.bat) with the following content:
    mount -o fileaccess=777 [nfs-server-host]:\[shared-dir-name] [drive-letter]: > [log-file-path] 2>&1
    		
    • [nfs-server-host]: host name or IP address of the NFS server
    • [shared-dir-name]: name of the shared directory on the NFS server
    • [drive-letter]: the drive letter to map with the NFS shared resources. It must be usable on the local machine
    • [log-file-path]: full path to the file to which the system will write log of the scheduled mapping at every startup
  2. (This step is required!!!) Open Task Scheduler to schedule the above batch file to be executed as NT AUTHORITY\System at system start up
    3 - Schedule Security
    4 - Schedule trigger
    5 - Schedule Action
    6 - Schedule options
  3. Restart the server and check if the drive has been mapped successfully. If not, check the log file for troubleshooting

  IMPORTANT: when mapped using this method, the drive will be displayed as “Disconnected Network Drive”, it’s just a side effect and can be ignored as long as you can browse and create content on the drive using File Explorer

Subscribe To Our Blog
Powered by Zendesk