Today we are going to install Solr in our docker-compose. What should be better way to install Solr? Whether it should be installed inside tomcat container, or wordpress container, since wordpress has apache, or should it be installed in a separate container. To answer these questions I referred to a conference “Lucene/Solr revolution 2016” which was held last December. I came to know about it by this blog post.
Earlier I was of the impression that Solr is a service which runs within a server and provides help in indexing and searching within the site on the server. But when I saw it functional in a video, I realized that it a lot more than that.
Fortunately I came across another post where the blogger has deployed a
Solr container. The post Running Solr in Docker, talks about reasons of using Solr in docker and then goes on to explain the process in detail. The details regarding getting conf files and also deploying data, are done by using web interface. And I want it to be done by the docker-compose itself, so that end user does not have to do anything and gets a ready to use docker.
While looking for the configuration files I found them inside the Solr_data. To know about any setting during installation, I browsed install_solr.sh which was in github of reactome
release/scripts. And then came back to docker/solr_alpine. I noticed that most images we are using, are based on
openjdk:8-jre-alpine. Neo4j was also based on this and now Solr is also based on the same.
solr_data.gz were extracted in
ls solr/data results in
reactome solr.xml. They were mounted at proper place in container using
volumes: - ./solr/data:/opt/solr/server/solr/mycores
The process was initiated and after a while there were following errors:
Error loading class 'solr.admin.AdminHandlers'
Probably my version of Solr is different. And as said in this answer, I removed the following line from solrconfig.xml
<requestHandler name="/admin/" class="solr.admin.AdminHandlers"/>
Now it works fine. But I don’t know if I have done it correctly and if it is the way we wanted it to be. As of now, we have Solr ready and it is accessible in browser at localhost:8983. Earlier some other other cores were also getting created like,