DRBD-Cookbook: How to create your own cluster solution, without SAN or NAS!
()
About this ebook
In form of 'Listings' - practicle example-sessions, which can have bugs, error messages and debugging - the author shows, how you can use step by step DRBD, to create an easy and functionable Linux-Cluster.
Because the DRBD-Software and the configuration files are also usable on Windows, the shown examples can also run on this system!
In an own chapter it will be shown, how DRBD involes into an Veritas-Cluster.
Useful information for the system administration of Linux systems will be given in three appendices. The operation of the various Linux file systems is also explained.
Related to DRBD-Cookbook
Related ebooks
Oracle Solaris 11: First Look Rating: 0 out of 5 stars0 ratingsAnsible For Linux by Examples Rating: 0 out of 5 stars0 ratingsNetBackup Complete Self-Assessment Guide Rating: 5 out of 5 stars5/5Windows Server 2008 For Dummies Rating: 0 out of 5 stars0 ratingsRed Hat OpenShift The Ultimate Step-By-Step Guide Rating: 1 out of 5 stars1/5DB2 9 System Administration for z/OS: Certification Study Guide: Exam 737 Rating: 3 out of 5 stars3/5Commvault Simpana A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsObject storage A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsOpenShift A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsRed Hat Ansible A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsCreating Development Environments with Vagrant - Second Edition Rating: 0 out of 5 stars0 ratingsDriving the Power of AIX: Performance Tuning on IBM Power Rating: 0 out of 5 stars0 ratingsWildFly Cookbook Rating: 0 out of 5 stars0 ratingsCommvault Simpana A Complete Guide - 2021 Edition Rating: 0 out of 5 stars0 ratingsCommvault Simpana A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsDB2 9 for Developers Rating: 0 out of 5 stars0 ratingsHadoop Cluster Deployment Rating: 0 out of 5 stars0 ratingsStorage area network The Ultimate Step-By-Step Guide Rating: 0 out of 5 stars0 ratingsLearning SaltStack Rating: 4 out of 5 stars4/5Terraform for Developers: Essentials of Infrastructure Automation and Provisioning Rating: 0 out of 5 stars0 ratingsImplementing NetScaler VPX™ - Second Edition Rating: 0 out of 5 stars0 ratingsIBM WebSphere MQ A Complete Guide Rating: 0 out of 5 stars0 ratingsOracle Solaris 11 System Virtualization Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsBMC Control-M 7: A Journey from Traditional Batch Scheduling to Workload Automation Rating: 0 out of 5 stars0 ratingsRed Hat Ceph A Complete Guide Rating: 0 out of 5 stars0 ratingsAnsible Linux Filesystem By Examples: 30+ Automation Examples on Linux File and Directory Operation for Modern IT Infrastructure Rating: 0 out of 5 stars0 ratingsGetting Started with Big Data Query using Apache Impala Rating: 0 out of 5 stars0 ratingsRed Hat Certified Engineer (RHCE) Study Guide: Ansible Automation for the Red Hat Enterprise Linux 8 Exam (EX294) Rating: 0 out of 5 stars0 ratingsIBM WebSphere Application Server v7.0 Security Rating: 0 out of 5 stars0 ratings
Operating Systems For You
Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Windows 11 All-in-One For Dummies Rating: 5 out of 5 stars5/5Windows 11 For Dummies Rating: 0 out of 5 stars0 ratingsLearn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsExploring Windows 11: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratingsHacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5CompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsLinux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Ultimate SwiftUI Handbook for iOS Developers: A complete guide to native app development for iOS, macOS, watchOS, tvOS, and visionOS Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Mastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5UNIX For Dummies Rating: 3 out of 5 stars3/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsMacs All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsTor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsBash Command Line Pro Tips Rating: 5 out of 5 stars5/5The iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsOneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Mastering macOS Programming Rating: 0 out of 5 stars0 ratingsPowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Exploring Windows 10 May 2020 Edition: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratings
Reviews for DRBD-Cookbook
0 ratings0 reviews
Book preview
DRBD-Cookbook - Joerg Christian Seubert
DRBD-Cookbook
How to create your own cluster solution, without SAN or NAS!
1. Edition
Contents
1 Introduction
1.1 Syntax of that book
1.2 Built-in bugs
1.3 Hostnames
2 Installation
2.1 Software
2.2 Requirements
3 Preliminary considerations
3.1 Disk drive – physically vs. LVM
3.2 Filesystem on the disk device
3.2.1 UFS / ext2
3.2.2 ext3 / ext4
3.2.3 xfs
3.2.4 BtrFS
3.2.5 OCFS2
3.2.6 Conclusion
4 Configuration-Basics on a two-node-cluster-array
4.1 SSH-Configuration
4.1.1 SSH-Key-Types
4.1.2 Recipe: Generate and distribute SSH keys
4.2 Configuration of the locale Disk devices
4.2.1 Recipe: Create LVM volume via YaST
4.2.2 Recipe: Create a LVM-Volume via shell
4.3 DRBD configuration
4.3.1 Performance
4.3.2 /etc/drbd.conf
4.3.3 /etc/drbd.d/global_common.conf
4.3.4 Resourceconfiguration
4.3.5 Resource Description:
4.3.6 Alternative notation
4.3.7 Ports
4.3.8 Recipe: Command sequence for the basic configuration
5 Data transmission in the backbone LAN
5.1 Recipe: Backbone LAN in the DRBD configuration
6 Multi-node cluster
6.1 Stacking-Device
6.1.1 Recipe: Commissioning a stacking device with DRBD8 under SLES11 SP4
6.1.2 Recipe: Commissioning a stacking device with DRBD9 under OpenSuSE 15.1
6.2 RAID1 over at least three nodes
7 Hardened cluster
7.1 Detecting the state of the firewall
7.2 Firewallzones
7.3 Build a new firewall-service
7.4 Build a new zone
7.5 Basics of a two-stage hardening concept
7.5.1 Hardening with the firewall
7.5.2 Hardening with the Secure-Shell-Options
8 Increase / decrease the size of the DRBD device
8.1 Unofficial method
8.1.1 Concept
8.1.2 Command sequence
8.2 The official way
9 Program your own cluster solution
9.1 Configuration file
9.1.1 Content of the configuration file
9.2 Virtual IP-address
9.2.1 Script explanation for my_virt_ip.pl:
9.3 Make database switchable
9.3.1 Script explanation for my_dev_switch.pl:
9.4 Communication between cluster nodes - the Horcher
9.4.1 Script explanation for my_horcher.pl:
9.5 Controlscript
9.5.1 Script explanation for my_control.pl:
9.6 Service control scripts for systemd
9.6.1 Explanation for mycluster_horcher.service:
9.6.2 Explanation for mycluster_control.service:
9.7 Initialization script for the cluster controller
9.7.1 Explanation for my_service.pl:
9.8 Maintenance
9.9 General information about the scripts
10 Include DRBD in Veritas Cluster
10.1 Include DRBD as Veritas-Agent
10.2 Increase or decrease a DRBD-Device, which is included in the Veritas-Cluster
11 DRBD and Docker
11.1 Preparation and first start of the container
11.2 Work with the container
12 Win-DRBD
13 SSH-Configuration on SLE 15 / OpenSuSE Leap 15.x
14 Creating a LVM-Volume-Group
14.1 YaST
14.2 Shell
15 Stop, start, enable and disable services - a little tutorial
15.1 Copying servicefiles
15.2 Use services via YaST
15.3 Operate services with systemctl
16 Sources and disclaimer
16.1 Sources
16.1.1 Internet
16.1.2 Books
16.2 Disclaimer:
17 About…
17.1 …the book…
17.2 …the author…
17.3 Legal notice:
1
Introduction
If you want to build a cluster, sooner or later you face the problem that the data must be usable on all participating servers. This problem can be solved by transporting the data once per minute from the active cluster node to the passive cluster node.
But what, if this copy job
takes longer than one minute?
In this case, you either have the situation that the copy jobs overtake each other and never end, because the cluster node in question does nothing else but ’copy’ - and ’nothing else’ means ’nothing else’ - or the data is outdated every time.
Neither makes sense and is not desirable.
If you have the additional situation that all cluster nodes must not only read the data but also write it, ’practical copying’ no longer makes any sense at all. Usually, this problem is solved by using a SAN or NAS.
For a data center, where there are usually more than two machines running at 24 * 7 uptime, it may not be a problem to run one more machine per cluster group - this can be a ’disk pot’, known as a true SAN (storage area network), or it can be a network file server, known as a NAS (network-attached-storage).
However, small businesses and home users face the problem of having to pay for a SAN or NAS.
That’s where the DRBD - Distributed Replicated Block Device - product from LinBit (www.linbit.com) comes in.
DRBD gives you the ability to connect two or more cluster nodes together without using a SAN or NAS as a data device. DRBD runs like a local RAID controller creating a mirror device (RAID 1) - but with local disks
connected by a LAN.
You can also use this variant in a large data center if your cluster needs to be independent of a SAN or NAS. For example, you can think of a monitoring server that monitors the SAN or NAS and has to run highly available, especially when the SAN or NAS is not running.
This cookbook teaches the basics of a DRBD active-passive cluster, extended by further possibilities (three-node cluster, backbone LAN, deployment of DRBD on a Veritas cluster, creation of an own cluster via PERL, cluster configuration via hardware systems and many more) and demonstrates the procedures in the form of ’listings’.
All examples are based on a test configuration with OpenSuSE Leap 15.1 (except 6.1.1) and can - with the necessary background knowledge - also be implemented in other Linux distributions.
In the text number 6.1.1 the listing is done with SLES 11 SP 4 to show the commands and screen outputs of DRBD version 8 compared to DRBD version 9 because there are some differences.
For using DRBD on Windows-Servers use chapter 12.
1.1
Syntax of that book
To distinguish keyboard inputs and on-screen outputs from the explanations, the commands and on-screen outputs are displayed as follows:
hostname:~ # echo This is an example!
This is an example!
In the scripts, the individual lines are numbered consecutively and the individual lines are briefly explained in tabular form in the text following the respective listing.
This means that the commands of the recipes
can be entered on the shell as shown in the