Environment variables in properties files

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,

Zach

[1] http://druid.io/docs/0.7.0/Production-Cluster-Configuration.html

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.

Do you mean just replace e.g. #{ZK_IPs} with hard-coded values directly in the properties file? Like:

druid.zk.service.host=[zk1.site.com:2181](http://zk1.site.com:2181),[zk2.site.com:2181](http://zk2.site.com:2181),[zk3.site.com:2181](http://zk3.site.com:2181)

Yes, that is what, and many others are doing right now.

Ah ok I misunderstood the documentation - I thought ZK_IPs was some value being substituted in from somewhere else. Thank you for clarifying. :slight_smile:

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.

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.

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 !