-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update to Elasticsearch 8 and secure the connection between searchengine and elasticsearch #405
Conversation
…engine and elasticsearch and clustern nodes
I have created a seachengine PR (92) to support securing the connection between searchengine and Elasticsearch. |
@sbesson I have created a docker image for the searchengine ( |
@@ -5,7 +5,7 @@ database_name: idr | |||
database_username: omeroreadonly | |||
database_user_password: "{{ idr_secret_postgresql_password_ro | default('omero') }}" | |||
searchenginecache_folder: /data/searchengine/searchengine/cacheddata/ | |||
search_engineelasticsearch_docker_image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2 | |||
search_engineelasticsearch_docker_image: docker.elastic.co/elasticsearch/elasticsearch:8.8.1 | |||
searchengine_docker_image: openmicroscopy/omero-searchengine:0.5.2 |
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.
I assume this PR will require another update with a new version of the Docker image once the corresponding application PR has been reviewed, merged and released
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.
Yes, this is the case.
networks: | ||
- name: "searchengine-net" | ||
ipv4_address: 10.11.0.2 |
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.
What is the requirement for hardcoding this IPv4 address?
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 is the first searchengine node, so it should have this IP address. The remaining nodes' IPs depended on the number of nodes in the elasticsearch cluster.
I have passwords as private variables which have default values. |
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.
Thanks @khaledk2 for separating the private and public variables. No additional comments immediately from my side on the deployment front. I think the next step is to evaluate the corresponding application changes and move towards a new Docker image which can be used for evaluation. I'll leave you and @jburel to coordinate on the latter
|
||
- name: Add elastic nodes to instances_nodes | ||
set_fact: | ||
instances_nodes: "{{instances_nodes + [( {'name' : 'searchengine_elasticsearch_node'+item, 'dns': ['searchengine_elasticsearch_node'+item,'localhost'],'ip': '127.0.0.1'})] }}" |
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 playbook failed to execute against test120-searchengine
with the following error
The task includes an option with an undefined variable. The error was: 'instances_nodes' is undefined
The error appears to be in '/tmp/management_tools/idr/deployment/ansible/idr-elasticsearch.yml': line 86, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Add elastic nodes to instances_nodes
^ here"
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.
@sbesson, I have pushed a fix for this issue, could you please try again?
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.
Same error with instances
in the next task.
ansible/idr-elasticsearch.yml
Outdated
|
||
- name: Pause for 1 minutes | ||
ansible.builtin.pause: | ||
minutes: 1 |
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.
Rather than pausing for an arbitrary amount of time. Would a different state
e.g. stopped
in the previous task allow to ensure that the command is completed successfully before executing the rest of the playbook - https://docs.ansible.com/ansible/2.9/modules/docker_container_module.html#parameters?
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.
I have used wait_for
to ensure that the ca file is present instead of pause
for an arbitrary amount of time.
Sorry, it seems that I have posted the following message to the wrong PR. |
I have renamed the |
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.
Proposing to schedule the deployment of the latest version of the search engine onto prod119
. As for test120
, this will require the deletion and reprovisioning of the searchengine VM but should not affect any import/annotation work happening over the OMERO VMs. @dominikl @francesw are you happy for this work to be carried out anytime or would you suggest a specific timeslot?
@sbesson Could you please delete the |
@khaledk2 so far I have tested a complete recreation of the VM but if you are confident we can upgrade |
@sbesson, Yes, that would be fine, to be on the safe side, we may also delete all the stopped containers. |
Deployed on
|
Looks good! thank you. |
This PR updates Elasticsearch to version 8 (8.8.1). It also secures the connection between the searchengine and the elasticsearch cluster and between the elasticsearch cluster nodes themselves.
I have tested it locally and it worked fine. I am now testing it in
pilot-idr0000-omeroreadwrite
.This PR required changes to the search engine code and I will create a PR for it soon.