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 1 commit
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
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,38 @@ 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, you'll need to edit the file [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than editing, which orphans the add-on, use a docker-compose.solr_extra.yaml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback - i've updated the instructions accordingly


1. Define a mount point for each core you require. By default, a mount point is created mounting the config in .ddev/solr into the container as solr-conf. Find the section under volumes, and 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. Change 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. 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.