Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added instructions on using multiple cores to README #39

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,49 @@ services:

You can delete the "dev" core from `http://<projectname>.ddev.site:8983/solr/#/~cores/dev` by clicking "Unload".

## Multiple Solr Cores

If you would like to use more than one Solr core, add a `.ddev/docker-compose.solr_extra.yaml` to override some of the default configuration.

1. Define a mount point for each core you require. Add new mount points for each core, for example:
```yml
services:
solr:
volumes:
- ./solr:/solr-conf
- ./core2:/core2-conf
- ./core3:/core3-conf
```

2. Create the directories for your new cores' config, and copy the desired solr config in to it, eg:

`cp -R .ddev/solr .ddev/core2`

`cp -R .ddev/solr .ddev/core3`

`cp -R path/to/core2-config/* .ddev/core2/conf/`

`cp -R path/to/core3-config/* .ddev/core3/conf/`

4. Set the 'entrypoint' value to use `precreate-core` instead of `solr-precreate` and add the additional cores, along with a command to start solr afterwards:
```yml
services:
solr:
entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh precreate-core solrconf /solr-conf ; precreate-core core2 /core2-conf ; precreate-core core3 /core3-conf ; exec solr -f "'
```

5. Your finished [`.ddev/docker-compose.solr_extra.yaml`](docker-compose.solr_extra.yaml) file should now look something like this:
```yml
services:
solr:
volumes:
- ./solr:/solr-conf
- ./core2:/core2-conf
- ./core3:/core3-conf
entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh precreate-core solrconf /solr-conf ; precreate-core core2 /core2-conf ; precreate-core core3 /core3-conf ; exec solr -f "'
```
5. Finally, `ddev restart` to pick up the changes and create the new cores.

## Caveats

* This recipe won't work with versions of Solr before `solr:8`, and Acquia's hosting [requires Solr 7](https://docs.acquia.com/acquia-search/). You'll want to see the [contributed recipes](https://github.com/ddev/ddev-contrib) for older versions of Solr.
Loading