Skip to content

Jaeger Trace Snapshot and Restore through NFS Mount

Back up Jaeger trace indices to an NFS mount with OpenSearch snapshots, and restore them on another cluster.

16 min read Updated SS MR

Note

Scope. This page backs up Jaeger trace indices (jaeger-span-* and jaeger-service-*) with OpenSearch snapshots in a repository on an NFS mount that the source and target clusters share, and restores them on another cluster (a non-production restore cluster). To back up and restore any HEAL index with a snapshot folder on the OpenSearch node servers, see OpenSearch Snapshot and Restore. To change the retention of an index with an ISM policy, see Managing HEAL OpenSearch Index State Management (ISM) Policies.

Introduction#

Jaeger collects distributed trace data that can grow rapidly, requiring efficient storage, management, and backup strategies. OpenSearch’s Snapshot and Restore features provide a reliable way to back up and recover these indices, ensuring trace data integrity and operational continuity. Reindexing hourly Jaeger data into consolidated daily indices optimizes storage and query performance. This guide covers the processes to reindex, snapshot, and restore Jaeger trace data within OpenSearch effectively.

Cluster Prerequisites#

To store and restore OpenSearch (OS) snapshots between clusters, ensure the following requirements are met:

1. NFS Mount Path:

  • Configure a shared NFS mount path to store snapshots.
  • The mount point must be accessible from both source and target clusters.

2. Both clusters must run the same versions of the following modules:

  • OpenSearch 2.18
  • Grafana
  • Jaeger

3. User and Group Consistency: Ensure both environments have identical user and group configurations (user IDs (UIDs) and Group IDs (GIDs) must match across environments).

a. Execute the command below to verify the UID and GID

id <non-root-user>

Note: Outputs should be the same in both environments.

4. OpenSearch snapshot repository (in the NFS mount path): Ensure user and group ownership is similar to the HEAL installation.

5. Ensure that the NFS mount provides sufficient storage capacity for snapshots.

Note:

  1. Backup Copies
    • Always copy snapshots from the opensearchsnapshot repository (NFS mount) to a secondary backup location.
    • Restoring and later deleting data from another cluster also removes the snapshot from the NFS mount.
  2. Jaeger Snapshots
    • Take snapshots of the previous day’s index to support incremental backups and minimize loss.
    • Ensure snapshot names are unique per day.

NFS Server Prerequisites#

Ensure the following prerequisites are met:

1. A reachable NFS server must exist, and the user should have access to the server.

2. Port opening required from the HEAL server to the NFS server unidirectionally.

  • HEAL -> NFS server
  • Ports Required: 111 and 2049

3. Validate connectivity by testing the ports with telnet or nc from the HEAL server.

Configure NFS Mount in the HEAL Server#

Follow the steps below to configure the NFS mount in the HEAL server:

1. Create a new directory named 'opensearch' in nfs share location:

mkdir opensearch

2. Log in to the HEAL server.

3. Create a directory in any path as below:

mkdir nfsmount

4. Open the following file:

vi /etc/fstab

5. Add a new entry at the end of the file as below:

<NFS_SERVER_IP>:<nfs_shared_path in nfs server> <nfs folder path in heal server> nfs defaults 0 0
  • nfs_shared_path in nfs server -> full path of the opensearch directory created in step 1.
  • nfs folder path in the HEAL server -> full path of the directory created in step 3.

For example:

192.0.2.1:/opt/my_nfsshare/opensearch /opt/nfsmount nfs defaults 0 0

6. Save the file.

7. Execute the command below to reload the system's unit files and dependency graph after changes.

systemctl daemon-reload

8. Execute the following command to add an NFS mount point on the HEAL server.

mount -t nfs <NFS_SERVER_IP>:<nfs_shared_path in nfs server> <nfs folder path in the heal server>

For example:

mount -t nfs 192.0.2.1:/opt/my_nfsshare/opensearch /opt/nfsmount

9. After executing the above command, execute the following command to verify the new mount point:

df -h

Note: Repeat the above steps from 2 to 9 in all the OpenSearch nodes. Also, to add the mount in other servers, follow the same steps in all HEAL servers.

