0

I am trying to set up a Search Engine using Docker-Compose, Django and Solr on a web server. In this instance, I am using Solr 4.10.

My issue is that while I can get the Solr service, the database and the Django application set up correctly, the Solr service is refusing connections to it. Any attempt to access Solr admin panel from my IP address has the Admin panel not load at all but not timeout either, meaning my page hangs on waiting for the Solr panel to send a reply.

I found out from this question that if I was forward ports, I would be able to access the admin panel on http://localhost:8983/solr/. So this leads me to assume that it is refusing all external connections.

I tried out a method specified here for only allowing specific IP addresses (which I would want anyway) but this does not seem to work either as my connection is still refused on both ends.

For reference, my Solr container uses Jetty and here is my docker-compose.yml:

solr:
  build: /home/ubuntu/search_engine_foodily_solr/SOLR_4.10/.
  ports:
    - "8983:8983"
  volumes:
    - /home/ubuntu/search_engine_foodily_solr/schema.xml

db:
  image: postgres:latest
  environment:
    POSTGRES_PASSWORD: searcher
    POSTGRES_USER: searcher
  volumes:
    - ./backups:/home/backups

web:
  build: .
  command:  bash -c "sleep 5 && python -u search_engine/manage.py runserver 0.0.0.0:8080"
  volumes:
    - .:/code
    - ../static:/code/static
  ports:
    - "80:8080"
  links:
    - db
    - solr 
  environment:
    - PYTHONUNBUFFERED=0
Community
  • 1
  • 1
GreenGodot
  • 6,030
  • 10
  • 37
  • 66
  • Can you access the admin panel when you build the container using an image? https://hub.docker.com/_/solr/ – 0x4a50 May 19 '16 at 08:46

2 Answers2

0

I actually experienced the same issue. So what I tried to do is not linking solr to web container like the following. And it finally worked.

solr:
  build: /home/ubuntu/search_engine_foodily_solr/SOLR_4.10/.
  ports:
    - "8983:8983"
  volumes:
    - /home/ubuntu/search_engine_foodily_solr/schema.xml

db:
  image: postgres:latest
  environment:
    POSTGRES_PASSWORD: searcher
    POSTGRES_USER: searcher
  volumes:
    - ./backups:/home/backups

web:
  build: .
  command:  bash -c "sleep 5 && python -u search_engine/manage.py runserver 0.0.0.0:8080"
  volumes:
    - .:/code
    - ../static:/code/static
  ports:
    - "80:8080"
  links:
    - db
  environment:
    - PYTHONUNBUFFERED=0 
frankdede
  • 395
  • 1
  • 3
  • 8
0

Try adding networks to the docker-compose file. Add all of your services to the same network.

Dimanshu Parihar
  • 347
  • 2
  • 12