杂项
2025/5/21小于 1 分钟elasticsearch数据库
杂项
集群配置
# Set the bind address to a specific IP (IPv4 or IPv6):
# 绑定本机的IP地址和暴露给集群的地址
#
network.host: 192.168.152.128
#
# Set a custom port for HTTP:
#
http.port: 9200
transport.tcp.port: 9300
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: [ "192.168.152.129:9300","192.168.152.130:9300" ]
REST API
# 查看集群信息
curl http://127.0.0.1:9200/_cat/health?v
# 查看集群的索引数。
curl http://127.0.0.1:9200/_cat/indices?v
# 查看集群所在磁盘的分配状况
curl http://127.0.0.1:9200/_cat/allocation?v
# 查看集群的节点
curl http://127.0.0.1:9200/_cat/nodes?v
# 查看集群的其它信息。
curl http://127.0.0.1:9200/_cat/
解决问题记录 报错FORBIDDEN/12/index read-only / allow delete (api)
curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'