Failed to connect to Elasticsearch backend. Make sure it is running

I am having trouble connecting App Search to Elasticsearch locally for development. I am running Elasticsearch 7.6.2 (docker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.2) and have connected Kibana 7.6.2 (docker pull docker.elastic.co/kibana/kibana:7.6.2) without issue. Using docker pull docker.elastic.co/app-search/app-search:7.6.2 to install App Search

curl http://localhost:9200

{
  "name" : "5b7f618a316a",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "MrxQNVX_TPGVQNQff94sJg",
  "version" : {
    "number" : "7.6.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
    "build_date" : "2020-03-26T06:34:37.794943Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

App Search env variables

elasticsearch.host: http://localhost:9200
secret_session_key: supersecretsessionkey
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
log_directory: /var/log/app-search
filebeat_log_directory: /var/log/app-search

I receive the error
[2020-05-28T18:08:56.066+00:00][12][2002][app-server][INFO]: Failed to connect to Elasticsearch backend. Make sure it is running.

Additional logs from Elasticsearch startup
{"type": "server", "timestamp": "2020-05-29T14:25:30,169Z", "level": "INFO", "component": "o.e.x.s.s.SecurityStatusChangeListener", "cluster.name": "docker-cluster", "node.name": "6d031b86dcfc", "message": "Active license is now [BASIC]; Security is disabled", "cluster.uuid": "hVHa5e6CTrCsU7niiB6aLQ", "node.id": "J7lDrqY0TBq4dDLWFgtPJQ" }

Could this be a license issue? (I see license is BASIC and security disabled)
Our production and other environment are hosted via Elastic cloud and setup and deployment is automated.

Update

After spending quite a bit of time failing to get this to work. I tried using docker compose with the follow yml config

version: "2"

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    environment:
      - "node.name=es-node"
      - "discovery.type=single-node"
      - "cluster.name=app-search-docker-cluster"
      - "bootstrap.memory_lock=true"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1

  appsearch:
    image: docker.elastic.co/app-search/app-search:7.6.2
    environment:
      - "elasticsearch.host=http://elasticsearch:9200"
      - "allow_es_settings_modification=true"
      - "JAVA_OPTS=-Xms2g -Xmx2g"
    ports:
      - 3002:3002

and was able to get app search running locally. Make sure to increase memory limits in docker to 4 gb or app search will crash. My app now has 2 instances of Elasticsearch running locally. One that the app uses for directly and one that app search uses. Is it possible to use only one or would the indexes interfere with each other?

Hey @mbrimmer83,

I'm glad you got that working.

My app now has 2 instances of Elasticsearch running locally. One that the app uses for directly and one that app search uses. Is it possible to use only one or would the indexes interfere with each other?

In development, it's definitely possible to use the Elasticsearch instance for multiple things. In production also, as long as you do so with caution. All App Search indexes are prefixed with .ent-search so they are easily identifiable. Be sure not to touch these indexes.

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