I had similar issues getting yellow cluster status. I am using one node wazuh-indexer setup.
Configuration file for wazuh indexer has following settings regarding opensearch system indices -
https://opensearch.org/docs/latest/security/configuration/system-indices/plugins.security.system_indices.enabled: true
plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opendistro-notifications-*", ".opendistro-notebooks", ".opensearch-observability", ".opendistro-asynchronous-search-response*", ".replication-metadata-store"]
I was able to find unassigned shards using certificate authentication and curl, found this on
https://repost.aws/knowledge-center/opensearch-unassigned-shards# cd /etc/wazuh-indexer/certs
# curl --key admin-key.pem --cert admin.pem --insecure -XGET
https://127.0.0.1:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason | grep UNASSIGNED
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
.opendistro-ism-managed-index-history-2023.12.13-000015 0 r UNASSIGNED INDEX_CREATED
100 76723.opendistro-ism-managed-index-history-2023.12.15-000017 0 r UNASSIGNED INDEX_CREATED
100 76723 0 0 .opendistro-ism-managed-index-history-2023.12.01-000003 0 r UNASSIGNED INDEX_CREATED
523k .opendistro-ism-managed-index-history-2023.12.12-000014 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.08-000010 0 r UNASSIGNED INDEX_CREATED
0 --:-.opendistro-ism-config 0 r UNASSIGNED CLUSTER_RECOVERED
-:-- --:--:-- --:--:--.opendistro-alerting-config 0 r UNASSIGNED CLUSTER_RECOVERED
5.opendistro-ism-managed-index-history-2023.12.17-000019 0 r UNASSIGNED INDEX_CREATED
23.opendistro-ism-managed-index-history-2023.12.11-000013 0 r UNASSIGNED INDEX_CREATED
k
.opendistro-ism-managed-index-history-2023.12.10-000012 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.03-000005 0 r UNASSIGNED INDEX_CREATED
.opendistro-alerting-alerts 0 r UNASSIGNED CLUSTER_RECOVERED
.opendistro-ism-managed-index-history-2023.12.16-000018 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.11.29-000002 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.05-000007 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.09-000011 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.04-000006 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.07-000009 0 r UNASSIGNED INDEX_CREATED
.opendistro-ism-managed-index-history-2023.12.02-000004 0 r UNASSIGNED INDEX_CREATED
I have created index templates for all opensearch system indices and set number of replicas to 0 (
https://opensearch.org/docs/1.2/im-plugin/ism/settings/#audit-history-indices):
# cd /etc/wazuh-indexer/certs
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/ism_history_indices -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-ism-managed-index-history-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_alerting_config -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-alerting-config-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_alerting_alerts -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-alerting-alerts*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_anomaly_results -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-anomaly-results*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_anomaly_detector -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-anomaly-detector*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_anomaly_checkpoints -H 'Content-Type: application/json' -d'
{
"index_patterns": [
"..opendistro-anomaly-checkpoints*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_anomaly_detection_state -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-anomaly-detection-state*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_reports -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-reports-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_notifications -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-notifications-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_notebooks -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-notebooks"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opensearch_observability -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opensearch-observability"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/opendistro_asynchronous_search_response -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-asynchronous-search-response*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/_index_template/replication_metadata_store -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".replication-metadata-store"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
After creating templates I have changed number of replicas for all problematic indices using curl and certificate authentication
# cd /etc/wazuh-indexer/certs
# curl --key admin-key.pem --cert admin.pem --insecure -XPUT
https://127.0.0.1:9200/.opendistro-*/_settings -H 'Content-Type: application/json' -d'
{
"index" : {
"number_of_replicas" : 0
}
}'
Is there better solution for this problem ? I am missing any setting for opensearch system indices ?