SlideShare a Scribd company logo
Highly Available NFS Server Scenario NFS Server1  nfs1.example.com  192.168.1.X NFS Server2  nfs2.example.com  192.168.1.X Virtual IP-Address  192.168.1.X NFS client For  WebServers or FTP Servers
Install ubuntu-dapper on both system  Crate two seprate partition on both  /dev/hdax  (For DRBD's meta data /dev/hday   ( For Shared Directory like /web) /dev/hdax should be more than 128MB /dev/hday should be identical in size on both system Do not mount /dev/hdax and /dev/hday during installation How To Install Ubuntu
Installation and Configuration of DRBD 1)  Synchronize System Time with date command or ntp 2) Install NFS server on both nfs1 and nfs2  sudo apt-get install  nfs-kernel-server 3) Remove starup scripts , because heartbeat will  controll NFS sudo update-rc.d -f nfs-kernel-server remove sudo update-rc.d -f nfs-common remove
4) Create NFS Share on both nfs server /web/site  192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash,sync) 5) Install Linux kernel headers and  DRDB on both NFS Server sudo apt-get install  linux-headers-`uname -r` sudo apt-get install drbd0.7-module-source sudo apt-get install drbd0.7-utils Installation and Configuration of DRBD Contd.....
Installation Contd......   cd /usr/src/ sudo tar xvfz drbd0.7.tar.gz cd modules/drbd/drbd sudo make sudo make install 6)  Configure /etc/drbd.conf file on both NFS Server , and it must  be identical vi /etc/drbd.conf resource r0 { protocol C; incon-degr-cmd "echo '!DRBD! pri on incon-degr' | mail abhishek.singh@fosteringlinux.com ; sleep 60"; startup { degr-wfc-timeout 120;  # 2 minutes. }
Configuration Contd............... disk { on-io-error  detach; } net { } syncer { rate 10M; group 1; al-extents 257; }
Configuration Contd............... on nfs1 {  # ** EDIT ** the hostname of server 1 (uname -n) device  /dev/drbd0;  # disk  /dev/hday;  # ** EDIT ** data partition on server 1 address  192.168.1.x:7788; # ** EDIT ** IP address on server 1 meta-disk  /dev/hdax[0];  #* EDIT * 128MB partition for DRBD onserver1 } on nfs2 {  # ** EDIT ** the hostname of server 2 (uname -n) device  /dev/drbd0;  # disk  /dev/hday;  # ** EDIT ** data partition on server 2 address  192.168.1.x:7788;  # ** EDIT ** IP address on server 2 meta-disk /dev/hdax[0];  # * EDIT * 128MB partition for DRBD on server 2 } } Replcae with slave NFS Server IP Address Replcae x and y with partition number Replcae with master NFS Server IP Address Replcae x and y with partition number
6) Now load DRBD kernel module in memory modprobe drbd Note:  Next time drbd init script will load the module drbdadm up all cat /proc/drbd 7)Make data consistent on both server Run following command on nfs1 machine drbdadm -- --do-what-I-say primary all drbdadm -- connect all cat /proc/drbd  ( To check progress of data initial sync  )
How To sync NFS lock and other information from Primary to Slave Server 1) Create Directory on both server mkdir /web 2) Do following on server nfs1 mount -t ext3 /dev/drbd0 /web mv /var/lib/nfs/ /web/ ln -s /web/nfs/ /var/lib/nfs mkdir /web/site umount /web 3) Do following on server nfs2 rm -fr /var/lib/nfs/ ln -s /web/nfs/ /var/lib/nfs
How To install and configure Hearbeat 1 ) Install Hearbeat on both the server sudo apt-get install heartbeat 2) Now Edit following three files on both NFS servers  /etc/heartbeat/ha.cf  logfacility  local0 keepalive 2 deadtime 30 bcast  eth0 node nfs1 nfs2 /etc/heartbeat/haresources nfs1  IPaddr::192.168.1.x/24/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/web::ext3 nfs-kernel-server Replace with Virtual Ipaddress
Configuration Contd.............. 3)Set Password for heartbeat communication /etc/authkeys auth 3 3 md5 fosteringlinux 4) Make /etc/authkeys readble by root only chmod  600 /etc/authkeys Replace with your string
Start DRBD and heartbeat on both NFS server #sudo /etc/init.d/drbd start #sudo /etc/init.d/heartbeat start Testing 1) Check virtual ipaddress on master nfs server (nfs1) ifconfig mount 2) Do same on slave nfs server (nfs2) Note: There should not be virtual ipaddress and mounted /content directory
Testing Continued............. 2) Replicate Server Failure  Create any directory or file on NFS server (nfs1) mkdir /web/site/failure Stop hearbeat on NFS server (nfs1) #sudo /etc/init.d/heartbeat stop 3) Check slave server Virtual Ipaddess ,exported /web  ifconfig mount created failure directory should be there cd  /web/site ls
4)   Do same on slave Create any file and directory in /web/site mkdir /web/site/success Stop heartbeat on Slave (nfs2) 5) Run these commands on master so now VIP and /web should be on master ifconfig mount df -h -T
Configure NFS Client mkdir /web mount -t nfs  192.168.1.x:/web/site /web Note: Replace 192.168.1.x with Virtual Ipaddress vi /etc/fstab 192.168.1.x:/web/site  /web  nfs  rw  0  0 Replace with Virtual IP addess