Section 1: OpenSearch Snapshot and Restore of Jaeger Daily Index#

OpenSearch’s Snapshot and Restore features offer a reliable way to back up and recover vital indices, enabling organizations to safeguard span and service logs against data loss or corruption. This guide outlines step-by-step procedures for configuring snapshot repositories on an NFS mount, registering them with OpenSearch, taking regular backups of Jaeger trace indices, and securely restoring data when needed—ensuring both operational continuity and compliance with retention policies.

The steps below help with OpenSearch snapshot and restore:

1. Create and configure a snapshot repository in the NFS mount path.

a. Navigate to the NFS mount path.

b. Create the snapshot folder by executing the command below:

mkdir opensearchsnapshot

Note: Ensure the opensearchsnapshot repository created in the NFS mount has the same user and group permissions as the heal installation.

c. Verify the ownership by executing the following command:

ls -l opensearchsnapshot

2. Navigate to the a1home directory.

a. Execute the below command to stop the OpenSearch Nomad service.

./stopServices.sh OPENSEARCH

3. Add the below volume parameter in all the OpenSearch Nomad files to specify the snapshot directory:

"/<NFS_MOUNT_PATH>/opensearchsnapshot:/usr/share/opensearch/opensearchsnapshot"

4. Navigate to the path below:

"/<InstallPath>/Appsone_Service/opensearch/config"

a. Add the below parameter to the opensearch.yml file and to all opensearch.yml.tpl files:

path.repo: ["/usr/share/opensearch/opensearchsnapshot"]

Note: Ensure the changes are performed in all the OpenSearch nodes.

5. Navigate to the a1home directory.

a. Start the OpenSearch Nomad service.

./startServices.sh DEFAULT

Note: The start script starts all OpenSearch nodes and skips default services that are already running.

6. Continue once the cluster reaches green status.

Register the Repository#

Follow the steps below to register the repository:

1. Execute the below cURL/API command in the HEAL server (where OpenSearch is running):

REST:

PUT _snapshot/opensearchsnapshot
{
  "type": "fs",
  "settings": {
    "location": "/usr/share/opensearch/opensearchsnapshot"
  }
}

cURL:

curl -k -u '<USER>:<PASS>' -H 'Content-Type: application/json' \
-X PUT "https://<opensearch_ip>:<opensearch_port>/_snapshot/opensearchsnapshot" \
-d '{ "type": "fs", "settings": { "location": "/usr/share/opensearch/opensearchsnapshot" } }'

Expected response:

{ "acknowledged": true }

Create Snapshots#

Follow the steps below to create a snapshot:

1. Snapshot all Jaeger indices (on the snapshot source cluster).

REST:

PUT _snapshot/opensearchsnapshot/<snapshot_name>
{
"indices": "jaeger-span-*,jaeger-service-*",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}

cURL:

curl -k -u '<USER>:<PASS>' -H 'Content-Type: application/json' \
 -X PUT "https://<opensearch_ip>:<port>/_snapshot/opensearchsnapshot/<snapshot_name>" \
 -d '{ "indices":"jaeger-span-*,jaeger-service-*", "ignore_unavailable":true,
"include_global_state":false, "partial":false }'

Note: The above commands will create a complete snapshot of the Jaeger indices.

2. Day-wise Jaeger snapshots (recommended):

REST:

PUT _snapshot/<repository name>/<snapshot name>
{
"indices": "jaeger-span-<date>, jaeger-service-<date>",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}

cURL:

curl -k -u '<USER>:<PASS>' -H 'Content-Type: application/json' \
-X PUT "https://<opensearch_ip>:<port>/_snapshot/opensearchsnapshot/<snapshot_name>" \
-d '{ "indices":"jaeger-span-<YYYY.MM.DD>,jaeger-service-<YYYY.MM.DD>",
"ignore_unavailable":true, "include_global_state":false, "partial":false }'

Note: It is recommended to take a daily snapshot of Jaeger indices for the previous day.

