Innobackupex:을 추출하는 방법 개별 파일에서 xbstream 압축가 백업
-
28-09-2020 - |
문제
우리는 스크립트의 혼합이 완전하고 증분 백업 설치에 대한 우리의 prodcut 백엔드와 함께 일요일 트리거 전체 백업 및 증분 백업에 남아있는 모든 일입니다.
이 과정에서,우리는 우리를 읽을 수 있어야 LSN 의 수에서 파일 전체 백업 파일입니다.
우리가 설치 스크립트를 압축하는 백업으로 xbstream 형식으로 그 결과를 하나의 파일로 압축함으로써 모든 데이터입니다.
지금 질문을 추출하는 방법을 읽거나 LSN 또는 하나의 정보에서 파일을 완료 xbstream 파일입니다.
하지만 우리가 사용할 수있는 로그 파일 이를 위해,우리가 원하는 더 많은 신뢰할 수 있는 솔루션입니다.
감사합니다.
해결책
XtraBackup 로그의 가장 최근의 LSN 지 xtrabackup_info
당신이해야 추출물,하지만 STDERR 도
150731 16:33:28 innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
150731 16:33:28 innobackupex: Waiting for log copying to finish
xtrabackup: The latest check point (for incremental): '1948062848'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1948062848)
LSN 것 1948062848
.문자열 찾기 xtrabackup: The latest check point (for incremental):
출력됩니다.보 http://bazaar.launchpad.net/~twindb-dev/twindb-에이전트/트렁크/보기/head:/twindb.py#L1888 예를 들어:
def grep_lsn(output):
"""
Finds LSN in XtraBackup output
:param output: string with Xtrabackup output
:return: LSN
"""
lsn = None
for line in output.split("\n"):
if line.startswith("xtrabackup: The latest check point (for incremental):"):
lsn = line.split("'")[1]
return lsn
그런 다음 전달 1948062848
가 --incremental-lsn=
하는 경우에는 해당 옵션을 증분 복사본입니다.예제: http://bazaar.launchpad.net/~twindb-dev/twindb-에이전트/트렁크/보기/head:/twindb.py#L1429
if backup_type == 'incremental':
last_lsn = job["params"]["lsn"]
xtrabackup_cmd.append("--incremental")
xtrabackup_cmd.append(".")
xtrabackup_cmd.append("--incremental-lsn=%s" % last_lsn)