Options

Edit /usr/share/elasticsearch/config/elasticsearch.yml.

cluster.name: "simple"
network.host: 0.0.0.0
xpack.security.enabled: true
discovery.type: single-node
# auto password
./bin/elasticsearch-setup-passwords auto
# setup custom pass
./bin/elasticsearch-setup-passwords interactive

API

pip install elasticsearch

from elasticsearch import Elasticsearch
client = Elasticsearch(hosts="http://username:password@es-endpoint:es-port/")
client.info()
# show indices
curl -X GET "http://localhost:9300/_cat/indices?v"