Rolling over indices: General procedure

Provided that the appropriate index template exists, you can create a new OpenSearch index by running _rollover POST requests.

About this task

Depending on the number of events that are processed by the Flink jobs, the corresponding OpenSearch indices might become huge, which would result in a drop in performance while OpenSearch indices or searches documents. In that case, the OpenSearch rollover API provides a way to stop using the current index and use a brand new index instead. For more information about the rollover index API, see the Rollover External link opens a new window or tab page of the OpenSearch documentation.
Important: For event emitter jobs, multiple indices storing active summaries are not supported. To create new indices in this case, additional steps are necessary. See Rolling over indices that store active summaries.

Procedure

Run the following REST API request, where alias_name is the write alias that applies to the source index, and pass a payload so that the proper aliases are created.
POST <alias_name>/_rollover

To override any values from the index template, such as the number of shards or replicas, pass them to the _rollover request body. For details, see the Create Index External link opens a new window or tab page of the OpenSearch documentation.

The following table lists which alias name to use in the URI and which JSON payload to pass to the POST request.
Table 1. Alias names and JSON payload for index POST requests
Data stored in the index Alias name to use in the URI Request body
BPEL active summaries (bawadv) icp4ba-bai-bawadv-summaries-active-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-bawadv-summaries-ibm-bai": {}
  }
}
BPEL completed summaries (bawadv) icp4ba-bai-bawadv-summaries-completed-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-bawadv-summaries-ibm-bai": {},
    "icp4ba-bai-bawadv-summaries-completed-ibm-bai": {}
  }
}
BPMN time series icp4ba-bai-process-timeseries-write-ibm-bai
{ "aliases": { "icp4ba-bai-process-summaries-ibm-bai": {} } }
BPMN active summaries icp4ba-bai-process-summaries-active-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-process-summaries-ibm-bai": {}
  }
}
BPMN completed summaries icp4ba-bai-process-summaries-completed-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-process-summaries-ibm-bai": {},
    "icp4ba-bai-process-summaries-completed-ibm-bai": {}
  }
}
Case active summaries icp4ba-bai-case-summaries-active-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-case-summaries-ibm-bai": {}
  }
}
Case completed summaries icp4ba-bai-case-summaries-completed-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-case-summaries-ibm-bai": {},
    "icp4ba-bai-case-summaries-completed-ibm-bai": {}
  }
}
ODM time series icp4ba-bai-odm-timeseries-write-ibm-bai
{
  "aliases": {
    "icp4ba-bai-odm-timeseries-ibm-bai": {}
  }
}
Content time series icp4ba-bai-content-timeseries-write-ibm-bai
{ 
  "aliases": {
    "icp4ba-bai-content-timeseries-ibm-bai": {}
  } 
}

Results

The name of the new index contains the date and time appended, and the write alias is moved to the new index.