Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ DRBD switchover     - Optimized to minimize the installation of CentOS 5.8 (Linux)

- CentOS 6.5 Linux System Customization and Packaging Quick Implementation Script (Linux)

- Linux static library generated Guide (Programming)

- MySQL multi-master multi-cluster deployment uses alive Galera (Database)

- CoreOS Linux introduces Kubernetes kubelet (Server)

- Unix average load average load calculation method (Server)

- Installation and use the telnet command under CentOS 6.x (Linux)

- WebLogic 12c Configuration Node Manager Managed Server (Database)

- Kubernetes Cluster Setup problems encountered and solutions (Server)

- Linux gprof oprofiling and performance testing tools (Linux)

- How to install and configure in Ubuntu 14.10 'Weather Information Indicator' (Linux)

- About Nginx 7 (Server)

- Linux crontab command format example (Linux)

- 11.2.04 Oracle RAC directory crfclust.bdb file is too large, Bug 20186278 (Database)

- Linux, Oracle listen address modification (Database)

- MySQL Statistics (Database)

- MySQL query performance comparison of a single truth (Database)

- Linux NIC driver and version information (Linux)

- The specified user to execute commands under Linux (Linux)

- Python function arguments * args and ** kwargs usage (Programming)

 
         
  DRBD switchover
     
  Add Date : 2018-11-21      
         
       
         
  DRBD switchover

In system maintenance, or when in a high availability cluster, when the active node fails, when you need to swap the roles of master and slave node, standby switch node has two forms, namely, to stop switching and normal switching service DRBD

(1) Stop DRBD service switch

Close the active node service, then mount the DRBD partition automatically uninstall the primary node, as follows,

/etc/init.d/drbd stop

cat / proc / drbd

You can see from the output, the current state of the master node becomes "Unknown" then performs handover command on the standby node

drbdadm primary all

Or the following error message appears

2: State change failed: (- 7) Refusing to be Primary while peer is not outdated Command 'drbdsetup 2 primary' terminated with exit code 11

Therefore, you must execute the following command at the standby node

drbdsetup / dev / drbd0 primary -o

or

drbdadm - --overwrite-data-of-peer primary all

Now you can switch the normal,

cat / proc / drbd

GIT-hash: a798fa7e274428a357657fb52f0ecf40192c1985 build by phil @ Build64R6, 2014-11-24 14:51:37

0: cs: Connected ro: Primary / Unknown ds: UpToDate / Outdated C r -----

ns: 10482024 nr: 0 dw: 0 dr: 10482696 al: 0 bm: 640 lo: 0 pe: 0 ua: 0 ap: 0 ep: 1 wo: f oos: 0

As can be seen, the original standby node is already in "Primary" the state, and the original master node due to the DRBD service is not started, is still in the "Unknown" status after the original primary node to start the service, it will automatically become "Secondary" state, without performing a switch to a backup node command again on the original primary node

Finally, on the new master node DRBD device mounted to complete the switchover: mount / dev / drbd0 / mnt (custom directories)

(2) normal switch

First uninstall the disk partition on the primary node

umount / mnt (your mount point)

Then execute:

drbdadm secondary all

At this view DRBD states are as follows:

GIT-hash: a798fa7e274428a357657fb52f0ecf40192c1985 build by phil @ Build64R6, 2014-11-24 14:51:37

0: cs: Connected ro: Primary / Unknown ds: UpToDate / UpToDate C r -----

ns: 10482024 nr: 0 dw: 0 dr: 10482696 al: 0 bm: 640 lo: 0 pe: 0 ua: 0 ap: 0 ep: 1 wo: f oos: 0

You can see, both nodes are in "Secondary" state, then the next step is to specify a primary node, you need to perform on the server becomes the master node following command

drbdadm primary all

Finally mount the DRBD disk in the new master node points to go

mount / dev / drbd0 / mnt
     
         
       
         
  More:      
 
- Ubuntu 12.04 installed OpenCV 2.3.1, binary image (Linux)
- Use Redis as time-series database: why and how (Database)
- Oracle 10046 Event (Database)
- Sublime Text 3 best features, plug-ins and settings (Linux)
- Linux Learning Notes: Users and Groups (Linux)
- Hibernate + JUnit test entity class generate database table (Programming)
- Let Git variety of colors and custom log format output (Linux)
- Use IP address spoofing Intrusion Prevention Firewall (Linux)
- Ubuntu 14.04 LTS 64-bit installation and activation Sublime Text 3 can not solve the Chinese input method to solve the problem (Linux)
- Nginx Module Development - get user ip (Server)
- Fedora 20 Installation and Configuration (Linux)
- Glibc support encryption by modifying the DNS (Programming)
- Ubuntu file security removal tool (Linux)
- Variables Python variables (Programming)
- Android Launcher3 Application List Modify a transparent background (Linux)
- Linux6.1 / 6.5 dual-NIC Binding (Linux)
- CentOS Set the Mono environment variable (Server)
- HTTP and HTTPS request response process difference (Linux)
- Use mysqldump backup performed MariaDB (Database)
- Optimized to minimize the installation of CentOS 5.8 (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.