elasticsearch-py 解決 too_long_frame_exception 問題


elasticsearch-py 解決 too_long_frame_exception 問題

老大讓我搞一搞數據統計,配環境時遇到個奇葩錯誤,記錄一下,希望能幫助到某些人。

我需要安裝 ElasticSearch-Py 庫,根據官網文檔,不同的服務器版本配不同的Python庫版本。公司的ElasticSearch服務版本號是 0.6.0,本着用新不用舊的原則,就安裝了6.x的最新版本0.6.4的python模塊。

# Elasticsearch 6.x
elasticsearch>=6.0.0,<7.0.0
# Elasticsearch 5.x
elasticsearch>=5.0.0,<6.0.0
# Elasticsearch 2.x
elasticsearch>=2.0.0,<3.0.0

我在使用 scan 命令時出現了如下錯誤:

elasticsearch.exceptions.RequestError: RequestError(400, 'too_long_frame_exception', 'An HTTP line is larger than 4096 bytes.')

Google搜了一圈,都是說需要調整elasticsearch服務器配置,即在/etc/elasticsearch/elasticsearch.yml修改配置然后重啟服務:

http.max_content_length: 500mb

可是我沒有操作這個服務器的權限,線上服務器也不能說讓我重啟瞎搞。
我試着把 elasticsearch-py 版本從 6.4.0 降級到 6.3.1 問題就解決了。

pip uninstall elasticsearch
pip install elasticsearch==6.3.1

蜜汁Bug,浪費我好幾個小時。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM