gpt4 book ai didi

ruby - 连续上传时出现Elasticsearch Connect错误

转载 作者:行者123 更新时间:2023-12-02 23:41:44 24 4
gpt4 key购买 nike

我有一个脚本,可以从csv文件中逐行读取行,并以相同的顺序将相同的索引索引到elasticsearch中。我的elasticsearch主机与运行脚本的计算机相同。当我突然开始出现以下错误时,除了几行以外,其他所有东西都工作正常:

W, [2012-10-09T14:46:00.899876 #11567]  WARN -- : Cannot assign requested address connect(2)
D, [2012-10-09T14:46:00.900037 #11567] DEBUG -- : ["/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `initialize'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `open'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:44:in `timeout'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:89:in `timeout'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `connect'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:637:in `do_start'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:626:in `start'", "/home/azitabh/.rvm/gems/ruby-1.9.2-p320/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'", "/home/azitabh/.rvm/gems/ruby-1.9.2-p320/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'", "/home/azitabh/.rvm/gems/ruby-1.9.2-p320/gems/tire-0.4.2/lib/tire/http/client.rb:11:in `get'", "/home/azitabh/.rvm/gems/ruby-1.9.2-p320/gems/tire-0.4.2/lib/tire/search.rb:94:in `perform'", "/home/azitabh/.rvm/gems/ruby-1.9.2-p320/gems/tire-0.4.2/lib/tire/search.rb:20:in `results'", "models/test.rb:31:in `get_details'", "models/test.rb:56:in `block in index_test'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/csv.rb:1768:in `each'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/csv.rb:1202:in `block in foreach'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/csv.rb:1340:in `open'", "/home/azitabh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/csv.rb:1201:in `foreach'", "models/test.rb:40:in `index_test'", "models/test.rb:85:in `<main>'"]

并且错误与csv中这些行的值无关。我在不同时间的不同位置收到这些错误。

我还有一段时间遇到另一个错误“WAIT_TIMEOUT”。由于我这次没有收到该错误,因此无法在此处放置跟踪。

我正在用ruby编码,并使用“Tire” gem与elasticsearch交谈。我认为这些都不以任何方式负责。

出现此错误时,JAVA占用了系统内存的8%。这远低于分配的值ES_MIN_MEM = 2g。

提前致谢
-Azitabh

最佳答案

发生这种情况的原因是,tyre不会自行关闭tcp连接。一旦所有可用端口都启用,在系统关闭所有处于等待状态的连接之前,便无法进行进一步的连接。这会花费一些时间,任何尝试建立新连接的尝试都会导致wait_timeout。

关于ruby - 连续上传时出现Elasticsearch Connect错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12796953/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com