Wednesday, August 27, 2014

How to Install & Run NFS Server with Fixed Ports

Important Files for NFS Configuration
/etc/exports : Its a main configuration file of NFS, all exported files and directories are defined in this file at the NFS Server end.
/etc/fstab : To mount a NFS directory on your system across the reboots, we need to make an entry in /etc/fstab.
/etc/sysconfig/nfs : Configuration file of NFS to control on which port rpc and other services are listening.

NFS Default Ports
111  NFS
2049 Portmap


Install Server with below command
yum install nfs-utils nfs-utils-lib


Start the service & add in startup
/etc/init.d/nfs start
chkconfig nfs on

Edit file to share directory
vi /etc/exports

To share with all
/home/shared *(rw,sync)

To share with particular IP
/home/shared  172.39.253.10(rw,sync)

Important NFS Sharing Options
Some other options we can use in /etc/exports file for file sharing is as follows.
ro: With the help of this option we can provide read only access to the shared files i.e client will only be able to read.
rw: This option allows the client server to both read and write access within the shared directory.
sync: Sync confirms requests to the shared directory only once the changes have been committed.
no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger file system, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
no_root_squash: This phrase allows root to connect to the designated directory.


Need to run the below command to export directory after adding in exports file
exportfs -a
 
After changing in exports file run below command to share again (Only required once you shared new directory or changed permission in exports file)
exportfs -r
 
To check files
exportfs -v
 ................................................................................
Client machine
yum install nfs-utils nfs-utils-lib

Start the service & add in startup
/etc/init.d/nfs start
chkconfig nfs on

Run the below command to check shared directory
showmount -e Server-IP

To mount share directory
mount 172.39.253.28:/home/Shared /mnt

Check mount directory
mount | grep nfs

To mount on reboot
172.39.253.28:/home/Shared /mnt  nfs defauls 0 0
 ........................................................................................

 IMPORTANT
Allow NFS with Fixed ports  on Server

Please add the following lines in  /etc/sysconfig/nfs configuration file on server. Any free port may be specified.
LOCKD_TCPPORT=33776
LOCKD_UDPPORT=33776
MOUNTD_PORT=33777
STATD_PORT=33778
RQUOTAD_PORT=33779
RPCNFSDCOUNT=32

Allow above ports on iptables with default 111 & 2049 ports

Restart NFS service
# service nfs restart
# service nfslock restart

Tuesday, August 19, 2014

Bandwidth Monitoring Tool for Linux

There are lot of tools to do the task, I am using bwm-ng

To install it on FEDORA / CENTOS, use
   
yum -y install bwm-ng

To run it , Type the below command at terminal

    bwm-ng

Use following shortcut to tune bwm-ng

Press + to set time interval, default is set to 0.5 seconds which is too short, make it at least 1.00 or 1.1 to get mroe stable value.

Press u to get DATA in kb (kilobits), default is set to KB (Kilo Bytes)

To see data of eth0, with kilobits, and 1 second refresh rate , use following . . .

    bwm-ng +I eth0 -u bits -t 1000

.......................................................................

You can also try alternate tools like iptraf & netwatch (For IP Based utilization)

Friday, August 8, 2014

"There was a problem sending the command to the program" Error in MS Excel

 While double clicking on excel file you got the error There was a problem sending the command to the program & then you need to open the file manually from File menu.
 
Follow below steps to resolve this issue

Microsoft Excel 2010 and 2013

Click the File tab, and then click Options.
Click Advanced, scroll down to the General section, and then clear the Ignore other applications that use Dynamic Data Exchange (DDE) check box in the General area.
Click OK.

Microsoft Excel 2007

Click the Microsoft Office Button, and then click Excel Options.
Click Advanced, and then clear the Ignore other applications that use Dynamic Data Exchange (DDE) check box in the General area.
Click OK.

Now double click any Excel file & it will open without any error