Sphinx Search running on Centos 7
Due to the way Sphinx operates, you need to follow these steps:
- Define your Sphinx Configuration - sphinx.conf
- Get Sphinx to build the Indexes
- Run the Server
- Rotate the Indexes periodically
version: "2"
services:
sphinx:
image: jc21/sphinxsearch
ports:
- 9306:9306
- 9312:9312
volumes:
- "./sphinx.conf:/etc/sphinx/sphinx.conf"
- "./data:/var/lib/sphinx"
With docker-compose:
docker-compose run --rm sphinx indexer --all
With docker vanilla:
docker run --rm -it \
-v /path/to/sphinx.conf:/etc/sphinx/sphinx.conf \
-v /path/to/data:/var/lib/sphinx \
jc21/sphinxsearch \
indexer --all
With docker-compose:
docker-compose up -d
With docker vanilla:
docker run --detach \
--name sphinxsearch \
-p 9306:9306 \
-p 9312:9312 \
-v /path/to/sphinx.conf:/etc/sphinx/sphinx.conf \
-v /path/to/data:/var/lib/sphinx \
jc21/sphinxsearch
The docker container must be running for rotating to work.
With docker-compose:
docker-compose exec sphinx indexer --all --rotate
With docker vanilla (assuming your container name is "sphinxsearch"):
docker exec -it sphinxsearch indexer --all --rotate