Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Tuesday, June 23, 2015

NFS and Shared Folder creation between servers


Install NFS on all your servers

yum install nfs-utils -y
service rpcbind start
service nfs start
service autofs restart

NFS server side

Then, in your "NFS server", create the shared folder (aka the folder to be shared)

mkdir /home/mich/SHARED_FOLDER
chmod a+w /home/mich/SHARED_FOLDER



Define the mount folder:

vi /etc/exports /home/mich/SHARED_FOLDER 192.168.1.0/24(rw,sync,no_root_squash,no_all_squash)
where the  192.168.1.0/24 is the IP range of the servers authorized to access this mounted folders

In order to make the export change effective, type:
exportfs -a

then, do not forget to start nfs
/etc/init.d/nfs start

or even to start it automatically in startup:
for ex:

cat /etc/rc.d/rc.local 

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
depmod -a
modprobe acpiphp
if [ -f /etc/rc.firstboot ]
then
        /etc/rc.firstboot | tee /var/log/firstboot.log
        cp /etc/rc.firstboot /usr/local/etc/
        rm /etc/rc.firstboot
        reboot
fi
touch /var/lock/subsys/local
/etc/init.d/nfs start

NFS CLIENT side


Then, on each client side, that want to use this mount :


mkdir /nfs/shared
mount -t nfs 192.168.20.11:/home/mich/SHARED_FOLDER/ /nfs/shared/


where 192.168.20.11 is the IP of the NFS server that you've configured in the previous paragraph

or do it automatically after startup:
vi /etc/fstab

add something like:
192.168.20.11:/home/mich/SHARED_FOLDER/ /nfs/shared/  nfs rsize=8192,wsize=8192,timeo=14,intr

if you want to test it without reboot your machine, do simply
mount -a

All those instructions were freely and quite fully inspired from this link:


Thursday, March 12, 2015

Network Connection

In order to understand the spec of the network card being used by your server:

lspci | grep -i net

Here, as example of the status on my job's cloud : 


ro -a -o . -h els2 -s shared -irc %/ lspci | grep -i net
[ virginia / svpr-els204 ] - 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)        <<== which means 1 GB only
[ virginia / svpr-els204 ] - 03:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els204 ] - 03:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els204 ] - 03:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els205 ] - 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els205 ] - 03:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els205 ] - 03:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els205 ] - 03:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els206 ] - 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els206 ] - 03:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els206 ] - 03:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els206 ] - 03:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[ virginia / svpr-els207 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)             <<== this means the card is 10Gb/sec 
[ virginia / svpr-els207 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els208 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els208 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els209 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els209 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els21 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els21 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els210 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els210 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els211 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els211 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els212 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els212 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els22 ] - 04:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)
[ virginia / svpr-els22 ] - 04:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (be3) (rev 01)


In addition, in order to understand the SWAP memory usage :

free -g 


 free -g             total       used       free     shared    buffers     cachedMem:           125        110         15          0          3         67-/+ buffers/cache:         39         86Swap:          128          0        128


==> Means that the OS has about 67+15 GB available

If you don't want to use swap (it may slow your server/application etc) 


  • swapoff -a   ==> do never use swap
  • sysctl vm.swappiness=0   ==> use swap only if you don't have any more choice
  • sysctl vm.swappiness=60   ==> use swap only if you reach more than 60% of the memory
  • swapon -a ==> enable usage of SWAP, according to the swappiness value 
  •  sysctl -a |grep swap  : to understand what is the % policy value.


Using top, you can have the following:

Mem:  132119828k total, 131341592k used,   778236k free,  3505520k buffers
Swap: 134365176k total,    88752k used, 134276424k free, 105451036k cached  <<== this is the FULL RAM available

More info regarding swap can be found: 
http://askubuntu.com/questions/103915/how-do-i-configure-swappiness