You will now create an index and replication rule that will copy data from the leader to the follower domain.
Be sure that the URL does not contain a following forward slash.
The OpenSearch_API_Examples repository will be automatically pulled down to your environment. Do the following within the Cloud9 console.
In the terminal window, run the following commands:
pip install requests
python OpenSearch_API_Examples/Cross_Cluster_Replication/cross_cluster_replication.py
The image below highlights the commands.
The script creates and index called log-data-1, inserts a sample document, and creates a replication rule for all indexes that start with ‘log’.
Open the Leader OpenSearch Dashboard. Once you open the dashboard URL you will be prompted to login.
Enter OSMasterUser
as the username
Enter AwS#OpenSearch1
as the password
Click on Log In
If an additional pop up window is present after login asking about data upload click on Explore on my own
If an additional pop up windows is present asking you to select your tenant select Global and click on Confirm
Once you have logged in to the OpenSearch dashboard
SELECT * FROM log-data-1
Observe that the result sets match between Leader and Follower.
python OpenSearch_API_Examples/Cross_Cluster_Replication/cross_cluster_replication.py
When you are ready, proceed to the next step Clean Up if you want to delete the resources you used for this workshop.