0

我们正在使用 Amazon EC2 实例构建 SphinxSearch 集群。我们使用相同的共享文件系统(弹性文件系统)对几个实例进行了示例测试。我们的想法是,在一个集群中我们可能有超过 10 个节点,但是我们可以使用单个实例来索引文档并将其保存在 Elastic File System 中,并且可以由多个节点共享以供读取。

我们的测试运行良好,但从技术上讲,这种方法有什么问题吗?(如锁定问题等)

有人可以就此提出建议吗

提前致谢

4

1 回答 1

3

If you're ok with having N copies of the index you can do as follows:

  • build an index in one place in a temp folder
  • rename the files so they include .new.
  • distribute the index to all the other places using rsync or whatever you like. Some even do broadcasting with UFTP
  • rotate the indexes at once in all the places by sending HUP to the searchds or better by doing RELOAD INDEX (http://docs.manticoresearch.com/latest/html/sphinxql_reference/reload_index_syntax.html), it normally takes only few ms so we can say that your new index replaces the previous one simultaneously on all the nodes
  • previously (and perhaps still in Sphinx) there was an issue with rotating the index (either by --rotate or RELOAD) in case it was processing a long query (the rotate just had to wait). It was fixed in Manticoresearch recently.

This is tried'n'true solution people use in production for years, but if you really want to share the same files among multiple searchd instances you can softlink all the files except .spl, but then to rotate the index in the searchd instances using the links (not the actual files) you'll need to restart the searchd instances which doesn't look good in general, but in some special cases may be still a good solution.

于 2018-01-20T16:18:10.390 回答