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

相关推荐
想躺平的咸鱼干4 小时前
Elasticsearch 的自动补全以及RestAPI的使用
java·后端·elasticsearch·中间件·intellij-idea
小李飞刀李寻欢5 小时前
使用kubeadm部署Kubernetes(k8s)集群的步骤
linux·服务器·ubuntu·kubernetes·k8s
摇滚侠5 小时前
elasticSearch是什么,如何使用,有什么用
大数据·elasticsearch·搜索引擎
亲爱的非洲野猪21 小时前
基于ElasticSearch的法律法规检索系统架构实践
大数据·elasticsearch·系统架构
从零开始学习人工智能1 天前
Doris 与 Elasticsearch:谁更适合你的数据分析需求?
大数据·elasticsearch·数据分析
上海运维Q先生1 天前
Cilium动手实验室: 精通之旅---23.Advanced Gateway API Use Cases
云原生·k8s·cilium
代码搬运媛1 天前
ES Modules 与 CommonJS 的核心区别详解
大数据·elasticsearch·搜索引擎
数据智能老司机1 天前
Elastic 向量搜索实战指南——Elastic中的模型管理与向量相关考量
elasticsearch·搜索引擎·llm
不爱学英文的码字机器1 天前
[Git] 标签管理
大数据·git·elasticsearch
异常君1 天前
Elasticsearch 与机器学习结合:实现高效模型推理的方案(上)
java·elasticsearch·机器学习