Tip: Add ?wait_for_completion=true if you want the API call to block until the snapshot finishes.

Parameters

  • indices: Comma-separated list or pattern (no spaces).
  • ignore_unavailable: Skip missing indices (default: false).
  • include_global_state: Exclude cluster state (use false here).
  • partial: Allow partial snapshots (default: false). This causes the entire snapshot to fail if one or more shards fail to be stored.

3. If you want to pause until the snapshot is finished, add the wait_for_completion parameter to your request.

Rest API:

PUT _snapshot/<repository name>/<snapshot name>?wait_for_completion=true
{
"indices": "jaeger-span-<date>, jaeger-service-<date>",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}

cURL

curl -XPUT -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository name>/<snapshot name>?wait_for_completion=true" -H 'Content-Type: application/json' -d'{ "indices":"jaeger-span-<date>,jaeger-service-<date>", "ignore_unavailable": true, "include_global_state":false, "partial": false}'

4. Snapshot states

  • SUCCESS – Snapshot stored all shards successfully
  • IN_PROGRESS – Snapshot currently running
  • PARTIAL – At least one shard failed (only possible if partial is true)
  • FAILED – Snapshot encountered an error; no data stored
  • INCOMPATIBLE – Snapshot is incompatible with the current OpenSearch version

5. Check progress and results

Snapshots won’t overlap: Only one snapshot can run at a time.

Status (all repos):

API:

GET _snapshot/_status

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:opensearch_port>/_snapshot/_status"

6. Ensure the snapshot is created successfully by executing the command below:

REST API:

GET _snapshot/<repository name>/_all

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository name>/_all"

Restore snapshots (on the restore server/cluster)#

Do not restore the live production cluster. Always use a non-production restore cluster, then export the necessary data.

1. Pre-checks:

  • The NFS path is mounted; it is the same as the Nomad volume and path.repo config exists on restore nodes (as above).
  • Restart OpenSearch; wait for the cluster to be green.
  • If needed, register the repo again (same JSON as earlier).
  • Ensure the below entries are mounted in all OpenSearch Nomad files volume sections:
"/<NFS_MOUNT_PATH>/opensearchsnapshot:/usr/share/opensearch/opensearchsnapshot"

2. Navigate to the directory below:

/<InstallPath>/Appsone_Service/opensearch/config directory

3. Ensure the entry below is present in opensearch.yml and all opensearch.yml.tpl files across all OpenSearch nodes.

path.repo: ["/usr/share/opensearch/opensearchsnapshot"]

4. If the above changes are not present on the restore server, update the configuration and restart the OpenSearch Nomad files (then wait until the cluster state is green and healthy).

5. The repository containing the snapshot must be registered by executing the following command:

REST API:

PUT _snapshot/opensearchsnapshot { "type": "fs", "settings": { "location": "/usr/share/opensearch/opensearchsnapshot" } }

cURL:

curl -XPUT -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository_name>" -H 'Content-Type: application/json' -d'{ "type": "fs", "settings": {"location": "/usr/share/opensearch/opensearchsnapshot" }}'

Expected output: If the request is successful, the response is as follows:

{ "acknowledged": true }

6. To view all snapshot repositories, execute the following command on the snapshot restore server:

API:

GET _snapshot/_all

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/_all"

7. Ensure the snapshot is available by executing the following command:

REST API:

GET _snapshot/<repository name>/_all

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository name>/_all"

Note: Select the required snapshot name from the output list.

8. Post-verifying the snapshot availability, execute the following restore command:

API:

POST _snapshot/<repository name>/<snapshot name>/_restore

cURL:

curl -XPOST -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository name>/<snapshot_name>/_restore"

9. Once the restoration is complete, verify the document count against the snapshot server.

Note: Before restoring the data, ensure that the restore server's Jaeger ISM policy has the required retention duration. To view older data in the Jaeger data source waterfall model, update the --es.max-span-age value in the Jaeger Nomad file according to the index date, and then restart the service.

To change the retention of the Jaeger ISM policy on the restore server, follow Updating an Existing ISM Policy.

