Not able to start enterprise search once I change the ip adress of ent_search.listen_host

Hi,

I'm running enterprise search 7.9.3 with docker on a server. When I try to run it on the localhost everything appears to be looking fine but I can't acess the interface. And when I change the ent-search.listen_host to my servers IP I get the following error after the "Success! Elastic Enterprise Search is starting successfully.":

java.io.IOException: Failed to bind to /10.3.50.6:3002 
Caused by: java.net.BindException: Cannot assign requested address

this is my configuration in my enterprise-search.yml

allow_es_settings_modification: true
elasticsearch.host: http://10.3.50.6:9200
ent_search.external_url: http://10.3.50.6:3002
ent_search.listen_host: 10.3.50.6

Could someone help me in finding out what I'm doing wrong?

Thank you!

Did you open the ports? Or are you sharing the same network between containers?
How do you start your containers?
Do you consider using docker compose instead?

yes the ports are open. I also don't have any trouble to connect to elasticsearch.

I simply start my enterprise search container with sudo docker run -p 3002:3002 docker.elastic.co/enterprise-search/enterprise-search:7.9.3 . How would docker compose solve the problem in this case?

Can you ssh in the docker instance where enterprise search is running and curl http://10.3.50.6:9200?

Here is how I'm setting that with docker compose.

Elasticsearch

File: docker-compose-elasticsearch.yml

---
version: '3'
services:

  elasticsearch:
    image: $IMG_ELASTICSEARCH:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms3g -Xmx3g"
      - cluster.routing.allocation.disk.threshold_enabled=false
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=true
      - xpack.security.authc.api_key.enabled=true
      - xpack.ml.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports: ["$ELASTICSEARCH_PORT:$ELASTICSEARCH_PORT"]
    networks: ['fscrawler_it']

networks:
  fscrawler_it: {}

Enterprise Search

File: docker-compose-enterprise-search.yml

---
version: '3'
services:

  enterprisesearch:
    image: $IMG_ENTERPRISE_SEARCH:$ELASTIC_VERSION
    environment:
      - "ent_search.auth.source=standard"
      - "elasticsearch.username=elastic"
      - "elasticsearch.password=$ELASTIC_PASSWORD"
      - "elasticsearch.host=http://elasticsearch:9200"
      - "allow_es_settings_modification=true"
      - "secret_management.encryption_keys=[XYZ]"
      - "ENT_SEARCH_DEFAULT_PASSWORD=$ELASTIC_PASSWORD"
    ports: ["$ENTERPRISE_SEARCH_PORT:$ENTERPRISE_SEARCH_PORT"]
    networks: ['fscrawler_it']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']
    restart: always

networks:
  fscrawler_it: {}

Settings

.env file is:

# Elastic Stack settings
ELASTIC_VERSION=7.10.0
ELASTIC_PASSWORD=changeme

# Elasticsearch settings
IMG_ELASTICSEARCH=docker.elastic.co/elasticsearch/elasticsearch
ELASTICSEARCH_PORT=9200

# Enterprise Search settings
IMG_ENTERPRISE_SEARCH=docker.elastic.co/enterprise-search/enterprise-search
ENTERPRISE_SEARCH_PORT=3002

Starting the stack

To start the stack:

docker-compose \
    -f docker-compose-elasticsearch.yml \
    -f docker-compose-enterprise-search.yml \
    up

Wait for everything to start. It could take several minutes:

enterprisesearch_1  | 2020-07-20 13:55:08.199:INFO:oejs.ServerConnector:main: Started ServerConnector@252570b9{HTTP/1.1}{0.0.0.0:3002}
enterprisesearch_1  | 2020-07-20 13:55:08.199:INFO:oejs.Server:main: Started @342868ms

Source

That worked, thank you!