sphinx 遇到的错误和解决

来源:互联网 发布:剑网三新角色捏脸数据 编辑:程序博客网 时间:2024/05/16 01:28

在进行索引创建的时候,出现了错误
Error: sql_fetch_row: Lost connection to MySQL server during query

查到了这篇文章
http://www.molecularsciences.org/sphinx_search/error_sql_fetch_row_lost_connection_to_mysql_server_during_query

不知道第二种解决方式什么原理,试了也没有用, 不过第一种是成功了的, 我的sphinx.conf的原有mem_limit的值是2000m, 而我在虚拟机里跑的linux系统最大也就2G, 应该是索引创建的时候的内存不足导致的, 那我们就可以设置mem_limit的值小一点。

这个mem_limit的设置是索引内存使用限制, 如果设置过大就可能导致sql链接超时, 官方文档是这么写的:

Maximum possible limit is 2047M. Too low values can hurt indexing speed, but 256M to 1024M should be enough for most if not all datasets. Setting this value too high can cause SQL server timeouts. During the document collection phase, there will be periods when the memory buffer is partially sorted and no communication with the database is performed; and the database server can timeout. You can resolve that either by raising timeouts on SQL server side or by lowering mem_limit.

另外就是searchd服务启动的用户和indexer生成索引的用户要一致, 否则也会导致查询不出结果的问题。

最后就是如果出现searchd启动出错的话, 直接查searchd的log, 很有可能是一些需要的目录未创建或者是没有权限

0 0
原创粉丝点击