Section 2: Hourly to Daily Reindex & Snapshot of Jaeger Data#

This section describes the process to reindex hourly Jaeger indices into consolidated daily indices for a specified date. This approach helps optimize storage and query efficiency by aggregating multiple hourly indices into a single daily index.

Prerequisites#

  1. Access to the HEAL server where OpenSearch is running.
  2. The reindexing script file (ReindexingScript.sh) is available to copy onto the HEAL server.

Steps to Reindex Hourly Data#

Follow the steps below to reindex the hourly data:

1. Copy the below script to the HEAL server:

ReindexingScript.sh

2. Determine the date for which hourly Jaeger indices need to be reindexed.

Execute the following command to get the date for "1 day ago" from the current date:

date -d '1 days ago' +%Y-%m-%d

Expected output:

2025-08-24

Note: The number of days is configurable.

For example, to get the 5 days ago date:

date -d '5 days ago' +%Y-%m-%d

Expected output:

2025-08-20

3. Verify the total hourly indices (both Jaeger span and Jaeger service) for the identified date using REST APIs or cURL commands.

REST APIs:

GET _cat/indices/jaeger-span-<date>*?v&s=store.size:desc&h=index,ss,dc
GET _cat/indices/jaeger-service-<date>*?v&s=store.size:desc&h=index,ss,dc

cURL Commands:

curl -ku healadmin:<password> -X GET "https://<opensearch_ip>:<port>/_cat/indices/jaeger-span-<date>*?v&s=store.size:desc&h=index,ss,dc"
curl -ku healadmin:<password> -X GET "https://<opensearch_ip>:<port>/_cat/indices/jaeger-service-<date>*?v&s=store.size:desc&h=index,ss,dc"

4. Update the Reindexing Script.

a. Open ReindexingScript.sh in an editor using:

vi ReindexingScript.sh

b. Update the OpenSearch connection details:

OSIP=<opensearch_ip>
OSPORT=<port>
OSUSER=<username>
OSPASS=<password>

For example:

OSIP=xxx.xxx.xx.xxx
OSPORT=9211
OSUSER=healadmin
OSPASS=<password>

c. Modify the date parameter at line 9 to target the desired number of days ago:

DATE=$(date -d '1 days ago' +%Y-%m-%d)

5. Save and close the script.

6. Execute the Reindexing Script:

./ReindexingScript.sh

7. Proceed once the script execution is complete.

Post-Reindexing Notes#

  • The script creates new indices named jaeger-span-historical-<date> and jaeger-service-historical-<date> for the specified date.
  • Verify the document count in these newly created daily historical indices against the total document count of the original hourly indices for accuracy.

Taking a Snapshot of Reindexed Data#

After successfully reindexing hourly Jaeger indices into daily (consolidated) historical indices, it is important to take a snapshot to back up the newly created indices. Follow the steps outlined below to verify, snapshot, and confirm the snapshot of the reindexed data.

Verify the Historical Indices#

1. Confirm that the reindexing process created the following two historical indices for the specified date:

  • jaeger-span-historical-<date>
  • jaeger-service-historical-<date>

2. To list and verify the new historical indices, execute the following REST API or cURL commands:

REST API:

GET _cat/indices/jaeger-*-historical-<date>*?v&s=store.size:desc&h=index,ss,dc

cURL:

curl -ku healadmin:<password> -X GET "https://<opensearch_ip>:<port>/_cat/indices/jaeger-*-historical-<date>*?v&s=store.size:desc&h=index,ss,dc"

Note: These indices contain the entire hourly data for the particular date condensed into a single daily index.

3. Create a Snapshot of the Reindexed Indices.

To take a snapshot of the reindexed historical indices, run the following REST API or cURL commands:

REST API:

PUT _snapshot/<repository_name>/<snapshot_name>
{
"indices": "jaeger-span-historical-<date>, jaeger-service-historical-<date>",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}

cURL:

curl -XPUT -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/<repository_name>/
<snapshot_name>" \
-H 'Content-Type: application/json' \
-d'{ "indices":"jaeger-span-historical-<date>,jaeger-service-historical-<date>", "ignore_unavailable": true, "include_global_state":false, "partial": false}'

