Backup before ES operations

Issue

We are planning to add a dedicated worker for ElasticSearch
We are planning to update the configuration of ElasticSearch

Environment

  • CloudBees Jenkins Enterprise (CJE)

Resolution

The normal process to add a ES new worker is :

1 - Execute cluster elasticsearch-backup operation to backup all ES data

cje prepare elasticsearch-backup
cje apply

2 - Check the snapshot it is completed and succeed with these commands

export ES_PASSWD=$(awk '/elasticsearch_password/ {print $3}' .dna/secrets)
export DOMAIN=$(awk '/domain_name/ {print $3}' .dna/project.config)
export ES_CREDS="admin:$ES_PASSWD"
export ES_URL="https://elasticsearch.$DOMAIN"

curl -f -s -XGET -u $ES_CREDS $ES_URL/_snapshot/tiger-backup/_all?pretty  > snapshots_backup.json

3 - Execute cluster worker-add operation with the new worker configuration

cje prepare worker-add
# worker-add is staged - review worker-add.config and edit as needed
cje apply

4 - Execute cluster worker-remove operation to remove the old worker

cje prepare worker-remove
# worker-remove is staged - review worker-remove.config and edit as needed
cje apply

5 - Execute cluster elasticsearch-restore operation to restore all ES data

cje prepare elasticsearch-restore
cje apply

The normal process to upgrade a ES configuration is :

1 - Execute cluster elasticsearch-backup operation to backup all ES data

cje prepare elasticsearch-backup
cje apply

2 - Execute cluster elasticsearch-update operation with the new worker configuration

cje prepare elasticsearch-update
# elasticsearch-update is staged - review elasticsearch-update.config and edit as needed
cje apply

3 - Execute cluster elasticsearch-restore operation to restore all ES data

cje prepare elasticsearch-restore
cje apply

If you do not do elasticsearch-backup operation you have some automatic old backup and you could use elasticsearch-restore operation to restore it, but you will have a gap in ES data.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.