SOT
    • Introduction
    • User manual
      • Getting started
        • Device registration overview
          • Registering a device
          • Self-registration of devices
        • Device claiming
          • Adding a ctrlX Core device
          • Adding a Rexroth connectivity unit device
      • Device overview
        • Setting the filter for the search
        • Device details
        • Edit device properties
        • Roll out artifacts on one or more devices
        • Rolling out a distribution
      • Device groups
        • Creating a device group
      • Machine overview
        • Create, edit and delete machines
        • Adding machines and devices via CSV file import
        • Structure of the CSV import file
      • Activity overview
      • Distribution overview
        • Managing distributions
        • Managing commands in a distribution
    • Operations manual
      • Overview
      • System architecture and interfaces
        • Element descriptions
        • Network connections overview
      • System requirements
        • General system requirements
        • Ingress controller
        • idm/idm-device-administration-app
        • idm/idm-software-management-app
        • idm/idm-device-monitoring-app
        • idm/idm-device-master-data-mgmt-app
        • idm/idm-device-app
        • idm/idm-solution-app
        • idm/idm-webapp-backend
        • idm/idm-device-tunnel-app
        • idm/idm-artifact-repository
        • bci-app/opensearch
        • bci-app/opensearch-dashboards
        • bci-app/valkey
        • bci-app/nginx
        • bci-kube/nexeed-ansible-operator
      • Migration from previous versions
      • Setup and configuration
        • Installation guide
          • How to initialize OpenSearch
          • How to create MACMA tenants with basic authentication
          • How to configure tenants for artifact-related use cases
        • Configuration
          • Detailed configuration parameters
          • Recommendations for service meshes
      • Start and shutdown
      • Regular operations
        • Whitelist new certificate
      • Failure handling
        • Device Portal data is out of sync
        • How to synchronize devices and machines to OpenSearch
        • Synchronize communication id mapping to key-value store (Redis/Valkey)
      • Backup and Restore
      • Logging and monitoring
      • Known limitations
    • Developer guide
      • Communication ID
      • Adding diagnostic functionality to devices
      • Add command processing to devices
      • Add the backup/restore functionality to devices
      • Reducing data consumption of device communication
      • Access through a custom application
    • Artifact Repository guide
      • Introduction
      • Providing artifacts for roll-out
        • Establishing a connection to the Device Portal
        • Uploading and managing artifacts in the repository
      • Downloading artifacts
      • Sending commands
    • API documentation
    • Glossary
Device Portal
  • Smart Operations Toolkit
    • Deviation Processor
    • Multitenant Access Control
    • Notification Service
    • Ticket Management
    • Web Portal
  • Shopfloor Management
    • Andon Live
    • KPI Reporting
    • Operational Routines
    • Shift Book
    • Shopfloor Management Administration
  • Product & Quality
    • Process Quality
    • AI Services
  • Machine & Equipment
    • Condition Monitoring
    • Device Portal
  • Enterprise & Shopfloor Integration
    • Information Router
    • Master Data Management

SOT Learning Portal

  • Device Portal
  • Operations manual
  • Failure handling
  • How to synchronize devices and machines to OpenSearch

How to synchronize devices and machines to OpenSearch

Be aware that this How-To requires having running instances of OpenSearch and OpenSearch Dashboards in place. Using the following endpoints allows verifying the health of an OpenSearch deployment:

  • OpenSearch: https://{url-to-service}/_cluster/health/?level=indices

  • OpenSearch Dashboards: https://{url-to-service}/app/home#/

Because of performance reasons, device and machine data is queried from OpenSearch. Therefore, it is necessary to synchronize the device and machine data using the corresponding endpoints provided by the Device Master Data Management service and the Device Monitoring service. This is necessary in the following cases:

  • OpenSearch has been set up in a new environment ( initial sync)

  • Desaster Recovery

  • The database and OpenSearch are out of sync ( amount of devices on database != amount of entries on index), further reading: Device Portal data is out of sync

Synchronize master data of devices and machines

POST <device-master-data-mgmt-base-URL>/operation/v1/synchronize/devicesToOpenSearch
or
POST <device-master-data-mgmt-base-URL>/operation/v1/synchronize/machinesToOpenSearch
{
    "itemCountPerBatch": 400,
    "concurrentBatchCount": 5,
    "retryCount": 1,
    "batchOffset": 0,
    "batchCount": 500
}

Synchronize multiple times

Depending on the amount of Devices or Machines in an environment and the chosen parameters, it’s necessary to execute the request multiple times with an adjusted batch offset.

Example: The first synchronization request returns the following response:

{
    "totalItemCount": 200000,
    "totalBatchCount": 1251,
    "updatedItemCount": 200000,
    "failedItemCount": 0
}

⇒ As we chose a batchCount of 500, and there are 1251 batches in sum, we need to send two more requests with an adjusted batchOffset:

{
    "itemCountPerBatch": 400,
    "concurrentBatchCount": 5,
    "retryCount": 1,
    "batchOffset": 0,
    "batchCount": 500
}
{
    "itemCountPerBatch": 400,
    "concurrentBatchCount": 5,
    "retryCount": 1,
    "batchOffset": 1000, # Now performing updates for batches from 1000 to 1251
    "batchCount": 300
}

Amount of concurrency

The value in the sample are "optimized" for the Nexeed production environment. Depending on the environment, it might make sense to increase or decrease concurrency.

In case the request returns an erroneous response, e.g.

{
    "timestamp": 1646721865636,
    "path": "/synchronize/v1/devicesToOpenSearch",,
    "status": 500,
    "error": "Internal Server Error",
    "message": "Retries exhausted: 1/1",
    "requestId": "149aeb12-11"
},

it is necessary to decrease the amount of concurrency.

Hint: As the endpoint is implemented with a "create-or-update" semantic, there’s no need to adjust the batchOffset in the error case.

Synchronize device-machine relations

After the initial synchronization of the master data of devices and machines it is necessary to also synchronize the device-machine relations (machineId property in devices index).

Changes regarding device-machine relations are synchronized automatically. But in case of inconsistencies this endpoint provided by the Device Master Data Management service can be used to correct the device-machine relations.

POST <device-master-data-mgmt-base-URL>/operation/v1/synchronize/deviceMachineRelationsToOpenSearch

Synchronize status data of devices

Changes regarding status data of devices are synchronized automatically. But in case of inconsistencies the following endpoint provided by the Device Monitoring service can be used to correct the status data of devices.

POST <device-monitoring-base-URL>/operation/v1/synchronize/searchService
{
    "deviceCountPerBatch": 400,
    "concurrentBatchCount": 5,
    "limitQueriesPerSecond": 3,
    "limitRequestsPerSecond": 3,
    "createdAfterMs": -1  // means all
}

Contents

© Robert Bosch Manufacturing Solutions GmbH 2023-2026, all rights reserved

Changelog Corporate information Legal notice Data protection notice Third party licenses