SlideShare a Scribd company logo
1 of 15
Download to read offline
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

What's hot

nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry managerToshiaki Baba
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zeroSoheilSabzevari2
 
3 manual installation of open vpn
3 manual installation of open vpn3 manual installation of open vpn
3 manual installation of open vpnAshwajit Maske
 
От sysV к systemd
От sysV к systemdОт sysV к systemd
От sysV к systemdDenis Kovalev
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Tio Aldiansyah
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...NLJUG
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control GroupsMarian Marinov
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMMarian Marinov
 
BlankOn Server - Lesson Learned
BlankOn Server - Lesson LearnedBlankOn Server - Lesson Learned
BlankOn Server - Lesson LearnedAndika Triwidada
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의Juhong Jung
 
Hadoop Installation and basic configuration
Hadoop Installation and basic configurationHadoop Installation and basic configuration
Hadoop Installation and basic configurationGerrit van Vuuren
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングYuji ODA
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Ansible as a better shell script
Ansible as a better shell scriptAnsible as a better shell script
Ansible as a better shell scriptTakuya Nishimoto
 

What's hot (20)

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

Similar to testing-nfs

LinuxKit Swarm Nodes
LinuxKit Swarm NodesLinuxKit Swarm Nodes
LinuxKit Swarm NodesMoby Project
 
Network File System (NFS)
Network File System (NFS)Network File System (NFS)
Network File System (NFS)abdullah roomi
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02FNian
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatChris Barber
 
Prosit google-cloud
Prosit google-cloudProsit google-cloud
Prosit google-cloudUC Davis
 
Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Sean Hull
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyNugroho Gito
 

Similar to testing-nfs (20)

LinuxKit Swarm Nodes
LinuxKit Swarm NodesLinuxKit Swarm Nodes
LinuxKit Swarm Nodes
 
Network File System (NFS)
Network File System (NFS)Network File System (NFS)
Network File System (NFS)
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Linux Conf Admin
Linux Conf AdminLinux Conf Admin
Linux Conf Admin
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
Linux
LinuxLinux
Linux
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
DNS (BIND) on CentOS
DNS (BIND) on CentOSDNS (BIND) on CentOS
DNS (BIND) on CentOS
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Alta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/LinuxAlta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/Linux
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & Heartbeat
 
NFS.ppt
NFS.pptNFS.ppt
NFS.ppt
 
Prosit google-cloud
Prosit google-cloudProsit google-cloud
Prosit google-cloud
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
Xen time machine
Xen time machineXen time machine
Xen time machine
 
Tinydns and dnscache
Tinydns and dnscacheTinydns and dnscache
Tinydns and dnscache
 
Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10Oreilly Webcast 01 19 10
Oreilly Webcast 01 19 10
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
Rhel3
Rhel3Rhel3
Rhel3
 

Recently uploaded

Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 

Recently uploaded (20)

Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 

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