Sharing an Experience Optimization OpenSearch cluster across a staging and live website
If you host a staging website and a live website, each with their own Content Delivery environment, you might want the two to use the same OpenSearch cluster, but different indexes for Experience Optimization. To achieve this, modify your scripts so that the indexes in both environments have different names.
About this task
By default, Experience Optimization services installed in one Content Delivery environment have the same index names as those installed in another Content Delivery environment. So long as each environment uses its own OpenSearch cluster, this is not a problem.
But if you want to use the same OpenSearch cluster for both environments, you need to ensure that the index names are unique. You can achieve this by adding a startup argument to your OpenSearch index installation scripts, or, if you do not use those, your microservice installation scripts.
Procedure
- In your staging environment, open a PowerShell command shell (Windows) or a Unix command shell (Unix).
- Navigate to the installation media folder Content Delivery\roles\xo\opensearch\, which contains the separate installation script for indexes, installOpenSearchIndexes.
- Run the shell script, supplying command line switches as needed, and add the command line switch
-index-common-name-prefix PREFIX(Windows) or--index-common-name-prefix PREFIX(Unix), where PREFIX is a unique string (for example,staging-orstg-) that Content Delivery prepends to the names of your OpenSearch indexes used in the staging environment. - Restart all the services you changed.
- Your OpenSearch indexes used in the staging environment now have a unique prefix that distinguishes them from those in the live environment. If you want, you can go through all the above steps on the live environment as well, adding a different unique prefix, called
live-for example.