Skip to content

Commit

Permalink
Adds "Updating Apache Solr configuration" section, fixes #1644 (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctorgalson authored and rfay committed Sep 16, 2019
1 parent 8d4142f commit bcc8ec9
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/users/extend/additional-services.md
Expand Up @@ -5,21 +5,37 @@ ddev projects can be extended to provide additional services. This is achieved b
If you need a service not provided here, see [Defining an additional service with Docker Compose](custom-compose-files.md)

## Apache Solr
This recipe adds an Apache Solr container to a project. It will setup a solr core with the solr configuration you define.
This recipe adds an Apache Solr container to a project. It will set up a solr core with the solr configuration you define.

**Installation:**

- Copy [docker-compose.solr.yaml](https://github.com/drud/ddev/tree/master/pkg/servicetest/testdata/services/docker-compose.solr.yaml) to the .ddev folder for your project.
- You can change the Solr version by changing the `image` value in docker-compose.solr.yaml, for example: `image: solr:6.6`. The most obvious official solr image tags are at [hub.docker.com](https://hub.docker.com/_/solr/).
- Create the folder path .ddev/solr/conf.
- Copy the solr configuration files for your project to .ddev/solr/conf. _e.g., using Drupal Search API Solr, you would copy the solr-conf/5.x/ contents from the module code base into .ddev/solr/conf._
- Copy the Solr configuration files for your project to `.ddev/solr/conf`. e.g. if using Drupal Search API Solr, you would copy the `web/modules/contrib/search_api_solr/solr-conf-templates/6.x/ `contents from the module code base into `.ddev/solr/conf`.
- Ensure that the configuration files are present before running `ddev start`.

**Drupal8-specific extra steps:**
- Enable the Search API Solr Search Defaults module and edit the server settings at `/admin/config/search/search-api/server/default_solr_server/edit`.
- Change the _Solr core_ setting to `dev` and under **Advanced Server Configuration** change the _solr.install.dir_ setting to `/opt/solr`.
- Go to the view tab and download the updated config.zip file and then stop the project `ddev stop`.
- Remove the original configuration files from `.ddev/solr/conf` and add the updated files from config.zip.
- In order for changes to take effect you must remove the Solr volume by running `docker volume rm ddev-PROJECT-NAME_solrdata` e.g. if your project is called "myproject" then you would run `docker volume rm ddev-myproject_solrdata`.
- Now you can start the project `ddev start`.

**Updating Apache Solr configuration**

- Run `ddev stop` to stop your application.
- Run `ddev remove` to remove your application's containers (note: if you do not use the [destructive option](cli-usage#removing-projects-from-your-collection-known-to-ddev), the index will be untouched).
- copy the new solr configuration files for your project to .ddev/solr/conf as described in **Installation**, above.
- Run `ddev start` to rebuild and restart the containers.
- An excellent way to automate the updating of the solr config uses a [solr-init.sh](https://github.com/drud/ddev/pull/1645#issuecomment-503722974) script mounted into the solr container's `/docker-entrypoint-initdb.d/solr-init.sh`.

**Interacting with Apache Solr**

- The Solr admin interface will be accessible at: `http://<projectname>.ddev.site:8983/solr/` For example, if the project is named "myproject" the hostname will be: `http://myproject.ddev.site:8983/solr/`
- The Solr admin interface will be accessible at: `http://<projectname>.ddev.site:8983/solr/` For example, if the project is named "_myproject_" the hostname will be: `http://myproject.ddev.site:8983/solr/`.
- To access the Solr container from the web container use: `http://solr:8983/solr/`
- A Solr core is automatically created with the name "dev"; it can be accessed at the URL: http://solr:8983/solr/dev
- A Solr core is automatically created with the name "_dev_"; it can be accessed at the URL: `http://solr:8983/solr/dev`

## Memcached
This recipe adds a Memcached 1.5 container to a project. The default configuration allocates 128 MB of RAM for the Memcached instance; to change that or other command line arguments, edit the `command` array within the docker-compose file.
Expand Down

0 comments on commit bcc8ec9

Please sign in to comment.