Docker Elasticsearch up but not connecting python script

Hi,
I am have install Elasticsearch with docker it up but not able to make connection from python client.

docker-compose.yaml

version: '2.2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.7.2
    container_name: dks_docker_local
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - esnet
volumes:
  esdata1:
    driver: local

networks:
  esnet:

Python Client
client = Elasticsearch(hosts=[settings.ELASTIC_HOST])

Do you get an error? What is it?

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