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

Read nodes config value from binary #12

Open
rubysolo opened this issue Sep 20, 2017 · 4 comments
Open

Read nodes config value from binary #12

rubysolo opened this issue Sep 20, 2017 · 4 comments

Comments

@rubysolo
Copy link

Hi, thanks for this library!

I would like to be able to specify my Cassandra nodes via an ENV variable so that I can reconfigure at runtime (via RELX_REPLACE_OS_VARS). Would you be open to a PR that would allow nodes to be specified with the current list of tuples syntax or like:

config :my_app, MyApp.Repo,
  nodes: "${CASSANDRA_NODES}",
  keyspace: "my_app"

Then I could start up with e.g. CASSANDRA_NODES=10.0.0.1:9042,10.0.0.2:9042 in my environment.

@lucianleustean
Copy link

Hi rubysolo ! did you find a workaround for this?

@rubysolo
Copy link
Author

rubysolo commented Feb 5, 2018

No, I ended up switching the project to a different storage backend. 🙁 However, I am looking at using this library for another project and will need this functionality, so I'll send a PR anyway.

@rubysolo
Copy link
Author

rubysolo commented Feb 5, 2018

@lucianleustean Are you able to run specs locally? I have to version bump cqerl and espec to get the code to compile (running Elixir 1.6.0 / Erlang 20). Once I do that, I get 21 failures -- 2 in migration_spec.exs and the rest in adapter_spec.exs. At first glance, the failures look like leaking fixture data between spec runs -- the posts table grows by 152 records each run. Perhaps I have not configured Cassandra correctly for the tests?

@lucianleustean
Copy link

lucianleustean commented Mar 15, 2018

Hi @rubysolo! sorry I missed your messages. yes I am able to run the test suite locally using MIX_ENV=test mix espec but 2 tests are failing

A PR would be nice to fix node configuration. Atm I am using it hardcode in prod.exs file for production and I don't like it ..

config :app, App.Repo,
  nodes: [{"10.10.10.1", 9042}, {"10.10.10.2", 9042}, {"10.10.10.3", 9042}],
  keyspace: "app_prod",
  replication: {"NetworkTopologyStrategy", dc1: 3}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants