# Can we stream backup to GCP by having MySQL server and Xtrabackup on two different hosts

**URL:** <https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969>\
**Category:** MySQL & MariaDB\
**Created:** [June 11, 2024, 10:28am UTC](https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969 "2024-06-11T10:28:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hazarath\_Reddy\_Nukar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hazarath_reddy_nukar/32/14816_2.png) [@Hazarath\_Reddy\_Nukar](https://forums.percona.com/u/Hazarath_Reddy_Nukar)\
**Post date:** [June 11, 2024, 10:28am UTC](https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969/1 "2024-06-11T10:28:38Z")

</div>

Hi,

I am having MySQL Container in one pod and xtrabackup container in another POD. While I am trying to stream data to GCP I am getting below error. I am using the 8.0.35 version of MySQL and Xtrabackup.

**Command used on the xtrabackup container:**

xtrabackup --backup --stream=xbstream --target-dir=/tmp/xtrabackup --compress --compress-threads=1 --stream=xbstream --parallel=1 --host=“_._._._” --user=root | xbcloud put --storage=google --google-endpoint=‘[storage.googleapis.com](http://storage.googleapis.com)’ --google-access-key=‘’ --google-secret-key=‘’ --google-bucket=‘’ --google-storage-class=’ --google-region=‘asia-south1’ --parallel= $(date “+%F-%H-%M-%S”)-backup-full

**Error Logs:**

**2024-06-11T09:39:08.731849-00:00 0 [ERROR] [MY-011825] [Xtrabackup] file ‘/var/lib/mysql/binlog.000006’ is smaller than 273**  
**2024-06-11T09:39:08.731993-00:00 0 [ERROR] [MY-011825] [Xtrabackup] copy\_file() failed.**  
**240611 09:39:09 xbcloud: [0] successfully uploaded chunk: 2024-06-11-09-38-15-backup-full/performance\_schema/keyring\_componen\_202.sdi.zst.00000000000000000000, size: 950**  
**240611 09:39:28 xbcloud: [0] successfully uploaded chunk: 2024-06-11-09-38-15-backup-full/performance\_schema/keyring\_componen\_202.sdi.zst.00000000000000000001, size: 61**  
**240611 09:39:28 xbcloud: Upload failed: backup is incomplete.**  
**Backup doesn’t contain last file with prefix xtrabackup\_tablespaces in the cloud storage**

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 12, 2024, 10:05pm UTC](https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969/2 "2024-06-12T22:05:59Z")

</div>

> [@Hazarath\_Reddy\_Nukar](#):
>
> xbcloud: Upload failed: backup is incomplete.

This is suspicious. Is this reproducible? Did you mount the mysql datadir into the PXB pod?

---

<div class="post-metadata">

**Author:** ![Hazarath\_Reddy\_Nukar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hazarath_reddy_nukar/32/14816_2.png) [@Hazarath\_Reddy\_Nukar](https://forums.percona.com/u/Hazarath_Reddy_Nukar)\
**Post date:** [June 14, 2024, 7:10am UTC](https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969/3 "2024-06-14T07:10:36Z")

</div>

> [@Hazarath\_Reddy\_Nukar](#):
>
> **2024-06-11T09:39:08.731849-00:00 0 [ERROR] [MY-011825] [Xtrabackup] file ‘/var/lib/mysql/binlog.000006’ is smaller than 273**

@matthewb ,

I aim to have a MySQL server on one pod and Xtrabackup on the other pod(PVC is not shared between two pods). After referring this ticket [Xtrabackup: copy\_file() failed - #2 by matthewb](https://forums.percona.com/t/xtrabackup-copy-file-failed/28264/2) seems it is not possible.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 14, 2024, 7:12pm UTC](https://forums.percona.com/t/can-we-stream-backup-to-gcp-by-having-mysql-server-and-xtrabackup-on-two-different-hosts/30969/4 "2024-06-14T19:12:09Z")

</div>

Hi @Hazarath_Reddy_Nukar, yes, you cannot do that. Xtrabackup (PXB) is a physical backup tool and requires direct access to the data files of MySQL. You can run PXB directly inside the MySQL pod, if you still want to use PXB. Otherwise, you will need to use a logical backup tool from an external pod.
