【发布时间】:2020-01-18 05:33:21
【问题描述】:
我在不同的服务器(即A和B)上构建了2个searchd实例,并在A上构建了一个分布式索引。但是,当我从客户端查询A时,我只能从A的索引中得到结果。我的问题是我无法从 B' 索引中得到结果,我很确定我配置正确。
我试过了: * 用 IP 地址替换主机名 * 我很确定我没有从 B 的索引中得到结果
A 的 sphinx.conf
index distributed_index
{
type = distributed
local = A_index
agent = 192.168.13.189:9312:B_index
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
客户端查询代码(python)
import sphinxapi
sphinx_host = 'A'
sphinx_port = 9312
SphinxClient = sphinxapi.SphinxClient()
SphinxClient.SetServer(sphinx_host,sphinx_port)
SphinxClient.SetMatchMode(sphinxapi.SPH_MATCH_EXTENDED)
res = SphinxClient.Query("")
当我indexer --all --rotate 时,收到警告:跳过非普通索引 'distributed_index'
当我从客户端查询时,我期望来自 A 和 B 的结果。
【问题讨论】:
-
您是否尝试过将 direct 连接到 B 并查看是否可以自行运行查询?检查 B 本身是否工作。如果问题出在 B 或 A 上,请缩小范围:)
-
是的,我做到了。当我直接连接 B 时,我可以从 B 的索引中得到结果。我真的很困惑......
标签: search full-text-search search-engine sphinx fulltext-index