Kibana couldn't connect to remote elastic-search cluster

I'm configuring kibana:6.8.23 for remote elasticsearch host . I used docker compose file to install it. I use the env ELASTICSEARCH_HOSTS: '["my elasticsearch host"]' . But find that /usr/share/kibana/config/kibana.yamlfile not updated with the env from compose file. Then I tried edit file inside docker container and update the elasticsearch.hosts: [ "my elasticserch host" ] But connection is not establishing. I got the following error

2023-11-19 08:53:55 {"type":"log","@timestamp":"2023-11-19T08:53:55Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: my elasticsearch host"} 2023-11-19 08:53:57 {"type":"log","@timestamp":"2023-11-19T08:53:57Z","tags":["license","warning","xpack"],"pid":1,"message":"License information from the X-Pack plugin could not be obtained from Elasticsearch for the [data] cluster. Error: Request Timeout after 30000ms"}

Hi @nazmus_sakib_1987,

Welcome to the community! Can you please sure you're configuration?

Can I confirm you're using Kibana version 6.8? Which version of Elasticsearch are you using? If you are using version 6.8 I would recommend updating to an in support version as per the support matrix and EOL policy.