4. Check Snapshot Status.

Monitor the snapshot creation status using either the REST API or cURL.

REST API:

GET _snapshot/_status

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:<opensearch_port>/_snapshot/_status"

Note: The status will remain IN_PROGRESS until the snapshot completes.

5. Confirm Snapshot Completion.

a. To verify that the snapshot has been successfully created, execute the following commands:

REST API:

GET _snapshot/<repository_name>/_all

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:opensearch_port>/_snapshot/<repository_name>/_all"

b. If the request is successful, then the response is as follows:

{ "snapshots": [] }

Restoring Reindexed Snapshot Data#

This section describes the process to restore reindexed daily historical snapshots in OpenSearch. Restoration should always be performed on a non-production cluster dedicated to restores, not on the live production cluster.

Prerequisites#

  • Ensure steps 3 and 4 under the SECTION 1 configuration have been completed.
  • Ensure the snapshot repository is correctly registered on the restore cluster by following the steps in the "Register the Repository" section.

Steps to Restore the Reindexed Snapshot#

1. List Available Snapshots: Retrieve all snapshots created in the specified repository to verify restore availability.

REST API:

GET _snapshot/<repository_name>/_all

cURL:

curl -XGET -k -u 'healadmin:<password>' "https://<opensearch_ip>:opensearch_port>/_snapshot/<repository_name>/_all"

2. Restore the reindexed Snapshot: After verifying the required snapshot exists, execute the restore command with the snapshot name.

REST API:

POST _snapshot/<repository_name>/<snapshot_name>/_restore

cURL:

curl -XPOST -k -u 'healadmin:<password>' "https://<opensearch_ip>:opensearch_port>/_snapshot/<repository_name>/<snapshot_name>/_restore"

3. Verify Restoration Success: After restoration completes, validate the document count of the restored historical indices against the snapshot server data to ensure completeness.

Section 3: ISM Policy#

When an ISM policy requires an update (for example, the retention of the Jaeger indices on the restore cluster), follow Updating an Existing ISM Policy in Managing HEAL OpenSearch Index State Management (ISM) Policies. It removes the policy from the indexes, backs up and deletes the old policy, recreates it with the new min_index_age, reattaches it to the indexes, and verifies the result.

Section 4: Automate Jaeger Snapshot Creation via Crontab#

This section enables automated OpenSearch snapshot management, including backup, restore, and deletion of snapshots. It allows users to configure snapshot settings, define retention policies, and store backups on NFS for reliable data persistence.

Pre-requisites#

Ensure the following prerequisites are met:

1. Follow the steps from the NFS mount point Pre-requisites.

2. Follow the steps from Configure NFS Mount in the HEAL Server.

3. Follow the steps from Section 1: OpenSearch Snapshot and Restore of Jaeger Daily Index (only till section Register the Repository).

Configuration#

Follow the configuration below:

1. On any HEAL database server, copy the "os_snapshot_restore.tar" file.

2. Untar the file:

tar -xvf os_snapshot_restore.tar

3. Navigate to the path below:

<path>/os_snapshot_restore

4. The following files must be available in the extracted directory:

  • config.conf
  • functions.sh
  • os_snapshot_manager.sh
  • README.txt

5. Open the config.conf file and update the required fields:

a) This field is the snapshot repository name. It must be the same default value.

SNAPSHOT_REPO=opensearchsnapshot

b) Provide the NFS mount path as defined in the volumes section of the OpenSearch Nomad files:

SNAPSHOT_PATH="<NFS path where snapshot must be copied>"

For example: In the OpenSearch Nomad volume section, consider the following mounted path:

"/opt/jaegerossnapshots/opensearchsnapshot:/usr/share/opensearch/opensearchsnapshot"
SNAPSHOT_PATH="/opt/jaegerossnapshots/opensearchsnapshot"

c) Provide the required retention period before taking a snapshot. Its default value is 7.

RETENTION_DAYS=7

