ElasticSearch 创建索引超时(ReadTimeoutError)

server/2024/9/22 15:41:23/

报错现象

在 Python 中调用 client.indices.create 来创建 ElasticSearch 索引时,报如下错误:

python">elastic_transport.transport - INFO - PUT http://127.0.0.1:9200/document_page?timeout=60s [status:N/A duration:10.011s]
elastic_transport.node_pool - WARNING - Node <Urllib3HttpNode(http://127.0.0.1:9200)> has failed for 1 times in a row, putting on 1 second timeout
elastic_transport.transport - WARNING - Retrying request after failure (attempt 0 of 3)
Traceback (most recent call last):File "C:\Users\15797\.conda\envs\ppkg\lib\site-packages\elastic_transport\_transport.py", line 329, in perform_requestmeta, raw_data = node.perform_request(File "C:\Users\15797\.conda\envs\ppkg\lib\site-packages\elastic_transport\_node\_http_urllib3.py", line 199, in perform_requestraise err from None
elastic_transport.ConnectionTimeout: Connection timeout caused by: ReadTimeoutError(HTTPConnectionPool(host='127.0.0.1', port=9200): Read timed out. (read timeout=10.0))

问题分析

在查阅网络资料时,一开始以为是字面意思上的连接超时问题,但调大 timeout 参数也一样报错,而且之前用相同方法创建类似索引时并未出现该问题。

最后,受博文(https://blog.csdn.net/ckq707718837/article/details/136215814)的启发,查看 ElasticSearch 的日志(如下所示),才发现问题所在:电脑磁盘快满了,ES 自动把索引的状态由黄转红,变成只读状态,无法写入

elasticsearch.log(节选内容)

python">current.health="RED" message="Cluster health status changed from [YELLOW] to [RED] (reason: [reconcile-desired-balance])." previous.health="YELLOW" reason="reconcile-desired-balance"flood stage disk watermark [95%] exceeded on [D:\Softwares\elasticsearch-8.6.0\data] free: 5.8gb[2.1%], all indices on this node will be marked read-only

问题解决(两种方法)

  • (推荐)清理磁盘,释放更多空余空间,再重启 ElasticSearch;
  • 调整 ElasticSearch 配置,可参考博文(https://blog.csdn.net/liaomingwu/article/details/115425880)

http://www.ppmy.cn/server/8054.html

相关文章

C#随机数

随机数&项目调试 随机数 文章目录 随机数1、创建随机数对象2、生成随机数思考 打怪兽 项目调试 1、创建随机数对象 Random r 随机数变量名 new Random();2、生成随机数 Randowm r new Random(); int i r.Next(); //生成一个非负数的随机数 Console.WriteLine(i); i …

回溯算法练习day.4

93.复原ip地址 链接&#xff1a;. - 力扣&#xff08;LeetCode&#xff09; 题目描述&#xff1a; 有效 IP 地址 正好由四个整数&#xff08;每个整数位于 0 到 255 之间组成&#xff0c;且不能含有前导 0&#xff09;&#xff0c;整数之间用 . 分隔。 例如&#xff1a;"…

[2024更新]如何从Android恢复已删除的相机照片?

相信大家都经历过Android手机误删相机图片的经历。您是否正在寻找一种可行的方法来挽救这些丢失的照片&#xff1f;如果这是你迫切想解决的问题&#xff0c;那么这篇文章绝对可以帮助你。然而&#xff0c;与其考虑如何从Android恢复已删除的相机照片&#xff0c;我们更愿意建议…

图论——基础概念

文章目录 学习引言什么是图图的一些定义和概念图的存储方式二维数组邻接矩阵存储优缺点 数组模拟邻接表存储优缺点 边集数组优缺点排序前向星优缺点链式前向星优缺点 学习引言 图论&#xff0c;是 C 里面很重要的一种算法&#xff0c;今天&#xff0c;就让我们一起来了解一下图…

12.Ribbon饥饿加载

Ribbon默认是懒加载的&#xff0c;第一次使用Ribbon访问的时候才会去实例化对象&#xff0c;所以第一次访问比较耗时。 ribbon:eager-load:enabled: true # 开启饥饿加载clients: user-service #对user-service这个服务饥饿加载 多个微服务的写法&#xff1a; ribbon:eager-loa…

Vscode | Python | launch.json配置gevent多进程断点失效问题处理

Vscode | Python | launch.json配置gevent多进程断点失效问题处理 文章目录 情况描述↓↓↓解决办法直接看这里↓↓↓ 情况描述 launch.json {// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more i…

【Linux驱动层】iTOP-RK3568学习之路(二):vscode中设置头文件路径-完成代码自动补全

在Ubuntu下用vscode写Linux驱动层的时候&#xff0c;需要添加头文件&#xff1a; #include<linux/module.h> #include<linux/init.h> #include<linux/kernel.h>但vscode没有智能提示&#xff0c;因此需要我们手动添加自己的头文件路径&#xff1a; topeetu…

arm编译、u-boot编译过程、linux内核编译

arm编译 我们之前在linux编译时使用gcc就行,但是在arm中我们需使用arm-linux-gcc 我们需安装交叉编译工具,地址就在119行 若没有,可自行在网上下载 u-boot编译过程 u-boot作为开源项目,可在其官网下载源码,官网 但在实际开发过程中,我们不会直接去u-boot官网下载源码…