I got this issue when I use Docker, but don’t mount a /var/lib/manticore
dir to the host. Then the search daemon after starting tries to read the index defined in the configuration file, but it does not yet exist. I got this record in the log: [Thu Feb 11 13:32:22.511 2021] [19] WARNING: index 'messages_index': prealloc: failed to open /var/lib/manticore/messages_index.sph: No such file or directory - NOT SERVING
.
If I mount the /var/lib/manticore
dir to the host, the search daemon will read the index after the SECOND launch and search queries will work.
This is my config file. Variables are replaced in the Dockerfile.
source ${SPHINX_INDEX_NAME}_source {
type = ${DATABASE_TYPE_SPHINX}
sql_host = ${MYSQL_HOST_SPHINX}
sql_port = ${MYSQL_INTERNAL_PORT}
sql_db = ${MYSQL_DATABASE_SPHINX}
sql_user = ${MYSQL_USERNAME_SPHINX}
sql_pass = ${MYSQL_PASSWORD_SPHINX}
sql_query_pre = SET NAMES utf8mb4
sql_query_pre = SET CHARACTER_SET_RESULTS=utf8mb4
sql_query = SELECT * FROM messages
sql_field_string = message
sql_attr_bigint = id
sql_attr_string = source
sql_attr_string = origin
sql_attr_timestamp = posted_at
}
index ${SPHINX_INDEX_NAME} {
type = plain
source = ${SPHINX_INDEX_NAME}_source
path = /var/lib/manticore/${SPHINX_INDEX_NAME}
}
searchd {
listen = ${SPHINX_INTERNAL_PORT}:mysql41
log = /var/log/manticore/searchd.log
query_log = /var/log/manticore/query.log
query_log_mode = 666
binlog_path = # disable logging
pid_file = /var/run/manticore/searchd.pid
}