Environment
- Yugabyte Platform
Issue
- Backup or restore is failing.
Resolution
Overview
There could be many reasons for the failure of backup and restore. This guide will help in getting verbose logs for backup and restore operations.
Steps
- Check the application log which can be accessed through Yugabyte Anywhere.
- If application logs are not helpful, We can run the backup from Yugabyte Anywhere server/pod.
-
- In application logs, Search for 'Command to run' which will give you the exact command which YB anywhere ran in the background when your backup or restore was failed
- The command should look like the below:
bin/py_wrapper bin/yb_backup.py --masters <master-addresses> --ts_web_hosts_ports <tserver-addresses> --parallelism 8 --ysql_port 5433 --table <table-name> --keyspace <keyspace-name> --table_uuid <table-uuid> --no_auto_name --k8s_config <k8s_config> --backup_location <backup_location> --storage_type s3 create
- Once you have the command, Login to yugaware container.
- For Replicated installation
docker exec -it yugaware bash
-
- For Kubernetes installation
kubectl exec -it <pod_name> -n <namespace_name> -c yugaware -- bash
- Copy the command from logs and run it in
--verbose
mode from Yugabyte Anywhere server/pod as shown below:
cd /opt/yugabyte/devops/
bin/py_wrapper bin/yb_backup.py --masters <master-addresses> \
--ts_web_hosts_ports <tserver-addresses> \
--parallelism 8 \
--ysql_port 5433 \
--table <table-name>
--keyspace <keyspace-name> \
--table_uuid <table-uuid> \
--no_auto_name \
--k8s_config <k8s_config> \
--backup_location <backup_location> \
--storage_type s3 \
--verbose \
create
Additionally, You can run it nohup mode and redirect logs to any file.
Note
- Before running the above command, we have to configure the environment.
- If the backup location is S3, MinIO storage any other AWS S3 compatible storage, We have to export the below environment variables:
export AWS_ACCESS_KEY_ID=access-key
export AWS_SECRET_ACCESS_KEY=secret-access-key
export AWS_DEFAULT_REGION=us-west-2
export AWS_HOST_BASE=host-base
export PATH_STYLE_ACCESS=true
export GCS_CREDENTIALS_JSON='{
"type": "everything_here_is_dummy",
"project_id": "yb-support-298620",
"private_key_id": "ae206b9cfdd4e2a7436fxxxxxxxxxx",
"private_key": "-----BEGIN PRIVATE KEY-----\xxxxxxxx=\n-----END PRIVATE KEY-----\n",
"client_email": "yj-xxxxxxiam.gserviceaccount.com",
"client_id": "10655681xxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/yjxxxxxxort-298620.iam.gserviceaccount.com"
}'
Comments
0 comments
Please sign in to leave a comment.