【问题标题】:ThinkingSphinx::SphinxError Lost connection to MySQL server at 'reading initial communication packet'ThinkingSphinx::SphinxError Lost connection to MySQL server at 'reading initial communication packet'
【发布时间】:2018-06-18 17:52:48
【问题描述】:

我几天都遇到了这个问题,而且每周都会发生,我无法理解这个问题。

Sphinx 在生产服务器上自动断开连接。

ThinkingSphinx::SphinxError 在“读取初始通信数据包”时丢失与 MySQL 服务器的连接

我正在使用

  • 思考狮身人面像 (3.1.4)
  • Rails 4.2.1
  • 红宝石 2.0.0

我的配置文件thinking_sphinx是-

   development:
     min_infix_len: 1
     bin_path: '/usr/bin'
     searchd_binary_name: 'searchd'
     indexer_binary_name: 'indexer'
     utf8: true
     max_matches: 10000
   staging:
     min_infix_len: 1
     bin_path: ''
     searchd_binary_name: ''
     indexer_binary_name: ''
     max_matches: 10000
   production:
     min_infix_len: 1
     bin_path: ''
     searchd_binary_name: ''
     indexer_binary_name: ''
     max_matches: 10000

【问题讨论】:

    标签: mysql ruby-on-rails ruby thinking-sphinx


    【解决方案1】:

    我遇到了此类问题,并在 database.yml 中使用 'reconnect: true' 解决了这个问题,不确定这是否能解决这个问题,但是一旦你设置了这个选项,它就不是横断安全的,所以如果工作,请做一些研究这个。

     in database.yml
    
     reconnect: true
    

    【讨论】:

      猜你喜欢
      • 2019-08-31
      • 2019-11-14
      • 2018-07-21
      • 2011-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-05
      • 2016-06-19
      相关资源
      最近更新 更多