You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Crafter CMS模板发布后Delivery内容未更新,Elasticsearch只读集群错误

问题解决:Crafter Delivery内容未更新且Elasticsearch只读报错

问题现象

  • 在Crafter Authoring Studio更新模板并发布后,Crafter Delivery端应用内容未同步更新
  • 已确认Crafter Authoring和Delivery虚拟机的repos路径下的.xml文件已完成更新
  • Crafter Delivery日志中抛出核心错误:

blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

解决方案

1. 手动解除Elasticsearch只读限制

即使磁盘空间充足,Elasticsearch可能因临时异常触发自动只读保护,执行以下命令解除:

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

2. 检查并调整Elasticsearch磁盘水位线配置

Elasticsearch默认配置磁盘使用率阈值,若阈值设置异常,可能误触发保护:

  • 查看当前磁盘水位线设置:
curl http://localhost:9202/_cluster/settings?include_defaults=true | grep -A5 -B5 disk
  • 若配置不合理,临时调整为通用安全阈值:
curl -XPUT -H "Content-Type: application/json" http://localhost:9202/_cluster/settings -d '{
  "persistent": {
    "cluster.routing.allocation.disk.watermark.low": "90%",
    "cluster.routing.allocation.disk.watermark.high": "95%",
    "cluster.routing.allocation.disk.watermark.flood_stage": "98%"
  }
}'

3. 重新触发Crafter Delivery索引同步

解除只读限制后,手动触发索引更新:

  • 登录Crafter Delivery管理界面,找到Rebuild Index选项执行
  • 或通过API触发(替换<delivery-host>、<port>和<site-id>为实际值):
curl -XPOST http://<delivery-host>:<port>/api/1/index/rebuild/<site-id>

4. 验证Elasticsearch数据目录的实际可用空间

系统磁盘使用率显示10%,需确认Elasticsearch数据目录所在分区的真实空间:

  • 先查询Elasticsearch数据目录路径:
curl http://localhost:9202/_nodes/settings?pretty | grep path.data
  • 查看该分区可用空间:
df -h <path-to-es-data-directory>

容器部署场景需额外检查容器的磁盘配额限制。

5. 排查Elasticsearch集群健康状态

确认集群无其他异常:

curl http://localhost:9202/_cluster/health?pretty

若集群状态非green,需进一步排查节点连接、分片分配等问题。


内容的提问来源于stack exchange,提问作者Carmen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 08:27:35