[gdal-dev] Docker Opensearch

nagyrobi_r at yahoo.com nagyrobi_r at yahoo.com
Sun Nov 5 03:36:31 PST 2023


Hi All!

Has anybody managed to make Opensearch work with GDAL? I tried using the steps used in the GDAL documentation under Elasticsearch but i can't manage to make it work.

I am using the following setup:
A docker container for Opensearch deployed as follows:

# Disable memory paging and swapping.
sudo swapoff -a
# Edit the sysctl config file that defines the host's max map count.
 sudo vim /etc/sysctl.conf
# Set max map count to the recommended value of 262144.
vm.max_map_count=262144
# Reload the kernel parameters.
 sudo sysctl -p
#Deploy in docker
docker pull opensearchproject/opensearch:latest
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:latest
# Disable security
# Go into the container using docker exec -it -u 0 "containername/no" bash
# run the following: 
# dnf update
# dnf install vim
#Delete the plugins/opensearch-security folder on all nodes.
# rm -rf plugins/opensearch-security
# vim config/opensearch.yaml
# save and exit
#Delete all plugins.security.* configuration entries from opensearch.yml.

At this point in time there is no security on opensearch
using gdal 3.7.2 on ubuntu if i run:
ogrinfo ES:http://example.com:9200
i get some errors regarding handlers.

If i try uploading the same way i would try with elasticsearch:

1. ogr2ogr -lco INDEX_NAME=gdal-data -lco NOT_ANALYZED_FIELDS={ALL} -lco WRITE_MAPPING=./mapping.json ES:http://localhost:9200 my_shapefile.shp

2. ogr2ogr -lco INDEX_NAME=gdal-data -lco OVERWRITE_INDEX=YES -lco MAPPING=./mapping.json ES:http://localhost:9200 my_shapefile.shp

I get again an error regarding handlers again.
If i run the steps on a normal elasticsearch instance they work like a charm.


I would be very glad if somebody could help.

Kind regards,
Robert Nagy




More information about the gdal-dev mailing list