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

Improve ES URL and index name configuration #1096

Merged
merged 1 commit into from Aug 24, 2017
Merged

Improve ES URL and index name configuration #1096

merged 1 commit into from Aug 24, 2017

Conversation

noirbizarre
Copy link
Contributor

@noirbizarre noirbizarre commented Aug 24, 2017

This PR improves the ES configuration by:

  • exposing the default ELASTICSEARCH_URL in settings.py like any other setting
  • introducing the ELASTICSEARCH_INDEX_BASENAME which default to 'udata' to allow index configuration

The base name is used to produce elasticsearch index names and alias.
The default udata value will produce:

  • a udata-{yyyy}-{mm}-{dd}-{HH}-{MM} index on initialization
  • a udata alias on udata-{yyyy}-{mm}-{dd}-{HH}-{MM} on initialization
  • a temporary udata-test index during each test requireing it

Ex:

ELASTICSEARCH_INDEX_BASENAME = 'myindex'

The above configuration will produce:

  • a myindex-{yyyy}-{mm}-{dd}-{HH}-{MM} index on initialization
  • a myindex alias on myindex-{yyyy}-{mm}-{dd}-{HH}-{MM} on initialization
  • a temporary myindex-test index during each test requireing it

This change is totally backward compatible (no change required for existing configurations) but allows to deploy multiple udata instance on a same elasticsearch cluster

@noirbizarre noirbizarre added this to the 1.1.2 milestone Aug 24, 2017
@noirbizarre noirbizarre requested a review from a team August 24, 2017 11:32
The default `udata` value will produce:
- a `udata-{yyyy}-{mm}-{dd}-{HH}-{MM}` index on initialization
- a `udata` alias on `udata-{yyyy}-{mm}-{dd}-{HH}-{MM}` on initialization
- a temporary `udata-test` index during each test requireing it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring

The above example will produce:
- a `myindex-{yyyy}-{mm}-{dd}-{HH}-{MM}` index on initialization
- a `myindex` alias on `myindex-{yyyy}-{mm}-{dd}-{HH}-{MM}` on initialization
- a temporary `myindex-test` index during each test requireing it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring

@noirbizarre
Copy link
Contributor Author

Thanks 🙏

@noirbizarre noirbizarre merged commit 254f8bc into opendatateam:master Aug 24, 2017
@noirbizarre noirbizarre deleted the configurable-index-name branch August 24, 2017 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants