Issues installing App Search locally using docker

Hello,

I wanted to give App Search a try and I wanted to install it locally using docker.

I followed the instructions located at App Search, Self Managed, Installation | Swiftype Documentation but it seems that no matter what, I cannot access the App Search app at http://localhost:3002

This is my docker-compose.yml:

version: '2.2'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    environment:
    - "node.name=es-node"
    - "discovery.type=single-node"
    - "cluster.name=app-search-docker-cluster"
    - "bootstrap.memory_lock=true"
    - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    - "cluster.routing.allocation.disk.threshold_enabled=true" 
    - "cluster.routing.allocation.disk.watermark.flood_stage=200mb"
    - "cluster.routing.allocation.disk.watermark.low=500mb" 
    - "cluster.routing.allocation.disk.watermark.high=300mb"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
      - 9300:9300
    volumes:
      - esdata01:/usr/share/elasticsearch/data

  appsearch:
    image: docker.elastic.co/app-search/app-search:7.2.0
    environment:
    - "elasticsearch.host=http://elasticsearch:9200"
    - "allow_es_settings_modification=true"
    - "JAVA_OPTS=-Xmx256m"
    ports:
    - 3002:3002
volumes:
    esdata01:
      driver: local

While this is the log I get when running docker-compose up:

▶ docker-compose up appsearch
Recreating appsearchtest_appsearch_1 ... done
Attaching to appsearchtest_appsearch_1
appsearch_1      | Found java executable in PATH
appsearch_1      | Java version: 1.8.0_212
appsearch_1      | 
appsearch_1      | App Search is starting. It will take a few moments. App Search includes the following stack components:
appsearch_1      |   - An application server
appsearch_1      |   - A pool of background workers
appsearch_1      |   - A filebeat instance for indexing logs
appsearch_1      | 
appsearch_1      | forego       | starting app-server.1 on port 5000
appsearch_1      | forego       | starting worker.1 on port 5100
appsearch_1      | forego       | starting filebeat.1 on port 5300
appsearch_1      | filebeat.1   | scripting container class loader urls: [file:/tmp/jruby8772327061860643696extract/lib/jruby-core-9.2.5.0-complete.jar, file:/tmp/jruby8772327061860643696extract/lib/jruby-rack-1.1.21.jar, file:/tmp/jruby8772327061860643696extract/lib/jruby-stdlib-9.2.5.0.jar]
appsearch_1      | app-server.1 | scripting container class loader urls: [file:/tmp/jruby4781859431772385646extract/lib/jruby-core-9.2.5.0-complete.jar, file:/tmp/jruby4781859431772385646extract/lib/jruby-rack-1.1.21.jar, file:/tmp/jruby4781859431772385646extract/lib/jruby-stdlib-9.2.5.0.jar]
appsearch_1      | worker.1     | scripting container class loader urls: [file:/tmp/jruby394617129645864115extract/lib/jruby-core-9.2.5.0-complete.jar, file:/tmp/jruby394617129645864115extract/lib/jruby-rack-1.1.21.jar, file:/tmp/jruby394617129645864115extract/lib/jruby-stdlib-9.2.5.0.jar]
appsearch_1      | app-server.1 | setting GEM_HOME to /tmp/jruby4781859431772385646extract/gems
appsearch_1      | app-server.1 | ... and BUNDLE_GEMFILE to /tmp/jruby4781859431772385646extract/Gemfile
appsearch_1      | app-server.1 | loading resource: /tmp/jruby4781859431772385646extract/./META-INF/rails.rb
appsearch_1      | app-server.1 | invoking /tmp/jruby4781859431772385646extract/./META-INF/rails.rb with: [runner, LocoTogo.start_app_server!]
appsearch_1      | filebeat.1   | setting GEM_HOME to /tmp/jruby8772327061860643696extract/gems
appsearch_1      | filebeat.1   | ... and BUNDLE_GEMFILE to /tmp/jruby8772327061860643696extract/Gemfile
appsearch_1      | filebeat.1   | loading resource: /tmp/jruby8772327061860643696extract/./META-INF/rails.rb
appsearch_1      | filebeat.1   | invoking /tmp/jruby8772327061860643696extract/./META-INF/rails.rb with: [runner, LocoTogo.start_filebeat!]
appsearch_1      | worker.1     | setting GEM_HOME to /tmp/jruby394617129645864115extract/gems
appsearch_1      | worker.1     | ... and BUNDLE_GEMFILE to /tmp/jruby394617129645864115extract/Gemfile
appsearch_1      | worker.1     | loading resource: /tmp/jruby394617129645864115extract/./META-INF/rails.rb
appsearch_1      | worker.1     | invoking /tmp/jruby394617129645864115extract/./META-INF/rails.rb with: [runner, LocoTogo.start_worker!]
appsearch_1      | filebeat.1   | Creating log directory: /usr/share/app-search/log
appsearch_1      | filebeat.1   | [2019-07-25T09:05:54.229+00:00][56][2000][rails][INFO]: App Search version=7.2.0, JRuby version=9.2.5.0, Ruby version=2.5.0, Rails version=4.2.11.1
appsearch_1      | app-server.1 | [2019-07-25T09:05:54.502+00:00][53][2000][rails][INFO]: App Search version=7.2.0, JRuby version=9.2.5.0, Ruby version=2.5.0, Rails version=4.2.11.1
appsearch_1      | worker.1     | [2019-07-25T09:06:02.025+00:00][55][2000][rails][INFO]: App Search version=7.2.0, JRuby version=9.2.5.0, Ruby version=2.5.0, Rails version=4.2.11.1

From the logs, it seems that the server is running on port 5000, but even exposing that port didn't work.

Could someone help me setup it?

Thank you :slight_smile:

The message starting app-server.1 on port 5000 is misleading as port 5000 or the other ones (5100 and 5300) aren't actually exposed but used internally in forego.

In the Docker compose config you are not exposing port 3002 as described in https://swiftype.com/documentation/app-search/self-managed/installation#docker-compose
I think that's the problem.

Hello @orhantoy,

Thank you for helping me out. Actually, it was a copy-paste error on my side: I've updated the original post with the correct content of the docker-compose.yml

I've removed everything and restarted from scratch, but it still doesn't work :frowning:

1 Like

Do you see any errors logged to the console?

No, no errors in the console.

I'll try to debug a bit more and post here my additional findings

1 Like

Even I'm facing the same issue with running elastic app search in docker windows.
Any luck? @jubstuff

Are both of you, @jubstuff and @rajithsam, on Docker Windows?

Yes I'm trying out in windows @orhantoy

@rajithsam @jubstuff

Thanks for sticking with it. :slight_smile:

How much ram do you have allocated to Docker? If you increase the amount (say to 6GB), does it boot as expected?

1 Like

@goodroot
I increased the size to 6GB & http://localhost:3002 worked! :slight_smile:
Thanks! :slightly_smiling_face:

@goodroot But I can't run http://appsearch:3002
Getting this error in command console
Error: App Search is unable to connect to Elasticsearch. Ensure a healthy Elasticsearch cluster is running at http://elasticsearch:9200 for user elastic.

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