More Related Content

PPTX
Flex pod driven by Openstack
ODP
Introduction to Diskless Remote Boot in Linux
PDF
Comparison of-foss-distributed-storage
PDF
Docker and friends at Linux Days 2014 in Prague
PDF
Performance comparison of Distributed File Systems on 1Gbit networks
PDF
LizardFS-WhitePaper-Eng-v3.9.2-web
PPTX
What every data programmer needs to know about disks
Flex pod driven by Openstack
Introduction to Diskless Remote Boot in Linux
Comparison of-foss-distributed-storage
Docker and friends at Linux Days 2014 in Prague
Performance comparison of Distributed File Systems on 1Gbit networks
LizardFS-WhitePaper-Eng-v3.9.2-web
What every data programmer needs to know about disks

What's hot (20)

PDF
nouka inventry manager
PPT
Qt native built for raspberry zero
PDF
3 manual installation of open vpn
PPTX
От sysV к systemd
DOCX
Proxy server ubuntu 12.04
PPTX
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
ODP
LSA2 - 02 Control Groups
PPT
Unix 6 en
ODP
LSA2 - 01 Virtualization with KVM
ODP
BlankOn Server - Lesson Learned
PDF
NetBSDworkshop
PDF
OSS AWS 핸즈온 강의
ODP
Hadoop Installation and basic configuration
PDF
CoreOSによるDockerコンテナのクラスタリング
PDF
NetBSD workshop
PPTX
Lecture 3 Perl & FreeBSD administration
PDF
MongoDB Shard Cluster
PDF
Linux fundamental - Chap 12 Hardware Management
PPTX
Ansible as a better shell script
DOCX
Run wordcount job (hadoop)
nouka inventry manager
Qt native built for raspberry zero
3 manual installation of open vpn
От sysV к systemd
Proxy server ubuntu 12.04
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
LSA2 - 02 Control Groups
Unix 6 en
LSA2 - 01 Virtualization with KVM
BlankOn Server - Lesson Learned
NetBSDworkshop
OSS AWS 핸즈온 강의
Hadoop Installation and basic configuration
CoreOSによるDockerコンテナのクラスタリング
NetBSD workshop
Lecture 3 Perl & FreeBSD administration
MongoDB Shard Cluster
Linux fundamental - Chap 12 Hardware Management
Ansible as a better shell script
Run wordcount job (hadoop)
Ad

Similar to testing-nfs (20)

PDF
PPS
Linux06 nfs
PPT
Solaris 10 administration 2 Configuring NFS
PPTX
Linux network file system (nfs)
PDF
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
PDF
How to Install NFS Server and Client on Ubuntu 2404.pdf
PDF
Network File System (NFS)
PPTX
Ibm spectrum scale fundamentals workshop for americas part 5 spectrum scale_c...
PPT
NFS.ppt
PPT
Nf Sp4
PDF
GCE NFS HA
PPTX
NFS is an excellent way of sharing files between linux and other unix systems
PDF
Comparison of foss distributed storage
PDF
sharing-filesystems-using-nfs-slides.pdf
PPTX
Network File System
PDF
Build a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
PPT
Server configuration
PPT
PPT
nfs.ppt
PPTX
High Availability != High-cost
Linux06 nfs
Solaris 10 administration 2 Configuring NFS
Linux network file system (nfs)
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
How to Install NFS Server and Client on Ubuntu 2404.pdf
Network File System (NFS)
Ibm spectrum scale fundamentals workshop for americas part 5 spectrum scale_c...
NFS.ppt
Nf Sp4
GCE NFS HA
NFS is an excellent way of sharing files between linux and other unix systems
Comparison of foss distributed storage
sharing-filesystems-using-nfs-slides.pdf
Network File System
Build a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
Server configuration
nfs.ppt
High Availability != High-cost
Ad

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MIND Revenue Release Quarter 2 2025 Press Release
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks

