This SAS KB article provides the curl commands to list the current indices in openSearch. These commands enable you to assess the primary shards in openSearch and determine whether the data is properly configured for the data volume.
Complete the following steps to list the current indices in openSearch:
- Get a list of namespaces:
kubectl get namespaces
- Get the name of the pod for opendistro:
kubectl get pods -n viya | grep sas-opendistro
- Get secrets for opendistro:
kubectl get secrets -n viya | grep -i opendistro
Response:
sas-opendistro-certificate Opaque 6 3y173d
sas-opendistro-keystore-secret Opaque 1 410d
sas-opendistro-sasadmin-secret kubernetes.io/basic-auth 2 3y173d
- Decode the user secret user name:
kubectl get secret sas-opendistro-sasadmin-secret \
-n viya \
-o jsonpath="{.data.username}" | base64 -d
Response:
sasadmin
- Decode the password:
kubectl get secret sas-opendistro-sasadmin-secret \
-n viya \
-o jsonpath="{.data.password}" | base64 -d
Response:
abc123ab-xxxx-xxxx-abc1-abc123abc123
- Enter the opendistro pod:
kubectl exec -it sas-opendistro-default-0 -n viya -- /bin/bash
Response:
Defaulted container "sas-opendistro" out of: sas-opendistro, sas-certframe (init), sas-opendistro-sysctl (init)
- Run the /_cat/indices curl command from within the pod:
curl -u sasadmin:abc123ab-xxxx-xxxx-abc1-abc123abc123 \
http://localhost:9200/_cat/indices?v | sort
Response:

- Assess the data distribution by comparing the number of primary shards (labeled pri) with the volume of data (labeled pri.store.size). According to the SAS® Visual Investigator documentation, each primary shard should be approximately 10G. So, to determine how many primary shards the data object should have, divide the pri.store.size value by ten. See About Advanced Search Index Properties for additional information.
In addition to the recommended size of primary shards, the documentation above also references dedicated indexes for relationships. The document_link index contains all of the relationship links in SAS Visual Investigator. If the document_link becomes too big, index performance might deteriorate, and indexing errors might occur. To circumvent this issue, create dedicated indexes for any relationship that contains more than 1,000,000 links.
Once you create a relationship for a dedicated index, you cannot revert the change. You will need to delete the relationship from SAS Visual Investigator and recreate it. Use Export Configuration to create a backup of the environment before making any changes.