Hello, everyone!
The post will share with you disaster recovery between virtual machine storage through Rsync.
Since the data of the SAP application is stored in the SAP HANA database, the database has its own disaster recovery mechanism. The SR disaster recovery VM is deployed on the DR site. Only the disk data of the DC1-DC2 SAP application VM can be synchronized to the DR site. The amount of changed data is small, and real-time synchronization is not required. The Rsync mode can meet the needs.
Proceed as follows:
1. Execute ps -ef|grep rsync to check if Rsync is installed under the Linux system. (Please refer to the separate information for the installation method, not described here)
2. Confirm with the application side the source and destination virtual machines that need to be disaster-tolerant, and the directories that need to be copied. It is not necessary to copy the virtual machine system disk as a whole.
3. The command script for preparing sysnc replication is as follows. The following are only examples, and are adjusted according to actual business needs:
#!/usr/bin/expect Set timeout 60 Set passwdfile "/rsynctest/passwd.txt" Set fid [open $passwdfile r] While {[gets $fid line] >= 0} { Set password [lindex $line 0] # puts "P: $Password\n" } Close $fid Spawn rsync -avprW -AX --progress --partial --delete root@xxx.xxx.xxx.xxx:/rsynctest/test001/ /rsynctest/test001 Expect "Password:" Send "$password\n" #interact Expect eof
4. Add to the scheduled task, cycle execution, and automatically synchronize the DC1-DC2 SAP service VM disk data to the disaster recovery VM of the DR site.
0 * * * * /rsynctest/rc_1.exp >> /rsynctest/sync.log
This is what I want to share with you today, thank you!