maorfr / cain Goto Github PK
View Code? Open in Web Editor NEWThis project forked from nuvo/cain
Backup and restore tool for Cassandra on Kubernetes
License: Apache License 2.0
This project forked from nuvo/cain
Backup and restore tool for Cassandra on Kubernetes
License: Apache License 2.0
Hi,
I got the following error when trying to run a cain command:
cain schema -n cassjcarlo -k demodb -l app=cassandracluster
2020/02/10 15:47:40 No Auth Provider found for name "oidc"
I see that cain use the current context from .kube/config file with an out-of-cluster client configuration wich it's my case.
So I decided to try with client-go out-of-cluster-client-configuration example and I Got the same error!
So, I modified the main.go of out-of-cluster-client-configuration and uncomment
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc" line. so I could run the example.
Now that I know where the error comes from, I want to know how authentication is implemented and where I can find the list of plugin used for auth in cain ?
thanks
Hey, I use cain to backup my Cassandra deployment ( I use bitnami chart of Cassandra ). but it will throw an error could not describe schema
. Can you please help how can I resolve this??
kubectl logs -f pod/cassandra-backup-test-1614676800-n6lk4
2021/03/02 09:21:14 Backup started!
2021/03/02 09:21:14 Getting clients
2021/03/02 09:21:14 Getting pods
2021/03/02 09:21:14 Testing existence of data-dir
2021/03/02 09:21:14 Backing up schema
2021/03/02 09:21:17 Could not describe schema. make sure a schema exists for keyspace "test" or restore it using "--schema". error in Stream: command terminated with exit code 1
as discussed in #2, we should print the name of the pod in addition to the existing error.
the fix should be done here: https://github.com/maorfr/cain/blob/master/pkg/utils/path.go#L136
It would be great if there was a distroless flavor of the Docker image (e.g. with gcr.io/distroless/static
as a base image): https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md Please tell me if I should create a pull request.
The base image Alpine 3.8 is a little outdated. It would be great if it could be updated to Alpine 3.16. Please tell me if I should create a pull request.
Hello,
I posted an issue in the upstream nuvo#17 because it had issues already but I post it here too seems it looks like the cain that is up to date.
I'm using cain to backup & restore a cassandra cluster on kubernetes and I have the following error when I restore my cassandra :
2019/09/12 14:54:01 Error with table my_table, found 2 directories
The 2 directories match with my two nodes. The tree of my cain generated in S3 backup looks like that:
bucket
-- default
-- -- Cassandra
-- -- -- keyspace_name
-- -- -- -- schema_id
-- -- -- -- -- tag_name
-- -- -- -- -- -- cassandra-0
-- -- -- -- -- -- -- my_table
-- -- -- -- -- -- cassandra-1
-- -- -- -- -- -- -- my_table
cassandra-0
and cassandra-1
are my pod names
The restore command I used:
./cain restore -n default -l name=cassandra -k keyspace_name --src=s3://bucket/default/Cassandra -t "tag_name" --schema schema_id
The full log:
2019/09/12 14:54:01 Getting current schema
2019/09/12 14:54:01 Found schema: schema_id
2019/09/12 14:54:01 Calculating paths. This may take a while...
2019/09/12 14:54:01 Error with table my_table, found 2 directories
I tried to play a lot with the --src
the tag_name with no luck.
Is there something I am missing regarding the cassandra restore into a multi node cluster?
Right now when you invoke backup then tag is taken from the current timestamp, which may depend on the moment the code was executed.
What would be more useful would be the option to allow providing custom tag (such as in restore). This would allow to use predictable tag names, for example I could set a backup with a daily timestamp, and not need to write extra logic to detect what tags are available on given location to create a restore tag.
If not provided, then fall back to current timestamp, which would make it backward compatible.
We assume that if user provides custom tag then we fail fast in case of trying to overwrite data if the tag already exists.
You can experiment with the docker image by:
docker pull quay.io/kaszpir/cain:latest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.