docker-solr / docker-solr-examples

Examples for Docker-Solr
Apache License 2.0
61 stars 58 forks source link

Document sentinel bug #1

Closed acha5066 closed 4 years ago

acha5066 commented 5 years ago

In the schema-api-startup example a sentinel file is used to make sure the core isn't re-created if the container is restarted. This works fine however, if you do a docker-compose pull followed by a docker-compose up -d (or whatever the equivalent docker commands are) the sentinel file is lost and it will error because it attempts to re-create the core.

makuk66 commented 4 years ago

I'm not sure about this... it depends how you mounted where the core goes. If you're only creating the container, with no mounted volumes, so that you end up with sentinel and core in just the container overlay, then the sentinel approach ought to work as-is. Basically the core and the sentinel ought to be in the same spot. Once you start mounting volumes, you should have sentinel and core in the same place.

Anyway, now that we have /var/solr, this example should be updated to use that; and then change it to not use a sentinel but check for the core directory.

acha5066 commented 4 years ago

Admittedly, this was a while ago so I wasn't as familiar with it as I am now. I'm now using the solr-precreate script which appears to check for the /var/solr directory. I wasn't aware that we didn't need to mount the volumes though, so thanks for the tip. It appears after stopping the containers, without volumes my index is still there which is the desired behaviour..

makuk66 commented 4 years ago

It appears after stopping the containers, without volumes my index is still there which is the desired behaviour

Right; you can can start/stop those containers and retain the data in your overlay filesystem. Obviously when you remove the container, the data is also gone. And it's possible that you'd get better performance out of mounted volumes.