Enabling xpack.security.enabled to true alone was not enough to start the elasticsearch, as it was giving the error, so we have generated the certificates and deployed it to all the nodes of elastic cluster and kibana using the official sites steps:
Our Elasticsearch.yml is like --->
#To Enable TLS layer Security
and our kibana.yml -->
elasticsearch.hosts: ["https://192.168.144.167:9200", "https://192.168.144.177:9200"]
After this we tried setting the ./elasticsearch-setup-passwords interactive --verbose
which gave us error for apm_system user but I guess the password is set for the cluster, but using the same password we are not able to access any node. Do we missed any thing in the step ? and how to resolve this issue now.