Skip to content

Commit

Permalink
XDOCKER-282: Update the process to use an external Solr instance
Browse files Browse the repository at this point in the history
- update the README documentation

Signed-off-by: GridexX <arsene582@gmail.com>
  • Loading branch information
GridexX committed Jul 21, 2023
1 parent 4f80a87 commit 256c2f5
Showing 1 changed file with 32 additions and 37 deletions.
69 changes: 32 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,40 @@ As an application wiki, XWiki allows for the storing of structured data and the

<!-- generated with pandoc -f gfm --toc -o readme-toc.md README.md -->

- [What is XWiki](#what-is-xwiki)
- [Table of contents](#table-of-contents)
- [Introduction](#introduction)
- [How to use this image](#how-to-use-this-image)
- [Pulling existing image](#pulling-an-existing-image)
- [Using docker run](#using-docker-run)
- [Using docker-compose](#using-docker-compose)
- [Using Docker Swarm](#using-docker-swarm)
- [Using an external Solr service](#using-an-external-solr-service)
- [Preparing Solr container](#preparing-solr-container)
- [Docker run example](#docker-run-example)
- [Docker Compose example](#docker-compose-example)
- [Configuring Tomcat](#configuring-tomcat)
- [Building](#building)
- [Pulling an existing image](#pulling-an-existing-image)
- [Using docker run](#using-docker-run)
- [Starting MySQL](#starting-mysql)
- [Starting MariaDB](#starting-mariadb)
- [Starting PostgreSQL](#starting-postgresql)
- [Starting XWiki](#starting-xwiki)
- [Using docker-compose](#using-docker-compose)
- [For MySQL on Tomcat](#for-mysql-on-tomcat)
- [For MariaDB on Tomcat](#for-mariadb-on-tomcat)
- [For PostgreSQL on Tomcat](#for-postgresql-on-tomcat)
- [Using Docker Swarm](#using-docker-swarm)
- [MySQL Example](#mysql-example)
- [PostgreSQL Example](#postgresql-example)
- [Using an external Solr service](#using-an-external-solr-service)
- [Docker run example](#docker-run-example)
- [Docker Compose example](#docker-compose-example)
- [Configuring Tomcat](#configuring-tomcat)
- [Building](#building)
- [Upgrading XWiki](#upgrading-xwiki)
- [Troubleshooting](#troubleshooting)
- [Details for the xwiki image](#details-for-the-xwiki-image)
- [Configuration Options](#configuration-options)
- [Passing JVM options](#passing-jvm-options)
- [Configuration Files](#configuration-files)
- [Miscellaneous](#miscellaneous)
- [Configuration Options](#configuration-options)
- [Passing JVM options](#passing-jvm-options)
- [Configuration Files](#configuration-files)
- [Miscellaneous](#miscellaneous)
- [Troubleshooting](#troubleshooting)
- [Problem with eclipse-temurin base image](#problem-with-eclipse-temurin-base-image)
- [For Maintainers](#for-maintainers)
- [Update Docker Images](#update-docker-images)
- [Testing Docker Images](#testing-docker-images)
- [Clean Up](#clean-up)
- [Update Docker Images](#update-docker-images)
- [Testing Docker Images](#testing-docker-images)
- [Clean Up](#clean-up)
- [License](#license)
- [Support](#support)
- [Contribute](#contribute)
Expand Down Expand Up @@ -485,30 +496,17 @@ solr.type=remote
solr.remote.baseURL=http://$INDEX_HOST:$INDEX_PORT/solr
```

#### Preparing Solr container

The simplest way to create an external Solr service is using the [official Solr image](https://hub.docker.com/_/solr/).

- Select the appropriate XWiki Solr configuration JAR from [here](https://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-search-solr-server-data/) (Note: it's usually better to synchronize it with your version of XWiki)
- Place this JAR in a directory along side `solr-init.sh` that you can fetch from the [docker-xwiki repository](https://github.com/xwiki-contrib/docker-xwiki/tree/master/contrib/solr)
- Ensure that this directory is owned by the Solr user and group `chown -R 8983:8983 /path/to/solr/init/directory`
- Launch the Solr container and mount this directory at `/docker-entrypoint-initdb.d`
- This will execute `solr-init.sh` on container startup and prepare the XWiki core with the contents from the given JAR
- If you want to persist the Solr index outside of the container with a bind mount, make sure that that directory is owned by the Solr user and group `chown 8983:8983 /my/path/solr`

#### Docker run example

Start your chosen database container normally using the docker run command above, this example happens to assume MySQL was chosen.

The command below will configure the Solr container to initialize based on the contents of `/path/to/solr/init/directory/` and save its data on the host in a `/my/path/solr` directory:
The command below shows how to start the Solr container:

```console
docker run \
--net=xwiki-nw \
--name solr-xwiki \
-v /path/to/solr/init/directory:/docker-entrypoint-initdb.d \
-v /my/path/solr:/opt/solr/server/solr/xwiki \
-d solr:8
-d xwiki:solr
```

Then start the XWiki container, the below command is nearly identical to that specified in the Starting XWiki section above, except that it includes the `-e INDEX_HOST=` environment variable which specifies the hostname of the Solr container.
Expand Down Expand Up @@ -570,11 +568,8 @@ services:
networks:
- bridge
index:
image: "solr:8"
image: "xwiki/solr:latest"
container_name: xwiki-index
volumes:
- ./solr:/docker-entrypoint-initdb.d
- solr-data:/opt/solr/server/solr
networks:
- bridge
volumes:
Expand Down

0 comments on commit 256c2f5

Please # to comment.