Note: Based on the retention days, the script will take the Jaeger snapshot for each day and store it in NFS.

For example: The current date is 30th April, and based on 7-day retention, the script will take the Jaeger snapshot on 23rd April. This will take an incremental backup day-wise based on this logic. Script execution is handled via a cron job.

d) These are index names and retain the default value.

SPAN_PREFIX="jaeger-span" SERVICE_PREFIX="jaeger-service"

e) Type of index pattern: daily/hourly

For example:

  • If the index is on an hourly basis, then configure as below:
INDEX_TYPE="hourly"
  • If the index is on a daily basis, then configure as below:
INDEX_TYPE="daily"

f) This will be the default log file path during script execution (change the value if required).

LOG_FILE="/var/log/jim_snapshot.log"

6. Save the file.

Script Execution#

Script execution must be enabled via crontab to automate the snapshot creation process daily at a defined time. Snapshots are generated individually for each day rather than in bulk, which helps reduce load and traffic on the OpenSearch nodes.

Each snapshot is stored with a date-specific naming convention, making it easier to identify and restore data from backups when required.

1. To enable the above activity in crontab, follow the steps below:

a. Navigate to the extracted directory below:

cd /<path>/os_snapshot_restore

b. Identify the complete path using the command below:

pwd

c. Open the crontab using the command below:

crontab -e

d. Add a new entry in the format below:

5 0 * * * /<path>/os_snapshot_manager.sh backup

Note: The above cron will run a snapshot every day at 12:05 AM.

If required, change the cron time accordingly.

e. Save the changes.

2. Once the script executes, a snapshot will be created with any of the following formats:

Snapshot name format: hourly-jim-snap-YYYY-MM-DD
or
Snapshot name format: daily-jim-snap-YYYY-MM-DD

3. To check the snapshot status, execute the following curl or API command:

API command:

GET _snapshot/opensearchsnapshot/_all

Curl command:

curl -XGET -k -u <os_username>:<os_password> "https://<opensearch_ip>:<port>/_snapshot/opensearchsnapshot/_all"|jq .

Note: If the snapshot is still running, then "state" will be "IN-PROGRESS", and once it gets completed, "state" will be "SUCCESS".

4. Restore a snapshot by executing the below command:

./os_snapshot_manager.sh restore <snapshot_name>

Provide the required hourly/daily snapshot name for the restoration process.

a. To verify the successful restoration, check the status of the restored index post-execution.

For example:

API command:

  • Hourly index:
GET _cat/indices/jaeger-*-2026-04-28-*?v&s=store.size:desc
  • Daily index:
GET _cat/indices/jaeger-*-2026-04-28?v&s=store.size:desc

Curl command:

  • Hourly index:
curl -XGET -k -u healadmin:<password> "https://192.0.2.3:9211/_cat/indices/jaeger-*-2026-04-28-*?v&s=store.size:desc"
  • Daily index:
curl -XGET -k -u healadmin:<password> "https://192.0.2.3:9211/_cat/indices/jaeger-*-2026-04-24?v&s=store.size:desc"

Note: The above query will output all the indexes; "health" will be "yellow" during restoration, and once completed, it will be "green".

5. Delete Snapshot from NFS(s):

a. To delete a single snapshot:

./os_snapshot_manager.sh delete <snapshot_name>

b. To delete multiple snapshots:

./os_snapshot_manager.sh delete <snap1> <snap2> <snap3>

6. Delete Snapshot with Range.

a. Deletes snapshots in alphabetical order between FROM and TO (including both endpoints).

./os_snapshot_manager.sh delete-range <FROM_SNAPSHOT> <TO_SNAPSHOT>

Naming must follow:

hourly-jim-snap-YYYY-MM-DD
or
daily-jim-snap-YYYY-MM-DD

Note: If its hourly/daily index, then provide the respective valid index name range.

For example:

./os_snapshot_manager.sh delete-range hourly-jim-snap-2025-12-01 hourly-jim-snap-2025-12-10
./os_snapshot_manager.sh delete-range daily-jim-snap-2025-12-01 daily-jim-snap-2025-12-10

Related