|
11 | 11 | from util import pxc_startup
|
12 | 12 | from util import ps_startup
|
13 | 13 |
|
| 14 | +backup_dir="" |
14 | 15 |
|
15 | 16 | class Utility:
|
16 | 17 | def __init__(self, debug):
|
@@ -166,6 +167,12 @@ def pxb_backup(self, workdir, source_datadir, socket, encryption, dest_datadir=N
|
166 | 167 | print(copy_backup)
|
167 | 168 | os.system(copy_backup)
|
168 | 169 |
|
| 170 | + # Set backup dir |
| 171 | + global backup_dir |
| 172 | + backup_dir=workdir + "/backup" |
| 173 | + if self.debug == 'YES': |
| 174 | + print("Backup dir path: ", backup_dir) |
| 175 | + |
169 | 176 | # Copy keyring file to destination directory for encryption startup
|
170 | 177 | if encryption == 'YES':
|
171 | 178 | os.system("cp " + source_datadir + "/keyring " + dest_datadir)
|
@@ -267,10 +274,14 @@ def invoke_replication(self, basedir, master_socket, slave_socket, repl_mode, co
|
267 | 274 | if self.debug == 'YES':
|
268 | 275 | print(data_dir)
|
269 | 276 | data_dir = os.popen(data_dir).read().rstrip()
|
270 |
| - query = "cat " + data_dir + "xtrabackup_binlog_pos_innodb | awk '{print $1}'" |
| 277 | + query = "cat " + backup_dir + "/xtrabackup_binlog_info | awk '{print $1}'" |
271 | 278 | master_log_file = os.popen(query).read().rstrip()
|
272 |
| - query = "cat " + data_dir + "xtrabackup_binlog_pos_innodb | awk '{print $2}'" |
| 279 | + query = "cat " + backup_dir + "/xtrabackup_binlog_info | awk '{print $2}'" |
273 | 280 | master_log_pos = os.popen(query).read().rstrip()
|
| 281 | + if self.debug == 'YES': |
| 282 | + print("Binlog data from xtrabackup_binlog_info") |
| 283 | + print("master_log_file: ", master_log_file) |
| 284 | + print("master_log_pos: ", master_log_pos) |
274 | 285 | else:
|
275 | 286 | master_log_file = basedir + "/bin/mysql --user=root --socket=" + \
|
276 | 287 | master_socket + \
|
|
0 commit comments