Best Config File Format?

887 views
Skip to first unread message

ManOLamancha

unread,
Jan 25, 2012, 3:12:01 PM1/25/12
to OpenTSDB
Hello, I'm going to start work on a configuration file for OpenTSDB
and I want to poll ya'll to see what format is preferred. There are a
ton of options that I want to add that would make having a config file
easier instead of having to supply all of the options on a command
line. Which would be better, XML, Yaml, Java Properties file, INI?
HBase uses XML for the main node configuration, but has .properties
for Log4J and other components. Let me know what ya'll think, thanks.

Rob Claire

unread,
Jan 25, 2012, 3:18:41 PM1/25/12
to ManOLamancha, OpenTSDB
I prefer YAML for its clarity and readability.

Sent from my iPhone

Dave Barr

unread,
Jan 25, 2012, 4:19:13 PM1/25/12
to ManOLamancha, OpenTSDB
Anything but XML. For us though we just use a wrapper shell script
which specifies all of the command line options we want. That way you
just have one script to run, and you don't have to worry about where
your config file is whenever you run tsdb from the command line (e.g.
when using the CLI).

--Dave

Stack

unread,
Jan 25, 2012, 4:35:35 PM1/25/12
to Dave Barr, ManOLamancha, OpenTSDB
On Wed, Jan 25, 2012 at 1:19 PM, Dave Barr <dave...@gmail.com> wrote:
> Anything but XML.

+1
St.Ack

ManOLamancha

unread,
Jan 25, 2012, 4:36:26 PM1/25/12
to OpenTSDB
> I prefer YAML for its clarity and readability.

YAML is nice but I don't like that if you screw up your spaces, it can
goof the config.

> Anything but XML.  For us though we just use a wrapper shell script
> which specifies all of the command line options we want.  That way you
> just have one script to run, and you don't have to worry about where
> your config file is whenever you run tsdb from the command line (e.g.
> when using the CLI).

I was thinking XML since Hadoop has a nice configuration class that
HBase uses to load it's config, but XML does add a lot of extra cruft.
Regarding the CLI, I'm going to be adding a ton of options so it can
get pretty unwieldy, so I figured it could check for the config in
common spaces, then CLI commands could override.

How do ya'll feel about nicely formatted JSON for a config file?

Tom Cook

unread,
Jan 25, 2012, 4:47:20 PM1/25/12
to ManOLamancha, OpenTSDB
- not xml

- yaml is fine

- I personally like INI style

Tom Cook

unread,
Jan 25, 2012, 4:47:56 PM1/25/12
to ManOLamancha, OpenTSDB
json is good too.

tsuna

unread,
Jan 26, 2012, 3:16:51 AM1/26/12
to Tom Cook, ManOLamancha, OpenTSDB
Definitely not XML.

On Wed, Jan 25, 2012 at 1:47 PM, Tom Cook <t...@tcook.co> wrote:

> json is good too.

+1 on JSON.

--
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com

ManOLamancha

unread,
Jan 26, 2012, 10:39:50 AM1/26/12
to OpenTSDB
> > json is good too.
>
> +1 on JSON.

When I mentioned JSON, I forgot that the official spec doesn't allow
for commenting, so how about just a simple key/value format like the
typical Java.properties file? I was thinking something like this:

# --------- NETWORK ----------
# The TCP port TSD should use for communications
#tsd.network.port = 4242

# Enables Nagel's algorithm to reduce the number of packets sent over
the
# network
#tsd.network.tcpnodelay = true

Steve Hoffman

unread,
Jan 28, 2012, 6:08:20 PM1/28/12
to open...@googlegroups.com
Agreed.  Stick with java properties.  You don't need anything fancy.
If your properties are so complicated you need something that structured (json, xml, etc) you may want to ask if more configuration via convention is in order.

KISS.

ManOLamancha

unread,
Jan 30, 2012, 11:05:12 AM1/30/12
to OpenTSDB
I cranked out the configuration file and implemented it in my fork of
the project, so take a peek everyone and let me know what you think.
Thanks!
https://github.com/manolama/opentsdb/commit/ff5b8ba8657c3ab7b96f48663b5987e062f798ab

Richard Hesse

unread,
Feb 2, 2012, 3:24:18 AM2/2/12
to OpenTSDB
Looks good to me! I'm a fan of simple config files.

On Jan 30, 8:05 am, ManOLamancha <clarsen...@gmail.com> wrote:
> I cranked out the configuration file and implemented it in my fork of
> the project, so take a peek everyone and let me know what you think.
> Thanks!https://github.com/manolama/opentsdb/commit/ff5b8ba8657c3ab7b96f48663...
Reply all
Reply to author
Forward
0 new messages