我使用的是macbre/sphinxsearch/docker镜像。我为卷创建了dirs,并使用命令运行容器:
podman run --name sphinxsearch -p 36307:36307 -v ~/podman/volumes/sphinxsearch/:/opt/sphinx/index:z -v ./sphinx.conf:/opt/sphinx/conf/sphinx.conf:z --rm macbre/sphinxsearch
,我得到一个错误,因为索引不是由indexer
创建的:
WARNING: index 'test1': prealloc: failed to open /opt/sphinx/index/test1.sph: No such file or directory; NOT SERVING
FATAL: no valid indexes to serve
在这种情况下我应该如何运行索引器?
在运行searchd守护进程之前,首先需要构建索引。为此,通过容器运行第一个索引器作业:
podman run -v $VOLPATH/sphinxsearch/index/:/opt/sphinx/index:z
-v $VOLPATH/sphinxsearch/sphinx.conf:/opt/sphinx/conf/sphinx.conf:z
--rm macbre/sphinxsearch indexer --all --config /opt/sphinx/conf/sphinx.conf
稍后,当容器已经工作时,您可以使用:
刷新索引:podman exec -it sphinxsearch indexer --rotate --all --config /opt/sphinx/conf/sphinx.conf
我还在帖子中记录了整个过程:在Podman容器中运行SphinxSearch
感谢@Manticore-Search和@macbre为我们指明方向。