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

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

问题库 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 问题库 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

感谢你的阅读