惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

error on 打工人日志

k8s master 节点 Unauthorized kindle 邮件发送失败,错误代码E999 SELinux 问题:导致端口无法创建,无法访问 linux服务器进程打开文件过多导致服务异常 Linux 系统收包流程以及内核参数优化 Vue3 + vite + nginx项目部署后404问题 githubAction set-output弃用错误 k8s CNI 问题 连接认证失效 k8s.gcr.io国内无法连接解决方法 K8S 问题排查:cgroup 内存泄露问题 docker 问题处理 安装 docker 出现 ERROR: Unsupported distribution 'ol' 问题
解决Elasticsearch索引只读(read-only)
2023-09-20 · via error on 打工人日志

背景

这两天有开发向我反馈说elasticsearch有报错,嘿,我定睛一看,这不是进入只读状态了,看来是存储达到额度,我马上加个新的数据节点,平衡一下存储压力
报错信息:

1Elasticsearch Error {type:cluster_block_exception,reason:”blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];}

新建服务器,安装elasticsearch

为了和之前的服务器一样,我简单写一下我elasticsearch版本和服务器系统版本

软件版本
centos7.9
elasticsearch6.7.2
JDK1.8.61
内存32G

安装和配置elasticsearch

使用rpm 安装

1wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.2.rpm
1rpm --install elasticsearch-6.7.2.rpm

配置参数,进入/etc/elasticsearch目录
修改配置vim elasticsearch.yml

 1# ======================== Elasticsearch Configuration ========================= 
 2
 3cluster.name: cluster-prod-es # 集群名称
 4
 5node.name: node-x # 节点名称
 6
 7path.data: /var/lib/elasticsearch # 数据存储
 8
 9path.logs: /var/log/elasticsearch  # 日志存储
10
11network.host: 192.168.0.170 # 主机IP地址 
12
13http.port: 9200 # 端口号
14
15discovery.zen.ping.unicast.hosts: ["192.168.0.171", "192.168.0.172", "192.168.0.173"] # 集群节点
16
17discovery.zen.minimum_master_nodes: 2 #防止脑裂

修改配置vim jvm.options

启动elasticsearch 服务

1systemctl start elasticsearch.service

等待数据节点自动调节

这里要等待一会儿数据节点自动调节,这个调节时间取决于你数据的大小,一般来说几个小时也好了,如果数据重要性不太高的话,和领导沟通一下,就别傻坐着等他迁移完,正常下班就行了。

关闭索引只读

对了,千万不要忘记关闭只读状态,虽然你新增了节点,但是当前的只读状态并没有关闭,所以要执行一下命令关闭只读状态

1curl -XPUT -H "Content-Type: application/json" http://192.168.0.170:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

或者你在head-elasticsearch上操作
head-es

感谢你的阅读