Windows下ES集群创建

本文档指导如何复制并配置Elasticsearch的三个节点(node1、node2、node3),分别设置不同端口,并通过修改配置文件实现集群连接。在完成配置后,启动各节点并检查集群状态,确认所有节点已成功加入集群,状态为'green',表明集群配置成功。
摘要由CSDN通过智能技术生成

1、复制3份ES文件:

2、分别对node1、node2、node3修改config/elasticsearch.yml

node1:

cluster.name: my-application
network.host: localhost
http.port: 9201
transport.tcp.port: 9301
node.name: node-1
node.master: true
node.data: true
http.cors.enabled: true
http.cors.allow-origin: "*"

node2:

cluster.name: my-application
network.host: localhost
http.port: 9202
transport.tcp.port: 9302
node.name: node-2
node.master: true
node.data: true
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.seed_hosts: ["localhost:9301"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5

node3:

cluster.name: my-application
network.host: localhost
http.port: 9203
transport.tcp.port: 9303
node.name: node-3
node.master: true
node.data: true
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.seed_hosts: ["localhost:9301","localhost:9302"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5

3、分别启动node1、node2、node3

启动bin/elasticsearch.bat

4、启动完成后,可以查看集群状态:

访问:http://localhost:9201/_cluster/health

{
    "cluster_name": "my-application",
    "status": "green",
    "timed_out": false,
    "number_of_nodes": 3,
    "number_of_data_nodes": 3,
    "active_primary_shards": 2,
    "active_shards": 4,
    "relocating_shards": 0,
    "initializing_shards": 0,
    "unassigned_shards": 0,
    "delayed_unassigned_shards": 0,
    "number_of_pending_tasks": 0,
    "number_of_in_flight_fetch": 0,
    "task_max_waiting_in_queue_millis": 0,
    "active_shards_percent_as_number": 100.0
}

    "status": "green",

    "number_of_data_nodes": 3,

表示集群配置成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值