markdownfmt compliance

This commit is contained in:
Martijn Koster 2016-09-18 23:05:23 +01:00
parent 8152390d1f
commit 644db56337
1 changed files with 16 additions and 28 deletions

View File

@ -87,22 +87,18 @@ You can combine this with mounted volumes to pass in core configuration from you
$ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-create -c mycore -d /myconfig $ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-create -c mycore -d /myconfig
``` ```
When using the `solr-create` command, Solr will log to the standard docker log (inspect with `docker logs`), When using the `solr-create` command, Solr will log to the standard docker log (inspect with `docker logs`), and the collection creation will happen in the background and log to `/opt/docker-solr/init.log`.
and the collection creation will happen in the background and log to `/opt/docker-solr/init.log`.
This first way closely mirrors the manual core creation steps and uses Solr's own tools to create the core, This first way closely mirrors the manual core creation steps and uses Solr's own tools to create the core, so should be reliable.
so should be reliable.
The second way of creating a core at start time is using the `solr-precreate` command. This will create the core The second way of creating a core at start time is using the `solr-precreate` command. This will create the core in the filesystem before running Solr. You should pass it the core name, and optionally the directory to copy the config from (this defaults to Solr's built-in "basic_configs"). For example:
in the filesystem before running Solr. You should pass it the core name, and optionally the directory to copy the
config from (this defaults to Solr's built-in "basic_configs"). For example:
```console ```console
$ docker run -d -P solr solr-precreate mycore $ docker run -d -P solr solr-precreate mycore
$ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-precreate mycore /myconfig $ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-precreate mycore /myconfig
``` ```
This method stores the core in an intermediate subdirectory called "mycores". This allows you to use mounted
volumes: This method stores the core in an intermediate subdirectory called "mycores". This allows you to use mounted volumes:
```console ```console
$ mkdir mycores $ mkdir mycores
@ -110,17 +106,15 @@ $ sudo chown 8983:8983 mycores
$ docker run -d -P -v $PWD/mycores:/opt/solr/server/solr/mycores solr solr-precreate mycore $ docker run -d -P -v $PWD/mycores:/opt/solr/server/solr/mycores solr solr-precreate mycore
``` ```
This second way is quicker, easier to monitor because it logs to the docker log, and can fail immediately if something is wrong. This second way is quicker, easier to monitor because it logs to the docker log, and can fail immediately if something is wrong. But, because it makes assumptions about Solr's "basic_configs", future upstream changes could break that.
But, because it makes assumptions about Solr's "basic_configs", future upstream changes could break that.
The third way of creating a core at startup is to use the image extension mechanism explained in the next section. The third way of creating a core at startup is to use the image extension mechanism explained in the next section.
## Using Docker Compose ## Using Docker Compose
With Docker Compose you can create a Solr container with the index stored in a named data volume. With Docker Compose you can create a Solr container with the index stored in a named data volume. Create a `docker-compose.yml` like:
Create a `docker-compose.yml` like:
``` ```yml
version: '2' version: '2'
services: services:
solr: solr:
@ -141,10 +135,7 @@ and just run `docker-compose up`.
## Extending the image ## Extending the image
The docker-solr image has an extension mechanism. At run time, before starting Solr, the container will execute scripts The docker-solr image has an extension mechanism. At run time, before starting Solr, the container will execute scripts in the `/docker-entrypoint-initdb.d/` directory. You can add your own scripts there either by using mounted volumes or by using a custom Dockerfile. These scripts can for example copy a core directory with pre-loaded data for continuous integration testing, or modify the Solr configuration.
in the `/docker-entrypoint-initdb.d/` directory. You can add your own scripts there either by using mounted volumes
or by using a custom Dockerfile. These scripts can for example copy a core directory with pre-loaded data for continuous
integration testing, or modify the Solr configuration.
Here is a simple example. With a `set-heap.sh` script like: Here is a simple example. With a `set-heap.sh` script like:
@ -169,16 +160,13 @@ SOLR_HEAP="1024m"
Starting Solr on port 8983 from /opt/solr/server Starting Solr on port 8983 from /opt/solr/server
``` ```
With this extension mechanism it can be useful to see the shell commands that are being executed by the `docker-entrypoint.sh` With this extension mechanism it can be useful to see the shell commands that are being executed by the `docker-entrypoint.sh` script in the docker log. To do that, set an environment variable using Docker's `-e VERBOSE=yes`.
script in the docker log. To do that, set an environment variable using Docker's `-e VERBOSE=yes`.
## Distributed Solr ## Distributed Solr
You can also run a distributed Solr configuration. You can also run a distributed Solr configuration.
The recommended and most flexible way to do that is to use Docker networking. The recommended and most flexible way to do that is to use Docker networking. See the [Can I run ZooKeeper and Solr clusters under Docker](https://github.com/docker-solr/docker-solr/blob/master/Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ, and [this example](docs/docker-networking.md).
See the [Can I run ZooKeeper and Solr clusters under Docker](https://github.com/docker-solr/docker-solr/blob/master/Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ,
and [this example](docs/docker-networking.md).
You can also use legacy links, see the [Can I run ZooKeeper and Solr with Docker Links](Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ. You can also use legacy links, see the [Can I run ZooKeeper and Solr with Docker Links](Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ.