-
Notifications
You must be signed in to change notification settings - Fork 855
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
jenkins test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from the extra comment that seems to have slipped in.
This is a really cool feature that I hadn't seen used before. Thanks for adding it in!
templates/systemd/elasticsearch.j2
Outdated
@@ -3,6 +3,8 @@ Description=Elasticsearch-{{es_instance_name}} | |||
Documentation=http://www.elastic.co | |||
Wants=network-online.target | |||
After=network-online.target | |||
{# Directive 'WorkingDirectory' creates an implicit dependecy and can be omitted #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to leave this in? This comment mentions the WorkingDirectory
directive but you are adding in RequiresMountsFor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WorkingDirectory
directive is used in line 18.
It implicitly creates the necessary After=
/Requires=
directives for {{es_home}}
, therefore we can skip adding {{es_home}}
to the list of folders in RequiresMountsFor
.
I'll refine the comment to make it more clear, why I skipped {{es_home}}
.
Do you prefer Jinja2 comments here, i.e. comments that are no longer in the templated file, or "regular" comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Jinja comment for now - since we're using template variables, it would imho be confusing in the final systemd-unitfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clarifying and updating it!
User might be interested in separating data in ephemeral and persistent state, especially in cloud environments, e.g. data_dir on another disk.
I would consider the changes as resolved, until further notice. Waiting for feedback :) |
jenkins test this please |
Thank you @Fra-nk for adding this in! (And for teaching me about a cool systemd feature) |
User might be interested in separating ephemeral and persistent data.
Among others, this can be done by putting
data_dir
on another disk.When doing that in cloud environments via
cloud-init
orwaagent
you need to time the service start to after the necessary devices are mounted, otherwise a low run-level can result in trying to start the service before all data/mounts is/are available.This PR adds systemd's
RequiresMountsFor
directive for the corresponding folders.