Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting config file in Alpha and Zero not working using environment variable #4311

Closed
prashant-shahi opened this issue Nov 22, 2019 · 0 comments · Fixed by #4344
Closed

Setting config file in Alpha and Zero not working using environment variable #4311

prashant-shahi opened this issue Nov 22, 2019 · 0 comments · Fixed by #4344
Labels
area/tools Issues related to maintenance tools and CLI. kind/bug Something is broken. status/accepted We accept to investigate/work on it.

Comments

@prashant-shahi
Copy link
Contributor

prashant-shahi commented Nov 22, 2019

What version of Dgraph are you using?

master

Steps to reproduce

I followed the instructions from the link below.
https://docs.dgraph.io/deploy/#config

config.json

{
 "my": "localhost:5180",
 "port_offset": 100,
 "idx": 1
}

Execute the following command:

DGRAPH_ZERO_CONFIG=config.json dgraph zero

Result

Expected for zero to run on port 5180, but it picks the default port 5080.

We can see the same for DGRAPH_ALPHA_CONFIG. Even tried setting$PWD/ prefix.

While using dgraph zero --config config.json works fine.

@danielmai danielmai added area/tools Issues related to maintenance tools and CLI. kind/bug Something is broken. status/accepted We accept to investigate/work on it. labels Nov 23, 2019
fristonio added a commit to fristonio/dgraph that referenced this issue Dec 3, 2019
* Fixes dgraph-io#4311
* Each subcommand can specify the config file to use using the
environment varaible which is of the form `<ENV_PREFIX>_CONFIG`, for
example `DGRAPH_ZERO_CONFIG`.

So with a `config.json` looking like this we can override the config
variables.

```json
{
     "my": "localhost:5180",
     "port_offset": 100,
     "idx": 1
}
```

Override the configuration using the above config file using the command

```bash
DGRAPH_ALPHA_CONFIG=config.json dgraph alpha

DGRAPH_ZERO_CONFIG=config.json dgraph zero
```

Signed-off-by: Deepesh Pathak <[email protected]>
prashant-shahi pushed a commit that referenced this issue Dec 6, 2019
* cmd: fix config file from env variable issue in subcommands

* Fixes #4311
* Each subcommand can specify the config file to use using the
environment varaible which is of the form `<ENV_PREFIX>_CONFIG`, for
example `DGRAPH_ZERO_CONFIG`.

So with a `config.json` looking like this we can override the config
variables.

```json
{
     "my": "localhost:5180",
     "port_offset": 100,
     "idx": 1
}
```

Override the configuration using the above config file using the command

```bash
DGRAPH_ALPHA_CONFIG=config.json dgraph alpha

DGRAPH_ZERO_CONFIG=config.json dgraph zero
```

Signed-off-by: Deepesh Pathak <[email protected]>

* cmd: fix grammar issue in docs

Signed-off-by: fristonio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tools Issues related to maintenance tools and CLI. kind/bug Something is broken. status/accepted We accept to investigate/work on it.
Development

Successfully merging a pull request may close this issue.

2 participants