testing-nfs

  • 1. Highly Available NFS Server Scenario NFS Server1 nfs1.example.com 192.168.1.X NFS Server2 nfs2.example.com 192.168.1.X Virtual IP-Address 192.168.1.X NFS client For WebServers or FTP Servers
  • 2. Install ubuntu-dapper on both system Crate two seprate partition on both /dev/hdax (For DRBD's meta data /dev/hday ( For Shared Directory like /web) /dev/hdax should be more than 128MB /dev/hday should be identical in size on both system Do not mount /dev/hdax and /dev/hday during installation How To Install Ubuntu
  • 3. Installation and Configuration of DRBD 1) Synchronize System Time with date command or ntp 2) Install NFS server on both nfs1 and nfs2 sudo apt-get install nfs-kernel-server 3) Remove starup scripts , because heartbeat will controll NFS sudo update-rc.d -f nfs-kernel-server remove sudo update-rc.d -f nfs-common remove
  • 4. 4) Create NFS Share on both nfs server /web/site 192.168.1.0/255.255.255.0(rw,no_root_squash,no_all_squash,sync) 5) Install Linux kernel headers and DRDB on both NFS Server sudo apt-get install linux-headers-`uname -r` sudo apt-get install drbd0.7-module-source sudo apt-get install drbd0.7-utils Installation and Configuration of DRBD Contd.....
  • 5. Installation Contd...... cd /usr/src/ sudo tar xvfz drbd0.7.tar.gz cd modules/drbd/drbd sudo make sudo make install 6) Configure /etc/drbd.conf file on both NFS Server , and it must be identical vi /etc/drbd.conf resource r0 { protocol C; incon-degr-cmd "echo '!DRBD! pri on incon-degr' | mail abhishek.singh@fosteringlinux.com ; sleep 60"; startup { degr-wfc-timeout 120; # 2 minutes. }
  • 6. Configuration Contd............... disk { on-io-error detach; } net { } syncer { rate 10M; group 1; al-extents 257; }
  • 7. Configuration Contd............... on nfs1 { # ** EDIT ** the hostname of server 1 (uname -n) device /dev/drbd0; # disk /dev/hday; # ** EDIT ** data partition on server 1 address 192.168.1.x:7788; # ** EDIT ** IP address on server 1 meta-disk /dev/hdax[0]; #* EDIT * 128MB partition for DRBD onserver1 } on nfs2 { # ** EDIT ** the hostname of server 2 (uname -n) device /dev/drbd0; # disk /dev/hday; # ** EDIT ** data partition on server 2 address 192.168.1.x:7788; # ** EDIT ** IP address on server 2 meta-disk /dev/hdax[0]; # * EDIT * 128MB partition for DRBD on server 2 } } Replcae with slave NFS Server IP Address Replcae x and y with partition number Replcae with master NFS Server IP Address Replcae x and y with partition number
  • 8. 6) Now load DRBD kernel module in memory modprobe drbd Note: Next time drbd init script will load the module drbdadm up all cat /proc/drbd 7)Make data consistent on both server Run following command on nfs1 machine drbdadm -- --do-what-I-say primary all drbdadm -- connect all cat /proc/drbd ( To check progress of data initial sync )
  • 9. How To sync NFS lock and other information from Primary to Slave Server 1) Create Directory on both server mkdir /web 2) Do following on server nfs1 mount -t ext3 /dev/drbd0 /web mv /var/lib/nfs/ /web/ ln -s /web/nfs/ /var/lib/nfs mkdir /web/site umount /web 3) Do following on server nfs2 rm -fr /var/lib/nfs/ ln -s /web/nfs/ /var/lib/nfs
  • 10. How To install and configure Hearbeat 1 ) Install Hearbeat on both the server sudo apt-get install heartbeat 2) Now Edit following three files on both NFS servers /etc/heartbeat/ha.cf logfacility local0 keepalive 2 deadtime 30 bcast eth0 node nfs1 nfs2 /etc/heartbeat/haresources nfs1 IPaddr::192.168.1.x/24/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/web::ext3 nfs-kernel-server Replace with Virtual Ipaddress
  • 11. Configuration Contd.............. 3)Set Password for heartbeat communication /etc/authkeys auth 3 3 md5 fosteringlinux 4) Make /etc/authkeys readble by root only chmod 600 /etc/authkeys Replace with your string
  • 12. Start DRBD and heartbeat on both NFS server #sudo /etc/init.d/drbd start #sudo /etc/init.d/heartbeat start Testing 1) Check virtual ipaddress on master nfs server (nfs1) ifconfig mount 2) Do same on slave nfs server (nfs2) Note: There should not be virtual ipaddress and mounted /content directory
  • 13. Testing Continued............. 2) Replicate Server Failure Create any directory or file on NFS server (nfs1) mkdir /web/site/failure Stop hearbeat on NFS server (nfs1) #sudo /etc/init.d/heartbeat stop 3) Check slave server Virtual Ipaddess ,exported /web ifconfig mount created failure directory should be there cd /web/site ls
  • 14. 4) Do same on slave Create any file and directory in /web/site mkdir /web/site/success Stop heartbeat on Slave (nfs2) 5) Run these commands on master so now VIP and /web should be on master ifconfig mount df -h -T
  • 15. Configure NFS Client mkdir /web mount -t nfs 192.168.1.x:/web/site /web Note: Replace 192.168.1.x with Virtual Ipaddress vi /etc/fstab 192.168.1.x:/web/site /web nfs rw 0 0 Replace with Virtual IP addess