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

推荐订阅源

PCI Perspectives
PCI Perspectives
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
罗磊的独立博客
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
Recent Announcements
Recent Announcements
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
The GitHub Blog
The GitHub Blog
M
MIT News - Artificial intelligence
Scott Helme
Scott Helme
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
V
Visual Studio Blog
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AI
AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Security Affairs
S
SegmentFault 最新的问题
C
Cisco Blogs
博客园 - 聂微东
MyScale Blog
MyScale Blog
V
Vulnerabilities – Threatpost
量子位
T
The Exploit Database - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Latest
Security Latest
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog

问题库系列 on 打工人日志

k8s master 节点 Unauthorized kindle 邮件发送失败,错误代码E999 SELinux 问题:导致端口无法创建,无法访问 linux服务器进程打开文件过多导致服务异常 Linux 系统收包流程以及内核参数优化 Vue3 + vite + nginx项目部署后404问题 使用scrapy-redis实现增量爬取 Chrome浏览器启动参数大全(命令行参数) Jenkins 编译Android apk 流水线 Nexus3 使用和部署 githubAction set-output弃用错误 k8s CNI 问题 连接认证失效 k8s.gcr.io国内无法连接解决方法 K8S 问题排查:cgroup 内存泄露问题 docker 问题处理 shell 脚本(1) Maven 安装编译 Nodejs 安装编译 ruoyi-cloud 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

感谢你的阅读