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

ODFE/ElasticSearch to OpenSearch migration (#2870) #2983

Closed
Closed
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
dbff14b
Move to Opensearch
romsok24 Jan 20, 2022
9aabac2
ODFE-Ops migration
romsok24 Jan 21, 2022
9191e31
Migratioin to opensearch
romsok24 Jan 21, 2022
c95823b
Migratioin to opensearch
romsok24 Jan 23, 2022
ebc0e5c
Migration ODFE -> OpS
romsok24 Jan 26, 2022
b59a486
Merge branch 'epiphany-platform:develop' into feature/migr-ODFE-OpenS…
romsok24 Jan 26, 2022
f279f16
Migration ODFE -> OpS
romsok24 Jan 27, 2022
556fb3a
get rid of schema references
romsok24 Jan 28, 2022
70b422e
Reanming as a part of migration
romsok24 Jan 28, 2022
0d9bd80
Reanming as a part of migration
romsok24 Jan 28, 2022
a296a0d
get rid of schema references
romsok24 Jan 28, 2022
70b6342
TODO later on
romsok24 Jan 31, 2022
41f5c95
Unified location of state file
romsok24 Jan 31, 2022
39d2eae
THe corect one
romsok24 Jan 31, 2022
73a91fc
THe corect one
romsok24 Jan 31, 2022
0591058
Migration to opensearch
romsok24 Jan 31, 2022
d8a0c2d
A new flag for product replacement instead oof version upgrade
romsok24 Feb 2, 2022
779194d
ODFE product migration to OPS
romsok24 Feb 3, 2022
e991ad9
Needed for ODFE product migration to OPS
romsok24 Feb 3, 2022
623a788
Migration to opensearch
romsok24 Feb 3, 2022
44f1778
Temporary, old certs
romsok24 Feb 3, 2022
1497656
Migration ODFE to OPS and OPSD
romsok24 Feb 7, 2022
d7bba16
Kibana role removal
romsok24 Feb 7, 2022
1199b8c
Migration to opensearch
romsok24 Feb 7, 2022
d05ac82
Migration to opensearch
romsok24 Feb 7, 2022
d8bac1b
Migration to opensearch - docs update
romsok24 Feb 9, 2022
011470d
Migration to opensearch
romsok24 Feb 9, 2022
6b42ce7
Enable a cluster migration
romsok24 Feb 11, 2022
cd8932b
Cluster migration
romsok24 Feb 11, 2022
57479ee
docs update
romsok24 Feb 11, 2022
52d844e
docs update - link correction
romsok24 Feb 11, 2022
3a3b0d1
docs typo corrections
romsok24 Feb 11, 2022
9c627ec
docs suplement
romsok24 Feb 11, 2022
44a4d03
Resstore of accidetally removed file
romsok24 Feb 14, 2022
c97c1d2
Curator suppor info
romsok24 Feb 14, 2022
1ed5c1f
File renaming
romsok24 Feb 14, 2022
a1b849f
File renaming
romsok24 Feb 14, 2022
8e85ffb
Coorrect permisions
romsok24 Feb 14, 2022
cffdbbc
ODFE to OPS migration
romsok24 Feb 14, 2022
7623829
vars housekeeping
romsok24 Feb 15, 2022
279100f
Renaming files
romsok24 Feb 15, 2022
8c9406c
ODFE to OPS migration
romsok24 Feb 15, 2022
5b8d5b0
ODFE to OPS migration - bck/restore
romsok24 Feb 15, 2022
19b0ce6
Workaround needed for this version of OPS with Filebeat
romsok24 Feb 15, 2022
e683c99
Assure logstash user pass is set
romsok24 Feb 15, 2022
5da0bc8
ODFE to OPS migration - bck/restore
romsok24 Feb 15, 2022
cd954ae
Migartion - File renaming
romsok24 Feb 15, 2022
be98eb0
Corrrect var names
romsok24 Feb 15, 2022
e9b1d98
Kibana API not available bug workaround
romsok24 Feb 16, 2022
d06ac96
Adding some background of the migration to the docs
romsok24 Feb 16, 2022
52e47a1
Docs update
romsok24 Feb 16, 2022
0f935dd
Correcting inconsitences
romsok24 Feb 16, 2022
2a40af4
Correction of renames which were not needed
romsok24 Feb 16, 2022
5858dc2
ToC added for ease of nav
romsok24 Feb 16, 2022
fb9d1f6
Correction of renames which were not needed
romsok24 Feb 16, 2022
c6b68ac
Docs update
romsok24 Feb 17, 2022
0113f43
Docs update
romsok24 Feb 17, 2022
f484e30
Docs update-correcting the docs links and names
romsok24 Feb 17, 2022
47f0212
Docs update
romsok24 Feb 17, 2022
63c19a2
Removed as target OPS ver includes log4j patch https://discuss.opendi…
romsok24 Feb 17, 2022
01392dd
Naming corrected
romsok24 Feb 18, 2022
e188825
Reenabling ater test
romsok24 Feb 18, 2022
d24d731
OPS PerfTop function added
romsok24 Feb 18, 2022
26f9cc2
Mistakes correction
romsok24 Feb 18, 2022
effbfee
This compoennt is now part of OPS
romsok24 Feb 18, 2022
822b79b
Update the FS right to the OPS needs
romsok24 Feb 18, 2022
f92aa58
This compoennt is now part of OPS
romsok24 Feb 18, 2022
d8da2f1
Workaround for: opensearch ES_TMPDIR does not exist
romsok24 Feb 18, 2022
ebaf52e
Vars naming unification
romsok24 Feb 18, 2022
2fb3998
A mistak in naming
romsok24 Feb 18, 2022
05b01aa
Correcting names for upperc when aplicable and names changed by mista…
romsok24 Feb 21, 2022
67c6d49
Unify odfe_migration parameter location and schema validation added
romsok24 Feb 21, 2022
e32dfe9
Not standard versions of ODFE/OPS are not supported
romsok24 Feb 21, 2022
24c99c5
OPS Perf. analyzer download path added
romsok24 Feb 21, 2022
463ee90
Make it more precize which dashoboards we talk about
romsok24 Feb 21, 2022
bf3be0d
Correcting the link
romsok24 Feb 21, 2022
1d47066
Withdrawing incorect chanes
romsok24 Feb 21, 2022
b15b7b5
Old to new name migration
romsok24 Feb 21, 2022
af359c0
Removal of not used component
romsok24 Feb 22, 2022
1afb642
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
b44f438
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
ee9caf5
Vars naming change + correcting var meaning as requested during PR rev.
romsok24 Feb 23, 2022
c9b98d3
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
d428903
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
e6d95d8
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
42e3e43
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
803efeb
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
f605071
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
184938e
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
762dbbd
Suggest potential problem solution to user
romsok24 Feb 23, 2022
8c6102b
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
f51a2e3
Cleaning up the code
romsok24 Feb 23, 2022
51b48bd
Removing incorect commenting
romsok24 Feb 23, 2022
2c90893
Vars naming change as requested during PR rev.
romsok24 Feb 23, 2022
6a50545
Using the newer version of control keyword
romsok24 Feb 23, 2022
fba7418
Using the newer version of control keyword
romsok24 Feb 23, 2022
891ca3e
Harcoding the path as requested during PR rev.
romsok24 Feb 23, 2022
034e787
ansible_facts.fqdn works ( instead of domain_name ) also with --no-in…
romsok24 Feb 23, 2022
06026de
Differ between architectures the vars describing OPS and OPSD binary
romsok24 Feb 23, 2022
c7228c5
Removed as target OPS ver includes log4j patch
romsok24 Feb 24, 2022
19a4c03
Renaming change as requested during PR rev.
romsok24 Feb 24, 2022
86adfcc
Renaming change as requested during PR rev.
romsok24 Feb 24, 2022
c232ac5
Renaming change as requested during PR rev.
romsok24 Feb 24, 2022
beeb7f0
Renaming change as requested during PR rev.
romsok24 Feb 24, 2022
8b650fb
Renaming change as requested during PR rev.
romsok24 Feb 24, 2022
e3a429e
Renamed as requested during PR review
romsok24 Feb 24, 2022
16f043a
Perftop is not supported on ARM
romsok24 Feb 24, 2022
5fa5eb2
Meging with develop to implement new download reqs process
romsok24 Feb 24, 2022
20b6921
Shortening the path when within a single role
romsok24 Feb 25, 2022
b79c134
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
c309c79
Update
romsok24 Feb 25, 2022
0931358
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
52a218a
This action was doubled here
romsok24 Feb 25, 2022
d355c5d
Rewariting on canonical yaml format
romsok24 Feb 25, 2022
fb2dc26
Renaming
romsok24 Feb 25, 2022
b7bf243
Using ansible sudo mechanism
romsok24 Feb 25, 2022
9033886
Var name optimization
romsok24 Feb 25, 2022
7edeca1
Using ansible sudo mechanism
romsok24 Feb 25, 2022
c064496
Moved to defaults
romsok24 Feb 25, 2022
fe6f038
The roles are supported for the give arch
romsok24 Feb 25, 2022
fbaa714
A typo correction
romsok24 Feb 25, 2022
95b46d7
A typo correction
romsok24 Feb 25, 2022
44ef557
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
64bc9a8
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
3cf854e
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
4421210
Using a var instead of hardoded value
romsok24 Feb 25, 2022
f6a4d34
Renaming change as requested during PR rev.
romsok24 Feb 25, 2022
f7db9bb
Renaming change as requested during PR rev
romsok24 Feb 25, 2022
c11f226
Reaplcing kibana
romsok24 Feb 25, 2022
efb2b05
Using a var instead of hardoded value
romsok24 Feb 25, 2022
2392aac
Changing the type of porting the tasks from stat to dyn
romsok24 Feb 28, 2022
dc2b276
Not used now
romsok24 Feb 28, 2022
3994b3a
This can not be run as root
romsok24 Feb 28, 2022
f9e5c70
Needed for succesfull bck/recov because as workaround of err:Kibana A…
romsok24 Feb 28, 2022
8603423
We do not support upgr of not EPI provided versions of ODFE
romsok24 Feb 28, 2022
735db7e
simplifying the structure due to lack of not EPI provided versions of…
romsok24 Feb 28, 2022
ead07fc
simplifying the structure due to lack of not EPI provided versions of…
romsok24 Feb 28, 2022
79b3c87
Renaming change as requested during PR rev.
romsok24 Mar 1, 2022
1719503
Higher failure level allowed
romsok24 Mar 1, 2022
52560b8
Fixing a typo
romsok24 Mar 3, 2022
9b2eb1f
Correct var assigned
romsok24 Mar 3, 2022
206cd2d
Ensure ccorrect folder rights
romsok24 Mar 3, 2022
1b2fa24
Changing the way we describe the perms
romsok24 Mar 4, 2022
c09e5ae
Replacing the given uname with var
romsok24 Mar 4, 2022
21f1aef
Docs corrections
romsok24 Mar 4, 2022
f1145a3
Making this var more laconic
romsok24 Mar 4, 2022
f95cd70
Type correction
romsok24 Mar 7, 2022
71a693f
Typo correction
romsok24 Mar 7, 2022
e657a23
Moving the vars definitions to ops\defaults
romsok24 Mar 7, 2022
e503eb9
Fixing a typo
romsok24 Mar 7, 2022
bfb1ec3
Var renaming as requested in https://github.com/epiphany-platform/epi…
romsok24 Mar 7, 2022
7f9e2fc
Task renaming as requested in PR#2983
romsok24 Mar 7, 2022
d59acfc
Moving the static path to variable
romsok24 Mar 7, 2022
2ebf81d
Rephrasing as requested in PR#2983
romsok24 Mar 7, 2022
185a052
Adding the step name
romsok24 Mar 8, 2022
726d757
Renaming as requested in PR#2983
romsok24 Mar 8, 2022
66411db
Corrected names
romsok24 Mar 10, 2022
2699b76
Moving the group name from harcoded into var
romsok24 Mar 10, 2022
c2e8641
TO align w/ PR #3005
romsok24 Mar 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Epiphany at its core is a full automation of Kubernetes and Docker plus addition

- Kafka or RabbitMQ for high speed messaging/events
- Prometheus and Alertmanager for monitoring with Graphana for visualization
- Elasticsearch and Kibana for centralized logging (OpenDistro)
- OpenSearch for centralized logging
- HAProxy for loadbalancing
- Postgres and Elasticsearch for data storage
- Postgres and OpenSearch for data storage
- KeyCloak for authentication
- Helm as package manager for Kubernetes

Expand Down
8 changes: 4 additions & 4 deletions ansible/playbooks/backup_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
name: component_vars
- import_role:
name: backup
tasks_from: logging_elasticsearch_snapshot
tasks_from: logging_opensearch_snapshot
- import_role:
name: backup
tasks_from: logging_elasticsearch_etc
tasks_from: logging_opensearch_conf

- hosts: kibana[0]
gather_facts: true
Expand All @@ -28,10 +28,10 @@
- when: specification.components.logging.enabled | default(false)
block:
- include_vars:
file: roles/kibana/vars/main.yml
file: roles/opensearch_dashboards/vars/main.yml
name: component_vars
- import_role:
name: backup
tasks_from: logging_kibana_etc
tasks_from: logging_opensearch_dashboards_conf
vars:
snapshot_name: "{{ hostvars[groups.logging.0].snapshot_name }}"
2 changes: 1 addition & 1 deletion ansible/playbooks/filebeat.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Ansible playbook that installs and configures Filebeat

- hosts: opendistro_for_elasticsearch:logging:kibana # to gather facts
- hosts: opensearch:logging:opensearch_dashboards # to gather facts
tasks: []

- hosts: filebeat
Expand Down
12 changes: 0 additions & 12 deletions ansible/playbooks/kibana.yml

This file was deleted.

10 changes: 0 additions & 10 deletions ansible/playbooks/opendistro_for_elasticsearch.yml

This file was deleted.

10 changes: 10 additions & 0 deletions ansible/playbooks/opensearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Ansible playbook for installing OpenSearch

- hosts: opensearch
become: true
become_method: sudo
roles:
- opensearch
vars:
current_group_name: "opensearch"
10 changes: 10 additions & 0 deletions ansible/playbooks/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Ansible playbook for installing OpenSearch Dashboards
- hosts: repository # to gather facts
tasks: []

- hosts: opensearch_dashboards
become: true
become_method: sudo
roles:
- opensearch_dashboards
8 changes: 4 additions & 4 deletions ansible/playbooks/recovery_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
name: component_vars
- import_role:
name: recovery
tasks_from: logging_elasticsearch_etc
tasks_from: logging_opensearch_conf
- import_role:
name: recovery
tasks_from: logging_elasticsearch_snapshot
tasks_from: logging_opensearch_snapshot

- hosts: kibana[0]
gather_facts: true
Expand All @@ -27,8 +27,8 @@
- when: specification.components.logging.enabled | default(false)
block:
- include_vars:
file: roles/kibana/vars/main.yml
file: roles/opensearch_dashboards/vars/main.yml
name: component_vars
- import_role:
name: recovery
tasks_from: logging_kibana_etc
tasks_from: logging_opensearch_dashboards_conf
4 changes: 2 additions & 2 deletions ansible/playbooks/roles/backup/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
backup_dir: /epibackup
backup_destination_dir: "{{ backup_dir }}/mounted"
backup_destination_host: "{{ groups.repository[0] if (custom_repository_url | default(false)) else (resolved_repository_hostname | default(groups.repository[0])) }}"
elasticsearch_snapshot_repository_name: epiphany
elasticsearch_snapshot_repository_location: /var/lib/elasticsearch-snapshots
opensearch_snapshot_repository_name: epiphany
opensearch_snapshot_repository_location: /var/lib/opensearch-snapshots

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
---
- name: Include default vars from opensearch role
include_vars:
file: roles/opensearch/defaults/main.yml
name: opensearch_defaults

- name: Include vars from opensearch role
romsok24 marked this conversation as resolved.
Show resolved Hide resolved
include_vars:
file: roles/opensearch/vars/main.yml
name: opensearch_vars

- name: Assert that the snapshot_name fact is defined and valid
assert:
that:
Expand All @@ -12,9 +22,9 @@
- name: Create snapshot archive
import_tasks: common/create_snapshot_archive.yml
vars:
snapshot_prefix: "elasticsearch_etc"
snapshot_prefix: "opensearch_conf"
dirs_to_archive:
- /etc/elasticsearch/
- "{{ opensearch_vars.specification.paths.opensearch_conf_dir }}"

- name: Create snapshot checksum
import_tasks: common/create_snapshot_checksum.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@

- debug: var=snapshot_name

- name: Include vars from opensearch_dashboards role
include_vars:
file: roles/opensearch_dashboards/vars/main.yml
name: opensearch_dashboards_vars

- name: Create snapshot archive
import_tasks: common/create_snapshot_archive.yml
vars:
snapshot_prefix: "kibana_etc"
snapshot_prefix: "opensearch_dashboards_conf_dir"
dirs_to_archive:
- /etc/kibana/
- "{{ opensearch_dashboards_vars.specification.paths.opensearch_dashboards_conf_dir }}"

- name: Create snapshot checksum
import_tasks: common/create_snapshot_checksum.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
- name: Include default vars from opensearch role
include_vars:
file: roles/opensearch/defaults/main.yml
name: opensearch_defaults

- name: Set helper facts
set_fact:
opensearch_endpoint: >-
https://{{ ansible_default_ipv4.address }}:9200
snapshot_name: >-
{{ ansible_date_time.iso8601_basic_short | replace('T','-') }}
vars:
uri_template: &uri
client_cert: "{{ opensearch_defaults.certificates.dirs.certs }}/{{ opensearch_defaults.certificates.files.admin.cert.filename }}"
client_key: "{{ opensearch_defaults.certificates.dirs.certs }}/{{ opensearch_defaults.certificates.files.admin.key.filename }}"
validate_certs: false
body_format: json

- name: Check cluster health
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_cluster/health"
method: GET
return_content: yes
register: cluster_status
until: cluster_status.json.status
retries: 60
delay: 1

- name: No backup warning
when: not cluster_status.json.number_of_nodes == 1
debug:
msg: "[WARNING] No snapshot backup created as only single-node cluster backup is supported."

- name: Snapshot backup
when: cluster_status.json.number_of_nodes == 1 # https://github.com/epiphany-platform/epiphany/blob/develop/docs/home/howto/BACKUP.md#logging
block:
- name: Ensure snapshot repository is defined
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_snapshot/{{ opensearch_snapshot_repository_name }}"
method: PUT
body:
type: fs
settings:
location: "{{ opensearch_snapshot_repository_location }}"
compress: true

- name: Trigger snapshot creation
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_snapshot/{{ opensearch_snapshot_repository_name }}/{{ snapshot_name }}"
method: PUT

- name: Wait (up to 12h) for snapshot completion
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_snapshot/{{ opensearch_snapshot_repository_name }}/{{ snapshot_name }}"
method: GET
register: uri_response
until: (uri_response.json.snapshots | selectattr('snapshot', 'equalto', snapshot_name) | first).state == "SUCCESS"
retries: "{{ (12 * 3600 // 10) | int }}" # 12h
delay: 10

- name: Find all snapshots
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_snapshot/{{ opensearch_snapshot_repository_name }}/_all"
method: GET
register: uri_response

- name: Delete old snapshots
uri:
<<: *uri
url: "{{ opensearch_endpoint }}/_snapshot/{{ opensearch_snapshot_repository_name }}/{{ item }}"
method: DELETE
loop: >-
{{ uri_response.json.snapshots | map(attribute='snapshot') | reject('equalto', snapshot_name) | list }}

- name: Create snapshot archive
import_tasks: common/create_snapshot_archive.yml
vars:
snapshot_prefix: "opensearch_snapshot"
dirs_to_archive:
- "{{ opensearch_snapshot_repository_location }}/"

- name: Create snapshot checksum
import_tasks: common/create_snapshot_checksum.yml

- name: Transfer artifacts via rsync
import_tasks: common/download_via_rsync.yml
vars:
artifacts:
- "{{ snapshot_path }}"
- "{{ snapshot_path }}.sha1"
4 changes: 2 additions & 2 deletions ansible/playbooks/roles/elasticsearch_curator/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Include installation task
include_tasks: install-es-curator-{{ ansible_os_family }}.yml
include_tasks: install-ops-curator-{{ ansible_os_family }}.yml
romsok24 marked this conversation as resolved.
Show resolved Hide resolved

- name: Include configuration tasks
include_tasks: configure-cron-jobs.yml
include_tasks: configure-cron-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: postgresql_defaults
when: "'postgresql' in group_names"

# Do not select Kibana configured to use ES deployed by 'opendistro_for_elasticsearch' role
# Do not select OpenSearch Dashboards configured host to use OpenSearch deployed by 'opensearch' role
- name: Set value for setup.kibana.host
set_fact:
setup_kibana_host: >-
Expand Down
Loading