Python CLI for cassandra snapshots. CLI allows to store and restore snapshot and uses AWS S3 bucket as storage.
Project description
Python Cassandra CLI tool
Descirptoin
CLI has 7 main commands:
- copy-snapshot-folder Copy folder with snapshots from s3 bucket
- restore-snapshot-keyspace Restore Keyspace snapshot from s3 bucket
- restore-snapshot-table Restore Table snapshot from s3 bucket
- store-snapshot-keyspace Take and store Keyspace snapshot to s3 bucket
- store-snapshot-table Take and store Table snapshot to s3 bucket
- store-backup-keyspace Take and store Keyspace backup to s3 bucket without running nodetool, sstableloader, and cqlsh
- restore-backup-keyspace Restore Keyspace backup from s3 bucket without running nodetool, sstableloader, and cqlsh
Release Notes
1.3.4
- copy backup updates.
1.3.3
- boolean values updates.
1.3.2
- null values updates.
1.3.1
- Increased CSV file field size limit.
- Creation schema fix.
1.3.0
- store-backup-keyspace and restore-backup-keyspace commands which doesn't run nodetool, sstableloader, and cqlsh. It uses only cassandra-driver.
1.2.1
- --truststore-password and --keystore-password options
which is used in sstableloader command in "restore-snapshot-keyspace" and "restore-snapshot-table" - --version option
1.1.1
Clean up code
1.1.0
- Added --ssl flag for cqlsh command if connection supports only SSL connection; --ssl-cqlsh option
- Logic -p flag for sstableloader not mandatory for SSL connection type
- Overriding folder main folder name; --snapshot-folder-override option
1.0.3
Fix option description: create-keyspace-schema
1.0.2
Updated Authentication logic
1.0.1
Added boto3 libs in requirements
1.0.0
Initial release
AWS resources access
AWS S3 bucket
- You need to set -s3(--s3-bucket), -id(--aws-access-key-id) and -key(--aws-secret-access-key) options for the connection to AWS S3 bucket via access key.
- If your host has AWS profile setup in .aws/credentials and/or IAM role with s3 bucket permissons then CLI needs only -s3(--s3-bucket) option.
AWS Systems Manager
- You need to set -sn(--secret-name), -id(--aws-access-key-id) and -key(--aws-secret-access-key) for getting secrest from Paramenter Store.
- If your host has AWS profile setup in .aws/credentials and/or IAM role with SSM permissons then CLI needs only -sn(--secret-name) option.
- Optionally you can change -r(--aws-region) for SSM. Default value is 'us-east-1'
Commands examples:
Store keyspace snapshot on s3
python-cassandra-cli store-snapshot-keyspace
-k my_keyspace
-t tag-01-keyspace
-e dev
-s3 my.s3.bucket
-h "10.99.3.55"
--ssm-secret -sn /cassandra/dev
Store keyspace snapshot on s3 with keyspace schema
python-cassandra-cli store-snapshot-keyspace
-k my_keyspace
-t tag-01-keyspace
-e dev -s3 my.s3.bucket -h "10.99.3.55"
--ssm-secret -sn /cassandra/dev
--create-keyspace-schema
Store table snapshot on s3 with keyspace schema
python-cassandra-cli store-snapshot-table
-k my_keyspace
-tn my_table
-t tag-01-table
-e dev
-s3 my.s3.bucket
-h "10.99.3.55"
--ssm-secret
-sn /cassandra/dev
--create-keyspace-schema
Resotore table
python-cassandra-cli restore-snapshot-table
-sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop
-t tag-01-table
-k my_keyspace
-tn my_table -h "10.99.3.55"
--ssm-secret
-sn /cassandra/dev
-s3 my.s3.bucket
Restore table ssl
python-cassandra-cli restore-snapshot-table
-sf 1608700346_snapshots_tag-01-table_my_table_develop
-t tag-01-table
-k my_keyspace
-tn my_table
-h "10.99.3.55"
--ssm-secret
-s3 my.s3.bucket
-sn /cassandra/dev
-cf /etc/cassandra/conf/cassandra.yaml
-ks /etc/cassandra/conf/keystore.node0
-ts /etc/cassandra/conf/truststore.node0
-ssl
-pt 9142
Restore keyspace ssl with keyspace creation
python-cassandra-cli restore-snapshot-keyspace
-sf 608700346_snapshots_tag-01-keyspace_my_keyspace_develop
-t tag-01-keyspace
-k my_keyspace
-h "10.99.3.55"
--ssm-secret
-s3 my.s3.bucket
-sn /cassandra/dev
--create-keyspace-schema
-e develop
-cf /etc/cassandra/conf/cassandra.yaml
-ks /etc/cassandra/conf/keystore.node0
-ts /etc/cassandra/conf/truststore.node0
-ssl
-pt 9142
Copy folder with sanpshot on local
python-cassandra-cli copy-snapshot-folder
-s3 my.s3.bucket
-sf 1608700346_snapshots_tag-01-keyspace_my_keyspace_develop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-cassandra-cli-1.3.5.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for python-cassandra-cli-1.3.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ff48630bbe57cb533bc75c368984f5f1f5712a4b7195be508deee92ee3d90dd |
|
MD5 | 58766f809734d747d809926e57ef519c |
|
BLAKE2b-256 | 66bd8165d531cb338bae99bc0526cb03cf9cbe004aad4ae201968b2ccf6d241f |
Close
Hashes for python_cassandra_cli-1.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f553b85cc59fac9909ea3b4a9bce6c246155833c955fef6870c30e6a1d9d5942 |
|
MD5 | 5d14fa9a56f44570600910142dfc0204 |
|
BLAKE2b-256 | 6cb429a051ff17299add7b091fdf003d0943f84d5a89220e461bc20c5fb3ba87 |