-
Notifications
You must be signed in to change notification settings - Fork 855
Cleanup installation and make shared file system prefixes optional #301
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
1 similar comment
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
es_use_shared_fs: false |
good! +1 |
Other than the plugin handling (which i think has subsequently improved) this makes considerable improvements to the current role. I'd like to get this merged but i think we first need to fix some critical issues this doesn't resolve. @barryib any thoughts on this? The ability to have only one instance per machine, and thus not be impacted by the |
This PR had gotten pretty far behind the current master, so I did a rebase this evening to bring everything up-to-date. |
@elasticmachine test (?) Thank you |
@bndabbs actually, I just realized that Also, default |
I submitted changes that I believe clean up the params section a bit. @bndabbs |
@karmi I believe the emails are sorted out now. |
tasks/elasticsearch-scripts.yml
Outdated
@@ -1,6 +1,6 @@ | |||
--- | |||
|
|||
- set_fact: es_script_dir={{ es_conf_dir }}/{{es_instance_name}} | |||
- set_fact: es_script_dir={{ es_conf_dir }}{{ es_conf_dir }}{{'/' + es_instance_name if es_use_shared_fs else ''}} |
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 double es_conf_dir
looks like a bug?
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.
It does to me. I made a pull request with @bndabbs to remove it.
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.
This has been merged now.
@bndabbs, yes, thanks, the check is now green! |
I think es_use_shared_fs: true should be the default to maintain backwards-compatibility. |
@ajrpayne good call. I flipped the default on that. |
I’ve tested your PR with my install and it looks good. Is there perhaps need for README changes as well, before merging? |
@bndabbs We think we might have found a bug with this PR. If you have plugins defined, upgrading to a newer ES version using this role gives this error:
I believe the problem is that the variable |
Well, I now understand that
I can workaround the bug by setting that line to |
Hello @bndabbs ? :) |
@janhoy I'll take a look at the plugin logic and see if I can figure that out. |
@bndabbs figured it out yet? I'd really like for this PR to be merged soon as we base our install on it. |
Hi, any luck with this? I'm considering reverting back to latest release since this PR seems to be going nowhere anytime soon? |
@janhoy |
I've rolled back to default version of the role since this PR is going nowhere. I was using CentOS, and installed with this role+PR from a clean system. It is easily reproducible by doing an install with plugins, then do an upgrade to a newer minor version. |
Cleaned up the facts. conf_dir is set in defaults and reset in elasticsearch-sharedfs.yml if es_use_shared_fs is true. instance_default_file was being reset at the bottom of the params file. instance_init_script was being reset at the bottom of the params file as well.
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.
This is some really great work! Left a couple of small comments (one which is causing a test to fail). Really love what you have done to simplify a lot of the role!
templates/elasticsearch.yml.j2
Outdated
@@ -8,7 +8,7 @@ cluster.name: elasticsearch | |||
{% endif %} | |||
|
|||
{% if es_config['node.name'] is not defined %} | |||
node.name: {{inventory_hostname}}-{{es_instance_name}} | |||
node.name: {{inventory_hostname}}{{' - ' + es_instance_name if es_use_shared_fs else ''}} |
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.
Are the extra spaces around -
intentional? This is causing the tests to fail because the node changed localhost-node1
to localhost - node1
@@ -67,7 +67,7 @@ if [ ! -z "$CONF_FILE" ]; then | |||
fi | |||
|
|||
exec="$ES_HOME/bin/elasticsearch" | |||
prog="{{es_instance_name}}_{{default_file | basename}}" | |||
prog="{{es_instance_name + '_' if es_use_shared_fs else ''}}{{default_file | basename}}" |
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.
Would it be possible to move all of '_' if es_use_shared_fs else ''
logic into defaults/main.yml
? It makes it a lot more readable and means that any future changes won't need to keep copy pasting this if else statement everywhere.
Rebase with patches
This was failing on my Red Hat 7 system without the full path
I like the changes @bndabbs. Made a pull request that I thought brought it more in line with the sharedfs structure you were going for. |
Sorry for the late reply just got back from holidays! 🌞 Almost there! Looks like only a couple small fixes are needed before this can be merged! The Ubuntu 14.04 tests seems to be failing because of the service detection stuff. You can run this locally with
Apart from that only the
|
@bndabbs Any chance to make a last push to get it merged? Thanks! |
Would love to see this merged. Is there anything I / others can do to help? |
This PR has been automatically marked as stale because it has not had |
This PR has been automatically closed because it has not had recent activity since being marked as stale. |
so sad ;-(( this PR was really usefull i hope currently ansible-elasticsearch role implements some analogs |
Hi @Slach, |
i use this PR for install once elasticsearch instance to once host directly to /var/lib/elasticsearch/data instead of /var/lib/something-with-instance-name/ |
Are you still using this 2 years old branch PR for your Elasticsearch deployments? I also encourage you to use 7.4.0 release Ansible Galaxy or |
@jmlrt oh, thanks a lot for explanation ;-) |
This is a lot of small changes and I wanted to submit them as separate pull requests for easier review, but a lot of them ended up being dependent on each other. I believe ee73f18 can be pulled out and moved to a separate PR if necessary, but I left it in there because I couldn't get my playbook to run without it.
The primary goal of this PR is to make the shared filesystem stuff optional, because I got tired of having to prefix the instance name to the service name when performing maintenance. I think the prefix is useful and necessary when operating in specific environments, but it adds unnecessary complexity for a lot of use cases.