[2024-04-30T09:55:49,614][ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [-Waz-Index1] uncaught exception in thread [main] org.opensearch.bootstrap.StartupException: java.lang.RuntimeException: can not run opensearch as root.
The error message you're seeing indicates that OpenSearch is attempting to run as the root user, which is not allowed for security reasons. OpenSearch, like many server-based applications, restricts running under the root user to avoid potential security risks that could affect the entire operating system.
To resolve you need to set ownership of opensearch to the Wazuh-indexer user.
sudo chown -R wazuh-indexer:wazuh-indexer /etc/wazuh-indexer/