GDAL not able to connect to Elastic Search

I am pretty new to Elasticsearch. I have installed both Elasticsearch and kibana. I am able to connect to Elasticsearch by https://localhost:9200.

I am trying to ingest geospatial data as mentioned in this blog - How to ingest geospatial data into Elasticsearch with GDAL | Elastic Blog

However for some reason, I am not able to run this command -
$ogrinfo ES:http://localhost:9200

or this command
$ogrinfo ES:https://elastic:(my actual password)@localhost.com:9243 (which is for secutiry enabled like mine)
I also tried -
$ogrinfo ES:https://elastic:(my actual password)@localhost.com:9200

For the commands above, GDAL was not able to connect to elasticsearch. Can anyone suggest what is going wrong? or what different I should do for loading the shapefile into Elasticsearch?

Thanks

Hi @Purnima_J

Can you share the error from GDAL?

Hi,

It says “ empty reply from the server” error 1: unable to open existing output datasource “ES:http://localhost:9200” and another error that I got was ssl certificate problem! Self signed certificate in certificate chain when I tried to access by ogrinfo ES:https://local host:9200. I had to disable the xsecurity settings in Elasticsearch.yaml config file to connect to ogr as a temporary solution. However, I would like to set up security settings and make this work as permanent solution.

Thanks Purnima,

  • Can you tell me which version of Elasticsearch you are using?
  • Also, can you tell me which version of GDAL you are using?

I had to disable the xsecurity settings in Elasticsearch.yaml config file to connect to ogr as a temporary solution.

GDAL can connect to your Elasticsearch instance when security is disabled in Elasticsearch? Do you have a .netrc file in your $HOME directory?

I do not have .netrc file in the home directory!
I am using elasticsearch version 8.3.0 and GDAL version is GDAL 3.5.0

Could you try running ogrinfo with --debug ON and see if there are any helpful errors?

If not, maybe try running with --config CPL_CURL_VERBOSE ON and see if there are helpful errors. Warning, this will print a lot of logs.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.