sphinx 遇到的错误和解决

在进行索引创建的时候,出现了错误
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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值