Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riak-admin automation options #62

Open
danieldreier opened this issue Apr 2, 2015 · 4 comments
Open

riak-admin automation options #62

danieldreier opened this issue Apr 2, 2015 · 4 comments

Comments

@danieldreier
Copy link
Collaborator

I'm hoping to write types and providers in puppet that wrap riak-admin, for the purpose of automating cluster management operations. For example, we could change ring size in the live cluster, change config files, etc and do that all in the correct order automatically to avoid user error in manual change. Similarly, it would be great to automate the process of joining new nodes to a cluster, safely removing nodes, etc.

I'd really appreciate any input on other automation-friendly options for interacting with the functionality provided by riak-admin. I can't find analogous HTTP API endpoints, can't find a way to get JSON (or other structured output) from riak-admin, etc.

The two options I see are to either wrap riak-admin and parse the text output, or to improve my very basic erlang skills and use whatever libraries riak-admin uses to implement the functionality I need. However, the latter is likely to involve months of me learning a new language before I'm productive, and the former is a bit awkward, though common enough in the puppet world.

Are those the only options?

@mbbroberg
Copy link
Contributor

The short answer is no, there is no HTTP API endpoints for admin.

The longer.. messier answer is that there are an undocumented few commands that have a --format flag, including cluster status. You can choose --format=csv or --format=json.

The trick is I have no idea which ones support it yet.. I have to dive into code and don't have the bandwidth to do so at the moment. Just FYI and we can research this further.

@danieldreier
Copy link
Collaborator Author

That's actually quite helpful. I'll just experiment as I go and see if the commands support the --format=json parameter. Do you know if that's intended as a reasonably stable interface? If it's deprecated or otherwise likely to disappear I'd just as soon not use it, since it looks like I'll have to implement some amount of text parsing anyway. (or maybe take the opportunity to learn some Erlang?)

Don't stress over the weekend, though - not a rush.

@andrewjstone
Copy link

@danieldreier It's a brand new interface actually, built upon clique. The goal is to move over all status to use it eventually, but that timeline is very uncertain and no-one is working on moving other things forward at the moment.

@danieldreier
Copy link
Collaborator Author

@andrewjstone that's awesome - thanks for pointing me to it. I was just looking around the other day to see what options there are for building CLI tools in Erlang and I didn't notice clique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants