SlideShare una empresa de Scribd logo
1 de 39
DRBD é um amigo!
What is DRBD?
• DRBD is a block device designed as a building
block to form HA clusters.
• This is done by mirroring a whole block device
via an assigned network.
• DRBD can be understand as network based
RAID1.
• T uses DRBD-8.2, S uses DRBD-8.4
(may change in the future).
Block device (Kernel component)
File system
Buffer cache
Block device
Disk sched
Disk driver
DRBD sends I/O to the other node
File system
Buffer cache
DRBD
Disk sched
Disk driver
WRITE ops are sent
to secondary over
network
Data flow in kernel land
How to set up DRBD
• Prepare DRBD partitions
• Create setup files
/etc/drbd.conf (DRBD-8.2)
/etc/drbd.d/global_common.conf (DRBD-8.4)
/etc/drbd.d/r0.res,r1.res (DRBD-8.4)
• Start DRBD sync
DRBD settings
• In DRBD-8.2,
all the settings are in /etc/drbd.conf
• In DRBD-8.4,
global settings in /etc/drbd.d/global_common.conf
resource level settings in /etc/drbd.d/r<N>.res
• Sample:
http://www.drbd.org/users-guide/re-drbdconf.html
• HA1 and HA2 have the identical DRBD config files
• Usage-count (always no)
• Protocol (C  WRITE completes when reached the other node as
well)
• Sync rate (100MB/sec for sync  no need for 10Gb NIC)
• Partition name (device minor # for /dev/drbdN)
• Node name / IP address / port number
Sampe drbd.conf (1)
• global {
• usage-count no;
• }
• common {
• net {
• protocol C;
• }
• syncer {
• rate 100M;
• }
• }
Sample drbd.conf (2)
• resource r0 {
• protocol C;
• on Machine-HA1 { (must match what “uname –n” says on HA1)
• device /dev/drbd1;
• disk /dev/disk/by-label/XX;
• address 10.0.128.17:7788;
• }
• on Machine-HA2 { (must match what “uname –n” says on HA2)
• device /dev/drbd1;
• disk /dev/disk/by-label/XX;
• address 10.0.128.18:7788;
• }
• }
• [root@Machine-HA2 ~]# uname -n
• Machine-HA2
• [root@Machine-HA2 ~]#
Resource and Role
• In DRBD, every resource (partition) has a role,
which may be primary or secondary.
• A primary DRBD device can be used for any
read/write operations.
• A DRBD secondary device can NOT be used for
any read/write operations.
• Secondary only receives WRITEs from primary.
Connection state
• DRBD always uses bond1
HA1: 10.0.128.17 (ping drbd1)
HA2: 10.0.128.18 (ping drbd2)
Monitor DRBD (1)
Healthy state
Shutdown bond1
Monitor DRBD (2)
Enabled bond1 again
DRBD became WFC status (Waiting For Connection)
Nothing can separate DRBD
Nada pode separar DRBD
What causes DRBD problems
There are 3 types of problems.
1. Network error (bond1)
 Outdated
2. Disk error (disk error or filesystem error)
 Diskless
3. Role change without sync
(typically caused by multiple host reboots)
 Inconsistent
1. Network problem
• When bond1 stops working between HA1 and
HA2, DRBD devices on standby node becomes
Outdated
How to fix? 
• Fix the network issue at first.
• Then DRBD will fix automatically.
• Without heartbeat, you may need manual
intervention.
Healthy State
Bond1 stopped (ifdown bond1)
CS (connection Status) becomes WFConnection (Waiting For Connection).
ST (Status) becomes Unknown on peer side.
DS (Disk Status) becomes Outdated on secondary devices.
How to fix
• Find where the problem is. It can be bond1 on
HA1 or bond1 on HA2, or the network cable.
• Fix the network issue.
• Then the DRBD problem will be fixed
automatically.
• If heartbeat is NOT running, DRBD may not be
fixed automatically.
Disk I/O error on secondary
• DRBD device will be Detached automatically
upon disk error.
• drbd.conf
Resource r0 {
disk {
on-io-error detach;
}
}
Disk I/O error on secondary
• Upon disk error, drbdadm detach <res> will run.
Secondary devices become Diskless state. After fixing the disk issue,
You need to attach drbdadm attach all
If the internal data on the disk is broken, sync will run from UpToDate
device to the peer.
• Fix the disk issue at first.
• Then run drbdadm attach all
• Sync may run.
Disk I/O error on secondary
Disk I/O error on primary
• If disk I/O error happened on primary, Primary
DRBD devices become Diskless.
Disk I/O error on primary
• Fix the disk issue at first. Then run
drbdadm attach all on the bad node.
• Sync will run from UpToDate (secondary) to
Inconsistent (Primary).
• Attach/Detach
 attaches/detaches lower disks
• Connect/Disconnect
 connect-to/disconnect-from peer node
• Primary/Secondary
 define the role of resource
• Invalidate
 invalidate the data
• Pre-DRBD-8.4
drbdadm -- --discard-my-data connect <res>
DRBD-8.4
drbdadm connect --discard-my-data <res>
 discard data on the resource
How to check if split-brain happens
• Once SB happens, you see
Split-Brain detected, dropping connection!
In /var/log/messages
• When SB happens, at least one node becomes
StandAlone. The peer can be WFConnection
or StandAlone too.
• If SB happens, you need to discard data on
one node.
Sample plan to fix SB (1)
1. Take hostbackup
2. Identify the bad host
3. Identify which are primary and secondary
(DRBD)
4. Stop DB
service heartbeat stop (HA1/HA2)
make sure DRBD partitions are not mounted
Sample plan to fix SB (2)
• drbdadm disconnect all (HA1 / HA2)
• drbdadm secondary all (HA1 / HA2)
• drbdadm disconnect all (HA1 / HA2)
• drbdadm -- --discard-my-data connect all
(only on bad host)
• drbdadm connect all (good host)
• drbdadm connect all (bad host)
Sample plan to fix SB (3)
5. Start heartbeat on the good host to make it
Primary.
How to use nzhostbackup
• When DB is online, run nzhostback by NZ user
• Use destination /nzscratch if available
• In Mustang, /nzscratch may not be available.
You can use /var/tmp/. Don’t use /nz/ or
/export/home/nz to store backup files.
• Use date and host (ha1 or ha2) name for the
backup filename
It does not take long (5~10min)
• Run nzhostbakup when db is online
• $ nzhostbackup /nzscratch/backup.2013-09-08-ha2.1
• Starting host backup. System state is 'online'.
• Pausing the system ...
• Checkpointing host catalog ...
• Archiving system catalog ...
• Resuming the system ...
• Host backup completed successfully. System state is 'online'.
• $
nzhostrestore (1)
• $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1
• Starting host restore
• nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08-
ha2.1
• Extracting host data archive ...
• Restore host data archived Sun Sep 8 08:40:10 EDT 2013? (y/n) [n] y
• Stopping the system ...
• Starting topology restore ...
• Stopping the system ...
• Warning: The restore will now rollback spu data to Sun Sep 8 08:40:10
EDT 2013.
• This operation cannot be undone. Ok to proceed? (y/n) [n]
nzhostrestore (2)
• This operation cannot be undone. Ok to proceed? (y/n) [n] y
• Installing system catalog to '/nz/data.1.0' ...
• Starting the system in host restore mode...
• Synchronizing data on spus ...
• .........................................................................................................................
.............................done.
• Stopping the system ...
• Restore complete. You can now start the system using 'nzstart'.
• $
What if db cannot be online?
• You can run nzhostrestore when DB is
Stopped.
•
• $ nzstate
• System state is 'Stopped'.
• [nz@NZ80641-H2 ~]$ mv /nz/data.1.0 /tmp/
• [nz@NZ80641-H2 ~]$ nzstart
• WARNING: Cannot determine data directory: free space check skipped
• WARNING: Unrecognized limit item: nice
• WARNING: Unrecognized limit item: nice
• WARNING: Search domain 'nzlab.ibm.com' appears multiple times in
/etc/resolv.conf.upstream
• WARNING: Contents of /etc/localtime and zone file
/usr/share/zoneinfo/Europe/London are not the same
• WARNING: System timezone is 'EDT', but
• /etc/sysconfig/clock 'ZONE' is '' (UTC)
• nzstart: Error: '/nz/data' is not a valid data directory
• $
• $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1
• mkdir: cannot create directory `/nz/data': File exists
• $ ls -l /nz/data
• lrwxrwxrwx 1 nz nz 13 May 9 13:46 /nz/data -> /nz/data.1.0/
• $ rm /nz/data
• $ ls -l /nz/data
• ls: /nz/data: No such file or directory
• $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1
• Starting host restore
• nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08-ha2.1
• Extracting host data archive ...
• Unable to determine catalog version of data directory at /nz/data, hence exiting. If
you are sure that catalog versions of current and that of the archived data
directory are same, use the command-line switch -catverok to skip this check.
• NPS system is not running.
• Error, see /nz/kit.dbg.6.0.8.P12/log/nzhostrestore/nzhostrestore.17548.2013-09-
08.log
• $
• $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 -catverok
• Starting host restore
• nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08-ha2.1
• Extracting host data archive ...
• Restore host data archived Sun Sep 8 08:40:10 EDT 2013? (y/n) [n] y
• Stopping the system ...
• NPS system is not running.
• Starting topology restore ...
• Stopping the system ...
• Warning: The restore will now rollback spu data to Sun Sep 8 08:40:10 EDT 2013.
• This operation cannot be undone. Ok to proceed? (y/n) [n] y
• Installing system catalog to '/nz/data' ...
• Starting the system in host restore mode...
• Synchronizing data on spus ...
• ......................................................................................................................................
...............done.
• Stopping the system ...
• Restore complete. You can now start the system using 'nzstart'.
• $
What is backup file?
• TAR GZIP’ed of /nz/data.1.0 directory
• $ cd /nz
• $ tar zcf /tmp/yyy.tgz data
• $ nzhostrestore /tmp/yyy.tgz (which command works)

Más contenido relacionado

La actualidad más candente

Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with PacemakerKris Buytaert
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemakerhastexo
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Rick Branson
 
Fosdem managing my sql with percona toolkit
Fosdem managing my sql with percona toolkitFosdem managing my sql with percona toolkit
Fosdem managing my sql with percona toolkitFrederic Descamps
 
PostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesPostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesSean Chittenden
 
Chaining 7 vulnerabilities in Citrix ShareFile On-Premise
Chaining 7 vulnerabilities in Citrix ShareFile On-PremiseChaining 7 vulnerabilities in Citrix ShareFile On-Premise
Chaining 7 vulnerabilities in Citrix ShareFile On-PremiseJohanna Curiel
 
Hadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHanborq Inc.
 
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...ORACLE USER GROUP ESTONIA
 
Cassandra Summit EU 2013
Cassandra Summit EU 2013Cassandra Summit EU 2013
Cassandra Summit EU 2013jbellis
 
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...DataStax
 
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...DataStax
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationMydbops
 
HDFS introduction
HDFS introductionHDFS introduction
HDFS introductioninjae yeo
 
The Automation Factory
The Automation FactoryThe Automation Factory
The Automation FactoryNathan Milford
 
Apache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsApache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsJulien Anguenot
 

La actualidad más candente (20)

Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with Pacemaker
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)
 
Fosdem managing my sql with percona toolkit
Fosdem managing my sql with percona toolkitFosdem managing my sql with percona toolkit
Fosdem managing my sql with percona toolkit
 
PostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesPostgreSQL + ZFS best practices
PostgreSQL + ZFS best practices
 
Chaining 7 vulnerabilities in Citrix ShareFile On-Premise
Chaining 7 vulnerabilities in Citrix ShareFile On-PremiseChaining 7 vulnerabilities in Citrix ShareFile On-Premise
Chaining 7 vulnerabilities in Citrix ShareFile On-Premise
 
Hadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHadoop HDFS Detailed Introduction
Hadoop HDFS Detailed Introduction
 
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...
Why Exadata wins - real exadata case studies from Proact portfolio - Fabien d...
 
MySQL on ZFS
MySQL on ZFSMySQL on ZFS
MySQL on ZFS
 
Interacting with hdfs
Interacting with hdfsInteracting with hdfs
Interacting with hdfs
 
Cassandra Summit EU 2013
Cassandra Summit EU 2013Cassandra Summit EU 2013
Cassandra Summit EU 2013
 
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...
Lessons from Cassandra & Spark (Matthias Niehoff & Stephan Kepser, codecentri...
 
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
What is in All of Those SSTable Files Not Just the Data One but All the Rest ...
 
Apache Spark RDD 101
Apache Spark RDD 101Apache Spark RDD 101
Apache Spark RDD 101
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL Administration
 
HDFS introduction
HDFS introductionHDFS introduction
HDFS introduction
 
The Automation Factory
The Automation FactoryThe Automation Factory
The Automation Factory
 
Apache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsApache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentials
 

Similar a Romanticos com drbd 2

High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-costnormanmaurer
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLFromDual GmbH
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatChris Barber
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: RevisionDamian T. Gordon
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device ManagementDamian T. Gordon
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with PacemakerKris Buytaert
 
Disaster recovery of OpenStack Cinder using DRBD
Disaster recovery of OpenStack Cinder using DRBDDisaster recovery of OpenStack Cinder using DRBD
Disaster recovery of OpenStack Cinder using DRBDViswesuwara Nathan
 
Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)mundlapudi
 
Migrating to XtraDB Cluster
Migrating to XtraDB ClusterMigrating to XtraDB Cluster
Migrating to XtraDB Clusterpercona2013
 
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)Raid Data Recovery
 
Congratsyourthedbatoo
CongratsyourthedbatooCongratsyourthedbatoo
CongratsyourthedbatooDave Stokes
 
openbsd-as-nas.pdf
openbsd-as-nas.pdfopenbsd-as-nas.pdf
openbsd-as-nas.pdfssuserabc40f
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment StrategyMongoDB
 
Open Source Data Deduplication
Open Source Data DeduplicationOpen Source Data Deduplication
Open Source Data DeduplicationRedWireServices
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)MongoDB
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File SystemRutvik Bapat
 

Similar a Romanticos com drbd 2 (20)

High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQL
 
High Availability With DRBD & Heartbeat
High Availability With DRBD & HeartbeatHigh Availability With DRBD & Heartbeat
High Availability With DRBD & Heartbeat
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: Revision
 
Docker
DockerDocker
Docker
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with Pacemaker
 
Disaster recovery of OpenStack Cinder using DRBD
Disaster recovery of OpenStack Cinder using DRBDDisaster recovery of OpenStack Cinder using DRBD
Disaster recovery of OpenStack Cinder using DRBD
 
Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)
 
testing-nfs
testing-nfstesting-nfs
testing-nfs
 
Hadoop admin
Hadoop adminHadoop admin
Hadoop admin
 
Spark architechure.pptx
Spark architechure.pptxSpark architechure.pptx
Spark architechure.pptx
 
Migrating to XtraDB Cluster
Migrating to XtraDB ClusterMigrating to XtraDB Cluster
Migrating to XtraDB Cluster
 
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
 
Congratsyourthedbatoo
CongratsyourthedbatooCongratsyourthedbatoo
Congratsyourthedbatoo
 
openbsd-as-nas.pdf
openbsd-as-nas.pdfopenbsd-as-nas.pdf
openbsd-as-nas.pdf
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment Strategy
 
Open Source Data Deduplication
Open Source Data DeduplicationOpen Source Data Deduplication
Open Source Data Deduplication
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File System
 

Último

Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Introduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxIntroduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxJaiLegal
 
SM-N975F esquematico completo - reparación.pdf
SM-N975F esquematico completo - reparación.pdfSM-N975F esquematico completo - reparación.pdf
SM-N975F esquematico completo - reparación.pdfStefanoBiamonte1
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...Call Girls in Nagpur High Profile
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)kojalkojal131
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...MOHANI PANDEY
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...amitlee9823
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussDrMSajidNoor
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...Pooja Nehwal
 

Último (20)

Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
Introduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptxIntroduction-to-4x4-SRAM-Memory-Block.pptx
Introduction-to-4x4-SRAM-Memory-Block.pptx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SM-N975F esquematico completo - reparación.pdf
SM-N975F esquematico completo - reparación.pdfSM-N975F esquematico completo - reparación.pdf
SM-N975F esquematico completo - reparación.pdf
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
 
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discuss
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Th...
 

Romanticos com drbd 2

  • 1. DRBD é um amigo!
  • 2. What is DRBD? • DRBD is a block device designed as a building block to form HA clusters. • This is done by mirroring a whole block device via an assigned network. • DRBD can be understand as network based RAID1. • T uses DRBD-8.2, S uses DRBD-8.4 (may change in the future).
  • 3. Block device (Kernel component) File system Buffer cache Block device Disk sched Disk driver
  • 4. DRBD sends I/O to the other node File system Buffer cache DRBD Disk sched Disk driver WRITE ops are sent to secondary over network
  • 5. Data flow in kernel land
  • 6. How to set up DRBD • Prepare DRBD partitions • Create setup files /etc/drbd.conf (DRBD-8.2) /etc/drbd.d/global_common.conf (DRBD-8.4) /etc/drbd.d/r0.res,r1.res (DRBD-8.4) • Start DRBD sync
  • 7. DRBD settings • In DRBD-8.2, all the settings are in /etc/drbd.conf • In DRBD-8.4, global settings in /etc/drbd.d/global_common.conf resource level settings in /etc/drbd.d/r<N>.res • Sample: http://www.drbd.org/users-guide/re-drbdconf.html • HA1 and HA2 have the identical DRBD config files • Usage-count (always no) • Protocol (C  WRITE completes when reached the other node as well) • Sync rate (100MB/sec for sync  no need for 10Gb NIC) • Partition name (device minor # for /dev/drbdN) • Node name / IP address / port number
  • 8. Sampe drbd.conf (1) • global { • usage-count no; • } • common { • net { • protocol C; • } • syncer { • rate 100M; • } • }
  • 9. Sample drbd.conf (2) • resource r0 { • protocol C; • on Machine-HA1 { (must match what “uname –n” says on HA1) • device /dev/drbd1; • disk /dev/disk/by-label/XX; • address 10.0.128.17:7788; • } • on Machine-HA2 { (must match what “uname –n” says on HA2) • device /dev/drbd1; • disk /dev/disk/by-label/XX; • address 10.0.128.18:7788; • } • } • [root@Machine-HA2 ~]# uname -n • Machine-HA2 • [root@Machine-HA2 ~]#
  • 10. Resource and Role • In DRBD, every resource (partition) has a role, which may be primary or secondary. • A primary DRBD device can be used for any read/write operations. • A DRBD secondary device can NOT be used for any read/write operations. • Secondary only receives WRITEs from primary.
  • 11. Connection state • DRBD always uses bond1 HA1: 10.0.128.17 (ping drbd1) HA2: 10.0.128.18 (ping drbd2)
  • 12. Monitor DRBD (1) Healthy state Shutdown bond1
  • 13. Monitor DRBD (2) Enabled bond1 again DRBD became WFC status (Waiting For Connection)
  • 16. What causes DRBD problems There are 3 types of problems. 1. Network error (bond1)  Outdated 2. Disk error (disk error or filesystem error)  Diskless 3. Role change without sync (typically caused by multiple host reboots)  Inconsistent
  • 17. 1. Network problem • When bond1 stops working between HA1 and HA2, DRBD devices on standby node becomes Outdated How to fix?  • Fix the network issue at first. • Then DRBD will fix automatically. • Without heartbeat, you may need manual intervention.
  • 19. Bond1 stopped (ifdown bond1) CS (connection Status) becomes WFConnection (Waiting For Connection). ST (Status) becomes Unknown on peer side. DS (Disk Status) becomes Outdated on secondary devices.
  • 20. How to fix • Find where the problem is. It can be bond1 on HA1 or bond1 on HA2, or the network cable. • Fix the network issue. • Then the DRBD problem will be fixed automatically. • If heartbeat is NOT running, DRBD may not be fixed automatically.
  • 21. Disk I/O error on secondary • DRBD device will be Detached automatically upon disk error. • drbd.conf Resource r0 { disk { on-io-error detach; } }
  • 22. Disk I/O error on secondary • Upon disk error, drbdadm detach <res> will run. Secondary devices become Diskless state. After fixing the disk issue, You need to attach drbdadm attach all If the internal data on the disk is broken, sync will run from UpToDate device to the peer.
  • 23. • Fix the disk issue at first. • Then run drbdadm attach all • Sync may run. Disk I/O error on secondary
  • 24. Disk I/O error on primary • If disk I/O error happened on primary, Primary DRBD devices become Diskless.
  • 25. Disk I/O error on primary • Fix the disk issue at first. Then run drbdadm attach all on the bad node. • Sync will run from UpToDate (secondary) to Inconsistent (Primary).
  • 26. • Attach/Detach  attaches/detaches lower disks • Connect/Disconnect  connect-to/disconnect-from peer node • Primary/Secondary  define the role of resource • Invalidate  invalidate the data • Pre-DRBD-8.4 drbdadm -- --discard-my-data connect <res> DRBD-8.4 drbdadm connect --discard-my-data <res>  discard data on the resource
  • 27. How to check if split-brain happens • Once SB happens, you see Split-Brain detected, dropping connection! In /var/log/messages • When SB happens, at least one node becomes StandAlone. The peer can be WFConnection or StandAlone too. • If SB happens, you need to discard data on one node.
  • 28. Sample plan to fix SB (1) 1. Take hostbackup 2. Identify the bad host 3. Identify which are primary and secondary (DRBD) 4. Stop DB service heartbeat stop (HA1/HA2) make sure DRBD partitions are not mounted
  • 29. Sample plan to fix SB (2) • drbdadm disconnect all (HA1 / HA2) • drbdadm secondary all (HA1 / HA2) • drbdadm disconnect all (HA1 / HA2) • drbdadm -- --discard-my-data connect all (only on bad host) • drbdadm connect all (good host) • drbdadm connect all (bad host)
  • 30. Sample plan to fix SB (3) 5. Start heartbeat on the good host to make it Primary.
  • 31. How to use nzhostbackup • When DB is online, run nzhostback by NZ user • Use destination /nzscratch if available • In Mustang, /nzscratch may not be available. You can use /var/tmp/. Don’t use /nz/ or /export/home/nz to store backup files. • Use date and host (ha1 or ha2) name for the backup filename
  • 32. It does not take long (5~10min) • Run nzhostbakup when db is online • $ nzhostbackup /nzscratch/backup.2013-09-08-ha2.1 • Starting host backup. System state is 'online'. • Pausing the system ... • Checkpointing host catalog ... • Archiving system catalog ... • Resuming the system ... • Host backup completed successfully. System state is 'online'. • $
  • 33. nzhostrestore (1) • $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 • Starting host restore • nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08- ha2.1 • Extracting host data archive ... • Restore host data archived Sun Sep 8 08:40:10 EDT 2013? (y/n) [n] y • Stopping the system ... • Starting topology restore ... • Stopping the system ... • Warning: The restore will now rollback spu data to Sun Sep 8 08:40:10 EDT 2013. • This operation cannot be undone. Ok to proceed? (y/n) [n]
  • 34. nzhostrestore (2) • This operation cannot be undone. Ok to proceed? (y/n) [n] y • Installing system catalog to '/nz/data.1.0' ... • Starting the system in host restore mode... • Synchronizing data on spus ... • ......................................................................................................................... .............................done. • Stopping the system ... • Restore complete. You can now start the system using 'nzstart'. • $
  • 35. What if db cannot be online? • You can run nzhostrestore when DB is Stopped. •
  • 36. • $ nzstate • System state is 'Stopped'. • [nz@NZ80641-H2 ~]$ mv /nz/data.1.0 /tmp/ • [nz@NZ80641-H2 ~]$ nzstart • WARNING: Cannot determine data directory: free space check skipped • WARNING: Unrecognized limit item: nice • WARNING: Unrecognized limit item: nice • WARNING: Search domain 'nzlab.ibm.com' appears multiple times in /etc/resolv.conf.upstream • WARNING: Contents of /etc/localtime and zone file /usr/share/zoneinfo/Europe/London are not the same • WARNING: System timezone is 'EDT', but • /etc/sysconfig/clock 'ZONE' is '' (UTC) • nzstart: Error: '/nz/data' is not a valid data directory • $
  • 37. • $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 • mkdir: cannot create directory `/nz/data': File exists • $ ls -l /nz/data • lrwxrwxrwx 1 nz nz 13 May 9 13:46 /nz/data -> /nz/data.1.0/ • $ rm /nz/data • $ ls -l /nz/data • ls: /nz/data: No such file or directory • $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 • Starting host restore • nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 • Extracting host data archive ... • Unable to determine catalog version of data directory at /nz/data, hence exiting. If you are sure that catalog versions of current and that of the archived data directory are same, use the command-line switch -catverok to skip this check. • NPS system is not running. • Error, see /nz/kit.dbg.6.0.8.P12/log/nzhostrestore/nzhostrestore.17548.2013-09- 08.log • $
  • 38. • $ nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 -catverok • Starting host restore • nzhostrestore command: nzhostrestore /nzscratch/backup.2013-09-08-ha2.1 • Extracting host data archive ... • Restore host data archived Sun Sep 8 08:40:10 EDT 2013? (y/n) [n] y • Stopping the system ... • NPS system is not running. • Starting topology restore ... • Stopping the system ... • Warning: The restore will now rollback spu data to Sun Sep 8 08:40:10 EDT 2013. • This operation cannot be undone. Ok to proceed? (y/n) [n] y • Installing system catalog to '/nz/data' ... • Starting the system in host restore mode... • Synchronizing data on spus ... • ...................................................................................................................................... ...............done. • Stopping the system ... • Restore complete. You can now start the system using 'nzstart'. • $
  • 39. What is backup file? • TAR GZIP’ed of /nz/data.1.0 directory • $ cd /nz • $ tar zcf /tmp/yyy.tgz data • $ nzhostrestore /tmp/yyy.tgz (which command works)