Chris, That’s a great question, and unfortunately there’s not a simple answer. I am happy to get into the complex answer.
At this point I would actually say that there is no way to get the true running configuration of a Riak node. That’s because Riak has two types of configuration settings: those that are read every time they’re used, and those that are read once when some process starts. Both types live in application context, so you can change any of them while running, but those changes might not take effect ever. An example would be when configuring lager. If you were to change the lager handlers of a running node to [], you would expect logging to stop because you changed the configuration of lager. Lager has actually already set up all the handlers at launch, and you’d need to interact with Lager’s API to change them. So, now you’re operating in a state where the application configuration has changed, but the effective configuration has not. In this case, application:get_all_env() won’t return the true running configuration of Riak. In my opinion, this is an edge case, but not edgy enough to ignore. There are other settings like riak_core’s handoff_concurrency, which can be changed at runtime by attaching and calling application:set_env. So what we know is that you can change the running configuration, but that doesn’t always change what Riak is actually doing. Now, if we were to ignore this case, and make the assumption that people aren’t attaching and changing settings, then we have a couple of options in the 2.0 world. Every setting mapped by Cuttlefish has an explicit default value (unless that default is supposed to be ‘undefined’). When the app.config is generated it is generated as a “complete” app.config. What I mean is that every possible configuration setting will be defined, which means you don’t have to dig through source to find out what a specific application environment variable defaulted to. It will all be in one place. Here’s an example generated app.config: https://gist.github.com/joedevivo/7320800 Actually, that’s the best you can do right now to see the “start time” configuration in Riak 2.0. Unfortunately, that’s still an Erlang configuration file, which goes against the spirit of Cuttlefish. I’m hoping to add some command line tools in the near future that will make reading your configuration easier. One would be to output the “start time” config in Cuttlefish’s syntax. The second I am considering is a kind of man-page looking thing, but it would output the documentation for a setting and include the default value and your value if you have changed it in your riak.conf file. I hope that’s enough to answer your question. Follow up questions welcome, as well as opinions on the command line interface that’s still in the design phase. —joe On November 5, 2013 at 7:39:30 AM, Chris Read (chris.r...@gmail.com) wrote: Glad someone there is thinking about configuration :D Question - are you planning on making it just as easy to find out what the _running_ configuration is? Currently I have to resort to the: riak-attach application:get_all_env(...). incantation to find out settings riak is actually using at the time. While I don't mind using attach, it's not always obvious what env you should be asking for in the first place... Thanks, Chris On Mon, Nov 4, 2013 at 11:36 AM, Joe DeVivo <jdev...@basho.com> wrote: Riak Users, We've been kind of tiptoeing around the configuration changes for Riak 2.0. Mostly it was because I wanted to have a dramatic reveal at RICON|West. Now that you can see that here (http://ricon.io/west2013.html Day 1, Track 1, 7:08:22), it's time for me to talk to you all about configuration. A lot of what I want to say, I've already written in a cool blog post with fancy features like "syntax highlighting" and "hyperlinks". I encourage you to read my story here: https://github.com/joedevivo/ricon/blob/master/cuttlefish.md The biggest issue I have with the state of configuration in the 2.0 tech preview is the lack of documentation. Changing how we do configuration is going to affect almost all of the documentation. We're working on that already, but in the interim, here's a gist of mappings from old config style to new style: https://gist.github.com/joedevivo/7305410 I'll do my best to keep updating that gist as we make changes to the configuration settings. As you thumb through that gist, please note that some variable names in the 2.0 configuration file may change before release. Cuttlefish makes changing the names of these variables easy, and some names were just transposed from their Erlang counterparts. If you have a better name for some setting in Riak, please reach out to me. While I can't promise to use your suggestion, I'm always interested in how people are actually thinking about configuration. Stay rad, --joe --- Software Engineer at Basho @joedevivo jdev...@basho.com irc: joedevivo _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com