Charmed OpenSearch How-to | Large Deployments | Backup & Restore

A Charmed OpenSearch backup can be stored on any S3-compatible storage. S3 access and configurations are managed with the s3-integrator charm.

This guide will teach how to extend the current juju actions to execute and manage backups in large deployment setups.

All commands are written for juju >= v.3.1.7

For more information, check the Juju Release Notes.

In large deployments, the juju application with the role of “main orchestrator” should be related with S3 integrator.

Configure S3

Follow the backup guide to setup an appropriate S3 target for this task.

Integrate with Charmed OpenSearch

The integration between OpenSearch in a large deployment setup and s3-integrator should happen only in the active cluster manager. The user should identify which juju application is currently the active cluster and relate it to s3-integrator.

In the example:

Model                                Controller           Cloud/Region         Version  SLA          Timestamp
test-large-deployment-upgrades-jbmj  localhost-localhost  localhost/localhost  3.4.2    unsupported  19:18:24+02:00

App                       Version  Status  Scale  Charm                               Channel        Rev  Exposed  Message
failover                           active      2  opensearch                          2/edge     86  no       
main                               active      1  opensearch                          2/edge     86  no       
opensearch                         active      3  opensearch                          2/edge     86  no       
self-signed-certificates           active      1  self-signed-certificates            latest/stable   72  no       

Unit                         Workload  Agent  Machine  Public address  Ports     Message
failover/0                   active    idle   0  9200/tcp  
failover/1*                  active    idle   1  9200/tcp  
main/0*                      active    idle   2  9200/tcp  
opensearch/0                 active    idle   4   9200/tcp  
opensearch/1                 active    idle   5  9200/tcp  
opensearch/2*                active    idle   6   9200/tcp  
self-signed-certificates/0*  active    idle   3            

Machine  State    Address         Inst id        Base          AZ  Message
0        started  juju-b0cc19-0  ubuntu@22.04      Running
1        started  juju-b0cc19-1  ubuntu@22.04      Running
2        started  juju-b0cc19-2  ubuntu@22.04      Running
3        started  juju-b0cc19-3  ubuntu@22.04      Running
4        started   juju-b0cc19-4  ubuntu@22.04      Running
5        started  juju-b0cc19-5  ubuntu@22.04      Running
6        started   juju-b0cc19-6  ubuntu@22.04      Running

The role of each juju application is:

  • “opensearch” application: non-cluster manager and data-only app
  • “failover” application: cluster manager app but does not contain the elected cluster manager unit
  • “main” application: cluster manager app that contains the cluster manager.

To integrate with S3, after the S3 configuration has been done as described above, run the following command:

juju integrate s3-integrator main

Interacting with Backups

The commands described in the previous documentation for backup creation, backup restore, cluster migration or listing backups are still valid and can be executed in large deployments on the main-orchestrator cluster.

In the example above, the the commands will be successful if executed as follows:

# Create a backup
juju run main/leader create-backup

# List available backups
juju run main/leader list-backups

# Recover from an existing backup
juju run main/leader juju run opensearch/leader restore backup-id=<ID>