Environment variables in properties files

742 views
Skip to first unread message

Zach Cox

unread,
Mar 3, 2015, 3:36:08 PM3/3/15
to druid...@googlegroups.com
Hi - in the example production common configuration [1] there are various config values like #{ZK_IPs} and #{MYSQL_URL} that look like environment variable substitutions. Is that what those are, or are they something else?

I was hoping #{} was the syntax in a .properties file to use an env var, as this would make working with Docker & Mesos much simpler, but it doesn't seem to work for me. Just wondering if I'm doing something wrong.

Thanks,

Fangjin Yang

unread,
Mar 3, 2015, 5:01:00 PM3/3/15
to druid...@googlegroups.com
Hi Zach, you are indeed correct in that they are substitutes, but they are not environment variable substitutes. You can fill them in yourself with the specific IPs of your cluster.

Zach Cox

unread,
Mar 3, 2015, 5:11:33 PM3/3/15
to druid...@googlegroups.com
Do you mean just replace e.g. #{ZK_IPs} with hard-coded values directly in the properties file? Like:


--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+...@googlegroups.com.
To post to this group, send email to druid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-user/742d6f15-a305-4cc6-bafe-02585b637d37%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Fangjin

unread,
Mar 3, 2015, 5:13:30 PM3/3/15
to Zach Cox, druid...@googlegroups.com
Yes, that is what, and many others are doing right now.

Zach Cox

unread,
Mar 3, 2015, 5:15:19 PM3/3/15
to Fangjin, druid...@googlegroups.com
Ah ok I misunderstood the documentation - I thought ZK_IPs was some value being substituted in from somewhere else. Thank you for clarifying. :)

Jakub Liska

unread,
Apr 20, 2016, 3:22:04 AM4/20/16
to Druid User, fangj...@gmail.com
Hey,

are you planning to implement the env variable interpolation? It would significantly simplify containerization. I have to currently build like 12 docker containers each with a tiny little change in configuration files. And it becomes very messy.

Gian Merlino

unread,
Apr 20, 2016, 9:29:12 PM4/20/16
to druid...@googlegroups.com, Fangjin Yang
Hey Jakub,

There are no plans to do this in Druid, although you might find it easier to do one of the following:

1) build a single Docker container with all configs (in separate directories), and launch Druid with a script that chooses the config directory based on an environment variable

2) or, build a single Docker container with config templates, and launch Druid with a script that replaces environment variables in the templates and then launches Druid.

Gian

On Wed, Apr 20, 2016 at 12:22 AM, Jakub Liska <liska...@gmail.com> wrote:
Hey,

are you planning to implement the env variable interpolation? It would significantly simplify containerization. I have to currently build like 12 docker containers each with a tiny little change in configuration files. And it becomes very messy.

--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+...@googlegroups.com.
To post to this group, send email to druid...@googlegroups.com.

Jakub Liska

unread,
Apr 21, 2016, 2:36:47 AM4/21/16
to Druid User, fangj...@gmail.com, gi...@imply.io
Hi Gian,

yeah I'm going with 2). I find 1) sort of error prone solution, it is hard to "diff" the configs to spot differences. Thanks !
Reply all
Reply to author
Forward
0 new messages