Mydumper To S3
A tool that can upload mydumper dumped files to S3 bucket.
It works even while mydumper is running, for mydumper opened files, mydumper2s3
will wait mydumper to close those files then upload. --delete-after-upload
option enables you to backup your MySQL without dumping all of your data to
local disk.
It works like this:
+-----------+
| mydumper |
+-----+-----+
|
|
v
+-----+------+ upload +-------------+ +------+
| local disk +----------> mydumper2s3 +------> s3 |
| <----------+ | |bucket|
+------------+ delete +-------------+ +------+
after
upload
Install
pip install mydumper2s3
Usage
Check help:
$ mydumper2s3 --help
Usage: mydumper2s3.py [OPTIONS]
mydumper2s3: upload mydumper dumped files to s3 bucket. It works even
while mydumper is running!
Options:
-a, --access_key TEXT S3 access_key
-s, --secret_key TEXT S3 secret_key
-d, --domain TEXT S3 domain
-b, --bucket TEXT S3 bucket, if not spcified, a new bucket
named by directory will be created
-l, --path TEXT
-i, --check-interval INTEGER
--ssl / --no-ssl
-t, --upload-thread INTEGER thread numbers used to upload to s3
--delete-after-upload / --no-delete-after-upload
if set to True, files will be deleted in
local space after uploading.
--help Show this message and exit.
Example
Upload files to S3 (If mydumper is running, you can still using this command, mydumper2s3 will search mydumper process pid and watch files opended by mydumper.):
$ mydumper2s3 --domain 127.0.0.1:9000 \
--bucket test1 \
--path ~/Downloads/target \
--access_key AKIAIOSFODNN7EXAMPLE \
--secret_key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \
--upload-thread=10
138 files in directory, 0 dumping, 0 uploading, 138 uploaded.
138 files successfully uploaded.
You can check the backup with this command (available in your $PATH after install mydumper2s3):
$ verify-dump --domain 127.0.0.1:9000 \
--bucket test1 \
--path ~/Downloads/target \
--access_key AKIAIOSFODNN7EXAMPLE \
--secret_key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
All files are exist both on local and on S3, file name check pass...
start verifying file's md5, file count: 138.
(1/138) verifying metadata...pass
(2/138) verifying test-schema-create.sql...pass
(3/138) verifying test.foo_event-schema.sql...pass
(4/138) verifying test.foo_event_alarms-schema.sql...pass
(5/138) verifying test.foo_list-schema.sql...pass
…
Development
Run monio locally
docker run -p 9000:9000 \
-e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
-e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
minio/minio server /data
Release files for mydumper2s3 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mydumper2s3-0.1.6.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mydumper2s3-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / mydumper2s3-0.1.6.tar.gz
| Download URL | mydumper2s3-0.1.6.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2f60c6b442dd6ea51253dd2263788351f27cc1bfddc7532fd98194cf8b76887
|
|
BLAKE2b-256 checksum How to use checksums |
538a1ca8069572bf7fcb51c3439e631b7a2225af083da834e213bba13e9408eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.7.9 Linux/4.15.0-1095-azure
|
Release files / mydumper2s3-0.1.6-py3-none-any.whl
| Download URL | mydumper2s3-0.1.6-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e935938e4da52418707a21c402b3e5dbfe3c7a8a484e3a89b3919d1a4fc66ae2
|
|
BLAKE2b-256 checksum How to use checksums |
3501654a1538ed96b52521225d7b9e63eba1f481179653fea8cd9a30855e9a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.7.9 Linux/4.15.0-1095-azure
|