You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Manu Chadha <ma...@hotmail.com> on 2020/06/28 12:24:58 UTC

Can cassandra pick configuration from environment variables

Hi

Cassandra pick configuration from Cassandra.yaml (eg. Listen_address). Can I set the values of listen_address, rpc_address etc. from environment variables?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


Re: Can cassandra pick configuration from environment variables

Posted by Reid Pinchback <rp...@tripadvisor.com>.
It’s pretty easy to make Ansible, or Python with Jinja by itself if you don’t use Ansible, and just templatize your config file so the environment variables get substituted.

From: Jeff Jirsa <jj...@gmail.com>
Reply-To: "user@cassandra.apache.org" <us...@cassandra.apache.org>
Date: Monday, June 29, 2020 at 10:36 AM
To: cassandra <us...@cassandra.apache.org>
Subject: Re: Can cassandra pick configuration from environment variables

Message from External Sender
You can probably implement a custom config loader that pulls all the config from env vars, if you're so inclined (a bit of java, the interface has a single method, maybe one or two hooks into the db, which may be suitable for committing for general purpose use).

On Mon, Jun 29, 2020 at 4:35 AM Angelo Polo <la...@gmail.com>> wrote:
You can, however, set the environment variable CASSANDRA_CONF to direct the startup script to the configuration directory that holds cassandra.yaml, cassandra-env.sh, etc. So while you can't set individual C* configuration parameters from environment variables, you could have different configuration directories (can think of them as different profiles) and specify at startup which to use.

Best,
Angelo Polo

On Sun, Jun 28, 2020 at 2:28 PM Erick Ramirez <er...@datastax.com>> wrote:
You can't. You can only configure Cassandra by setting the properties in cassandra.yaml file. Cheers!

Re: Can cassandra pick configuration from environment variables

Posted by Jeff Jirsa <jj...@gmail.com>.
You can probably implement a custom config loader that pulls all the config
from env vars, if you're so inclined (a bit of java, the interface has a
single method, maybe one or two hooks into the db, which may be suitable
for committing for general purpose use).

On Mon, Jun 29, 2020 at 4:35 AM Angelo Polo <la...@gmail.com>
wrote:

> You can, however, set the environment variable CASSANDRA_CONF to direct
> the startup script to the configuration directory that holds
> cassandra.yaml, cassandra-env.sh, etc. So while you can't set individual C*
> configuration parameters from environment variables, you could have
> different configuration directories (can think of them as different
> profiles) and specify at startup which to use.
>
> Best,
> Angelo Polo
>
> On Sun, Jun 28, 2020 at 2:28 PM Erick Ramirez <er...@datastax.com>
> wrote:
>
>> You can't. You can only configure Cassandra by setting the properties in
>> cassandra.yaml file. Cheers!
>>
>>>

Re: Can cassandra pick configuration from environment variables

Posted by Angelo Polo <la...@gmail.com>.
You can, however, set the environment variable CASSANDRA_CONF to direct the
startup script to the configuration directory that holds cassandra.yaml,
cassandra-env.sh, etc. So while you can't set individual C* configuration
parameters from environment variables, you could have different
configuration directories (can think of them as different profiles) and
specify at startup which to use.

Best,
Angelo Polo

On Sun, Jun 28, 2020 at 2:28 PM Erick Ramirez <er...@datastax.com>
wrote:

> You can't. You can only configure Cassandra by setting the properties in
> cassandra.yaml file. Cheers!
>
>>

Re: Can cassandra pick configuration from environment variables

Posted by Erick Ramirez <er...@datastax.com>.
You can't. You can only configure Cassandra by setting the properties in
cassandra.yaml file. Cheers!

>