elasticsearch报错fully-formed single-node cluster with cluster UUID

1.问题描述

k8s集群内部署的es中间件起不来,查看日志发现如下警告,节点发现功能开启,但是目前我是单节点服务,所以尝试编辑sts将节点发现功能去掉或者在部署时将你的sts的yaml文件和chart文件修改重新部署以去掉该功能

bash 复制代码
{"@timestamp":"2024-11-25T15:25:39.730Z", "log.level": "WARN", "message":"This node is a fully-formed single-node cluster with cluster UUID [CHfiZM08TKimVoEvLnfBbw], 
but it is configured as if to discover other nodes and form a multi-node cluster via the [discovery.seed_hosts=[elasticsearch-headless]] setting. 
Fully-formed clusters do not attempt to discover other nodes, and nodes with different cluster UUIDs cannot belong to the same cluster. 
The cluster UUID persists across restarts and can only be changed by deleting the contents of the node's data path(s). Remove the discovery configuration to suppress this message.", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[elasticsearch-0][cluster_coordination]
[T#1]","log.logger":"org.elasticsearch.cluster.coordination.Coordinator","elasticsearch.cluster.uuid":"CHfiZM08TKimVoEvLnfBbw","elasticsearch.node.id":"1HTqcojWQxGciuVa71gb-g","elasticsearch.node.name":"elasticsearch-0","elasticsearch.cluster.name":"elasticsearch"}



kubectl edit sts elasticsearch
#去掉以下部分
name: discovery.seed_hosts
value: elasticsearch-headless

2.修改后报错服务和集群uuid绑定,无法加入新集群

此时需要清除数据目录让其重新运行

注意:生产环境需慎重

bash 复制代码
{"@timestamp":"2024-11-26T09:50:06.905Z", "log.level": "WARN", "message":"this node is locked into cluster UUID [xxx] 
but [cluster.initial_master_nodes] is set to [elasticsearch-0]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; 
for further information see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/important-settings.html#initial_master_nodes", "ecs.version": 
"1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main",
"log.logger":"org.elasticsearch.cluster.coordination.ClusterBootstrapService","elasticsearch.node.name":"elasticsearch-0","elasticsearch.cluster.name":"elasticsearch"}

3.若有重要数据需要备份数据目录

bash 复制代码
#删除前请按需备份数据
kubectl scale --replicas=0 sts elasticsearch
kubectl delete pvc elasticsearch-elasticsearch-0
kubectl scale --replicas=1 sts elasticsearch

4.等待pod重建后已正常

相关推荐
Elasticsearch4 小时前
使用 NVIDIA cuVS 在 Elasticsearch 中实现 GPU 加速的向量索引:在 10 分钟内处理 1.38 亿个向量
elasticsearch
Flynt4 小时前
"MySQL搜不动就上ES"?我先在50万行数据上测了它自带的ngram全文索引
mysql·elasticsearch·搜索引擎
柒和远方4 小时前
混合检索 RAG 全链路:查询增强、双路召回与重排——向量库和搜索引擎联手补齐召回
elasticsearch·langchain·llm
Elasticsearch4 小时前
用自然语言分析跟踪数据,询问 Elastic Agent Builder 为什么运行缓慢
elasticsearch
Elasticsearch4 小时前
Elastic 中的 Temporal Cloud 可观测性:50+ 个指标,无需采集器
elasticsearch
阿里云大数据AI技术4 小时前
云栖2026|从“找到答案”到“完成任务”:阿里云以 Agentic Search 重塑 AI 搜索
大数据·人工智能·elasticsearch
Elasticsearch4 小时前
遥测策略:在运行时更改 OpenTelemetry 采样率和日志级别,无需重启
elasticsearch
Elasticsearch4 小时前
Elastic 宣布 Serverless 上的跨项目搜索正式发布,让团队无需移动任何数据即可跨所有关联项目进行查询
elasticsearch
Elasticsearch4 小时前
并非每条日志都值得保留 90 天:Elastic Streams 中按数据流设置保留期限
elasticsearch
此冬歌咏6 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s