Self-hosted App Search limited to one ES Node?

I tried to configure a multi-node Elasticsearch (3 nodes) and an app search engine using Docker compose.

I finally got what I think is a working docker-compose.yml for this (The documentation on using Docker compose with App search only includes a single node instance)

However, in running it, I get the following error message:

appsearch-engine | [2020-01-15T20:36:12.852+00:00][14][2002][app-server][ERROR]:
appsearch-engine | --------------------------------------------------------------------------------
appsearch-engine |
appsearch-engine | Elasticsearch cluster must be licensed. OSS versions of Elasticsearch do not contain a supported license. Please download and run an Elasticsearch binary from Download Elasticsearch | Elastic to acquire a free, Basic license.
appsearch-engine |
appsearch-engine | --------------------------------------------------------------------------------

Does this mean we can not run multi-node Elasticsearch clusters backing app search if we self-host?

If this is is not the right interpretation, how do we apply a basic license to the docker-compose.yml during the startup?

Welcome!

Just use the standard distribution of elasticsearch instead of the OSS one. Remove -oss in your docker-compose.yml file.

Thanks for the reply David. I'm not using OSS version in my docker-compose explicitly. This is my compose file:

version: "3.7"
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/usr/share/elasticsearch/data
    networks:
      - elastic
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic

  appsearch:
    image: docker.elastic.co/app-search/app-search:7.5.1
    container_name: appsearch01
    environment:
    - "elasticsearch.host=http://es01:9200"
    - "allow_es_settings_modification=true"
    - "JAVA_OPTS=-Xms2g -Xmx2g"
    ports:
    - 3002:3002
    volumes:
      - appsearch01:/user/share/appsearch/data
    networks:
      - elastic      

volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local
  appsearch01:
    driver: local

networks:
  elastic:
    driver: bridge

Is there an explicitly switch or flag to specify that I want the standard distribution? I don't get this error the first time, but am getting this error consistently when I bring up the compose file subsequently.

Just as another data point, the current elastic search cluster i have up is on a basic license:

C:\Users\FredWang>curl -X POST "localhost:9200/_license/start_basic?pretty"
{
"acknowledged" : true,
"basic_was_started" : false,
"error_message" : "Operation failed: Current license is basic."
}

I tried this:

---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  appsearch:
    image: docker.elastic.co/app-search/app-search:$ELASTIC_VERSION
    environment:
    - "elasticsearch.host=http://elasticsearch:9200"
    - "allow_es_settings_modification=true"
    ports: ['3002:3002']
    networks: ['stack']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']

networks:
  stack: {}

With .env:

ELASTIC_VERSION=7.5.1

And this starts very well.

Thanks for the reply. The docker compose works fantastic in single node settings.

I have found intermitten errors complaining about license or inability to connect to the primary node when running a 3-node elastic search cluster with app search.

However, the workaround I've found is simply restarting the appsearch service using docker-compose. This works reliably every time.

Thanks.

May be it needs a "wait_for" like script?
Or probably app_search should wait for the correct license and try again?

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