Comments (10)
With the latest version of docker-solr you can now do something like:
docker run -P -i -v $PWD/apachesolr/solr-conf/solr-4.x:/myconfig solr solr-create -c drupalcore -d /myconfig
Alas that solr-4 config is not compatible with Solr 6, so you get error messages and no core. Fixing that config looks to be tracked upstream https://www.drupal.org/node/2453855 and https://www.drupal.org/node/2442077.
I tried the proposed https://www.drupal.org/project/1600962/git-instructions with:
docker run -P -d -v $PWD/other/apache_solr_common_configurations/conf/5.x/:/myconfig solr:5.3 solr-create -c mycore -d /myconfig
and that loaded. But I've not tried actually using it from Drupal container.
In any case, I don't think there's anything here to be done in docker-solr, so I'll close this bug.
from docker-solr.
Perhaps:
version: '2'
services:
solr:
image: docker-solr/docker-solr:5.3
ports:
- "8983:8983"
volumes:
- ./other/apache_solr_common_configurations/conf/5.x/:/myconfig
entrypoint:
- docker-entrypoint.sh
- solr-create
- -c
- mycore
- -d
- /myconfig
from docker-solr.
@mccrodp I agree that an officially-supported Docker image with the Apache Solr Search module's structure, and also an officially-supported Docker image with the Search API Solr module's structure would be nice... as an unofficial maintainer for these Docker images, it would certainly save me some time, since I don't use these modules on every project, so I don't always update my images as fast as the upstream modules change.
However, this issue is filed in the queue for the Apache Solr software project itself (a generic search backend written in Java and used by many other pieces of software, two of which are Drupal's Apache Solr Search module, and Drupal's Search API Solr module)... I think the maintainers of those Drupal modules should be the ones providing the official support, not the maintainers of Apache Solr itself.
So you'd probably get better results by filing this feature request in those modules' issue queues instead:
- The Apache Solr Search module's issue queue: https://www.drupal.org/project/issues/apachesolr
- The Search API Solr module's issue queue: https://www.drupal.org/project/issues/search_api_solr
Background...
Solr is a generic database backend, similar to how MySQL is a generic database backend, and, like MySQL, Solr needs to have a structure created on it before Drupal can use it. Unlike MySQL, however, setting up Solr's structure is a bit more complicated, because you have to save files in a special directory on the filesystem and restart the server (as opposed to MySQL where you can set up a structure by running CREATE TABLE
statements and the new structure is available immediately). This means that the Apache Solr Search and Search API Solr modules cannot install / keep their own structures up-to-date the way that Drupal can with MySQL.
To make things more complicated, the Drupal ecosystem has a few different modules, mainly Apache Solr Search, and Search API Solr, each of which can allow Drupal to use Solr as it's search backend.
But the Solr structure that the Apache Solr Search module needs is incompatible with the Solr structure that the Search API Solr module needs, similar to the way that Backdrop and Drupal 8's MySQL database structures are incompatible.
Likewise, the data structure used by these modules changes with each version of the module, similar to how Drupal 7's database structure differs from Drupal 8's database structure.
from docker-solr.
Really appreciate this detailed response @mparker17, that really clarifies things from many angles.
Yes, it makes complete sense that the Apache Solr Drupal module maintainers are the ones pushing forward with integrations, but I guess if they had time they would be doing this also. I guess it's a similar case to the jQuery version being used in Drupal core, always a few steps behind to ensure compatibility. It is just unfortunate in this case that it blocks using the latest version and even this supported (generic) repo.
Drupal is gaining corporate momentum (which I guess is good and bad), so perhaps a company will come along and start being the official maintainers for something like this and they'll get to put their logo beside it 😉
Thanks for your work and help!
from docker-solr.
@mparker17 said:
I think the maintainers of those Drupal modules should be the ones providing the official support
I agree. The docker-solr image is just a generic Solr distribution for Docker, with as little deviation from the upstream Apache Solr project as possible. We won't be adding consumer-specific extra configuration.
Consumers of Solr should where possible use the Solr APIs and commands to create their desired configuration, rather than rely on config and custom images, so they can treat Solr as a black box that is then easier to upgrade.
I see in Drupal Apache Solr Search module documentation that is uses config files; you might find this comment useful as an example of how to modify configuration.
Another option may be to create a shell script that makes the required modification and then invokes Solr -- then make that script available to the container with a volume, and execute it instead of the default solr
command. That way you can docker run
an unmodified docker-solr image that is configured for your use, and you won't need to use cp
or exec
. You should be able to do that with docker compose
.
from docker-solr.
@makuk66 Thanks for this. While it is certainly helpful as a reference for myself for future it will also help others with more knowledge than me. My knowlege of Solr is somewhat limited, but growing, gradually.
I wonder is there potential for Drupal to interface directly with the Schema API then, perhaps in a Solr Schema API Drupal module, allowing for config through PHP or even a UI using a REST service or something to update the schema on the server Solr resides on. This may not be practical, but if it were, it could help the less Solr-savvy Drupal devs. I guess you'd have to be able to issue a restart of the Solr server from this UI then also, if so maybe it's not ideal in some ways.
from docker-solr.
@makuk66 how can you achieve that in a docker-compose file?
from docker-solr.
@makuk66 Thanks a lot. I think I'm still don't fully understand entrypoint, I will check this out.
from docker-solr.
@gagarine the differences between ENTRYPOINT
and CMD
are subtle (check out the documentation for the full picture).
Essentially, if you recall the syntax for the docker run
command...
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]
... using ENTRYPOINT
lets you set the [COMMAND]
part, meaning the syntax when running a image with an ENTRYPOINT
becomes...
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [ARG...]
... if you want to override the ENTRYPOINT
, you have to pass the option --entrypoint=/path/to/new-cmd
to docker run
.
You might find it helpful to think of Dockerfiles without ENTRYPOINT
lines as having a default ENTRYPOINT
of /bin/sh -c
. To use a simple example, docker run ubuntu:latest echo test
is kind-of like running docker run ubuntu:latest /bin/sh -c 'echo test'
(ubuntu:latest only has a CMD
, not an ENTRYPOINT
)
from docker-solr.
@mparker17 I think I got it, I will adapt my configurations accordingly. Thanks for your help.
from docker-solr.
Related Issues (20)
- Fixing the log4j vulnerability HOT 13
- CVE-2021-44228 Remediation in PR #396 Insufficient according to CVE-2021-45046 HOT 8
- Vulnerable SOLR-Images HOT 14
- Release new version of solr with log4j 2.17 HOT 7
- CVE-2021-44832 requies update of log4j HOT 1
- Set the maxBooleanClause
- Create multiple cores not working with dockerfile HOT 1
- Unable to create 2 cores with solr-precreate in docker-compose.yml HOT 3
- Solr logging suddenly stops and breaks whole docker daemon
- Create an easy way to turn off multivalue from Docker Compose
- java.lang.NumberFormatException from RequestHandlerBase or HttpSolrCall on Solr 8.11.1 HOT 1
- High and Critical Severity issues from the Scan HOT 2
- Change subpath HOT 2
- Cannot write to /var/solr as 8983:8983 HOT 1
- SOLR_HOME variable ignored in Solr core creation (solr-precreate script) HOT 1
- CRITICAL Vulnerability CVE-2021-22945 found in docker image HOT 1
- CVE-2022-27404 Vulnerability found HOT 1
- conf directory missing when using solr-precreate and host mounted directory HOT 2
- Include Example for Zookeeper Volume Mounts in docker-compose.yml HOT 1
- Critical Vulnerability CVE-2022-1292 OpenSSL found in image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-solr.