Skip to content

Commit 824f931

Browse files
authored
Added instructions on using multiple cores to README (#39)
1 parent 7e5397b commit 824f931

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,49 @@ services:
7070

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

73+
## Multiple Solr Cores
74+
75+
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.
76+
77+
1. Define a mount point for each core you require. Add new mount points for each core, for example:
78+
```yml
79+
services:
80+
solr:
81+
volumes:
82+
- ./solr:/solr-conf
83+
- ./core2:/core2-conf
84+
- ./core3:/core3-conf
85+
```
86+
87+
2. Create the directories for your new cores' config, and copy the desired solr config in to it, eg:
88+
89+
`cp -R .ddev/solr .ddev/core2`
90+
91+
`cp -R .ddev/solr .ddev/core3`
92+
93+
`cp -R path/to/core2-config/* .ddev/core2/conf/`
94+
95+
`cp -R path/to/core3-config/* .ddev/core3/conf/`
96+
97+
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:
98+
```yml
99+
services:
100+
solr:
101+
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 "'
102+
```
103+
104+
5. Your finished [`.ddev/docker-compose.solr_extra.yaml`](docker-compose.solr_extra.yaml) file should now look something like this:
105+
```yml
106+
services:
107+
solr:
108+
volumes:
109+
- ./solr:/solr-conf
110+
- ./core2:/core2-conf
111+
- ./core3:/core3-conf
112+
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 "'
113+
```
114+
5. Finally, `ddev restart` to pick up the changes and create the new cores.
115+
73116
## Caveats
74117

75118
* 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.

0 commit comments

Comments
 (0)