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

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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