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重建后已正常

相关推荐
Elastic 中国社区官方博客6 小时前
使用真实 Elasticsearch 进行高级集成测试
大数据·数据库·elasticsearch·搜索引擎·全文检索·jenkins·集成测试
画船听雨眠aa13 小时前
gitlab云服务器配置
服务器·git·elasticsearch·gitlab
risc12345617 小时前
【Elasticsearch 】悬挂索引(Dangling Indices)
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客19 小时前
使用 Ollama 和 Kibana 在本地为 RAG 测试 DeepSeek R1
大数据·数据库·人工智能·elasticsearch·ai·云原生·全文检索
zfj32119 小时前
学技术学英语:elasticsearch硬件相关的配置&优化技巧
网络·elasticsearch·全文检索·内存·cpu·磁盘
字节全栈_vBr1 天前
面试之Solr&Elasticsearch
elasticsearch·面试·solr
risc1234561 天前
【Elasticsearch】中数据流需要配置索引模板吗?
大数据·elasticsearch·jenkins
JackieZhengChina1 天前
新一代搜索引擎,是 ES 的15倍?
大数据·elasticsearch·搜索引擎
是小崔啊2 天前
Spring Boot - 数据库集成06 - 集成ElasticSearch
数据库·spring boot·elasticsearch
Elastic 中国社区官方博客2 天前
Elastic Cloud Serverless 获得主要合规认证
大数据·数据库·elasticsearch·搜索引擎·云原生·serverless·全文检索