2015-12-24 71 views
0

我已經在debian 8 64位實例上設置了couchdb。Couchdb查看查詢崩潰/超時

當我查詢其中一個視圖時,它從curl的角度超時。

以下是我所看到的形式couch.log:

[Thu, 24 Dec 2015 07:17:23 GMT] [info] [<0.173.0>] Starting index update for db: notes idx: _design/notes 
[Thu, 24 Dec 2015 07:17:23 GMT] [error] [<0.180.0>] ** Generic server <0.180.0> terminating 
** Last message in was {prompt,[<<"reset">>, 
           {[{<<"reduce_limit">>,true}, 
            {<<"timeout">>,5000}]}]} 
** When Server state == {os_proc,"/usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js", 
           #Port<0.2840>, 
           #Fun<couch_os_process.2.3888802>, 
           #Fun<couch_os_process.3.3888802>,5000} 
** Reason for termination == 
** {badarg,[{erlang,port_command, 
        [#Port<0.2840>, 
        [<<"[\"reset\",{\"reduce_limit\":true,\"timeout\":5000}]">>, 
         10]], 
        []}, 
      {couch_os_process,writejson,2, 
           [{file,"couch_os_process.erl"},{line,93}]}, 
      {couch_os_process,handle_call,3, 
           [{file,"couch_os_process.erl"},{line,183}]}, 
      {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,580}]}, 
      {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]} 

[Thu, 24 Dec 2015 07:17:23 GMT] [error] [<0.180.0>] {error_report,<0.31.0>, 
        {<0.180.0>,crash_report, 
         [[{initial_call,{couch_os_process,init,['Argument__1']}}, 
         {pid,<0.180.0>}, 
         {registered_name,[]}, 
         {error_info, 
         {exit, 
          {badarg, 
          [{erlang,port_command, 
          [#Port<0.2840>, 
           [<<"[\"reset\",{\"reduce_limit\":true,\"timeout\":5000}]">>, 
           10]], 
          []}, 
          {couch_os_process,writejson,2, 
          [{file,"couch_os_process.erl"},{line,93}]}, 
          {couch_os_process,handle_call,3, 
          [{file,"couch_os_process.erl"},{line,183}]}, 
          {gen_server,handle_msg,5, 
          [{file,"gen_server.erl"},{line,580}]}, 
          {proc_lib,init_p_do_apply,3, 
          [{file,"proc_lib.erl"},{line,237}]}]}, 
          [{gen_server,terminate,6, 
          [{file,"gen_server.erl"},{line,737}]}, 
          {proc_lib,init_p_do_apply,3, 
          [{file,"proc_lib.erl"},{line,237}]}]}}, 
         {ancestors, 
         [couch_query_servers,couch_secondary_services, 
          couch_server_sup,<0.32.0>]}, 
         {messages,[{#Port<0.2840>,{exit_status,127}}]}, 
         {links,[<0.95.0>]}, 

可能有些沙發專家幫助我如何解決這一問題?

回答

1

請注意,如果reduce函數的結果比初始值列表長,則會引發Query Server錯誤。但是,這種行爲可以通過reduce_limit配置選項設置爲false

http://docs.couchdb.org/en/latest/couchapp/ddocs.html

搜索頁面的reduce_limit出現被禁用。

+1

爲了擴大這個答案有點:錯誤說的是,你有一個減少功能,實際上並沒有使數據變小。是的,您可以禁用安全檢查,但最終可能會導致索引效率低下。我會建議OP詢問一個新問題,瞭解*爲什麼reduce函數會導致此錯誤,以及如何爲所需的查詢類型設計更高效的索引。 – natevw