OpenSearch Security not initialized

Excuse me,When I try to get a message about the OpenSearch cluster, I get an error as follows:
{
“error” : {
“root_cause” : [
{
“type” : “security_exception”,
“reason” : “OpenSearch Security not initialized for cluster:monitor/health”
}
],
“type” : “security_exception”,
“reason” : “OpenSearch Security not initialized for cluster:monitor/health”
},
“status” : 503
}
How can I initialize OpenSearch Security?

@chenqi
Most likely there is an error in config files which prevents from automatically initialising the index.

To troubleshoot, I would recommend running security_admin.sh script to try to upload the config:

./securityadmin.sh -cd ../securityconfig/ -icl -nhnv \
   -cacert ../../../config/root-ca.pem \
   -cert ../../../config/kirk.pem \
   -key ../../../config/kirk-key.pem

Any errors should be mentioned in the output.

Also assuming you have below line in opensearch.yml:

plugins.security.allow_default_init_securityindex: true

Thanks for your reply, it worked!