admin管理员组文章数量:1130349
ElasticSearch Windows集群安
- 一、集群部署
- 二、集群验证
- 三、集群状态说明
- 四、创建索引(测试)
一、集群部署
- 前提是:下载Windows版本的es,当前版本7.8.0
- 创建 elasticsearch-cluster 文件夹,在内部复制三个 elasticsearch 服务
- 修改集群文件目录中每个节点的
config/elasticsearch.yml配置文件- node-1001 节点 配置如下:
#节点 1 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1001 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1001 #tcp 监听端口 transport.tcp.port: 9301 #discovery.seed_hosts: ["localhost:9301", "localhost:9302","localhost:9303"] #discovery.zen.fd.ping_timeout: 1m #discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001", "node-1002","node-1003"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*" - node-1002 节点 配置如下:
#节点 2 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1002 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1002 #tcp 监听端口 transport.tcp.port: 9302 discovery.seed_hosts: ["localhost:9301"] discovery.zen.fd.ping_timeout: 1m discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*" - node-1003 节点 配置如下:
#节点 3 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1003 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1003 #tcp 监听端口 transport.tcp.port: 9303 discovery.seed_hosts: ["localhost:9301", "localhost:9302"] discovery.zen.fd.ping_timeout: 1m discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001", "node-1002","node-1003"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*"
- node-1001 节点 配置如下:
- 启动集群,先启动node-1001,再启动node-1002,最后是node-1003
- 进入到es解压之后的bin目录下
- 双击[【elasticsearch.bat】即可
- 启动成功之后,如下图所示:
二、集群验证
- 验证工具:【Postman】
- 查看集群状态,分别查看三个节点的状态:
-
node-1001状态
-
node-1002状态
-
node-1003状态
-
三、集群状态说明
- 【green】状态:所有主副分片都正常
- 【yellow】状态:所有主分片正常,但不是所有副分片都正常
- 【red】状态:所有主分片都不正常
四、创建索引(测试)
-
查询集群中索引列表
-
向集群中的 node-1001 节点增加索引
-
向集群中的 node-1002或者node1003 节点查询索引
问题:能否向node-1002或者node-1003中再次创建student索引呢?- 答案:不能。原因是PUT操作具有幂等性
ElasticSearch Windows集群安
- 一、集群部署
- 二、集群验证
- 三、集群状态说明
- 四、创建索引(测试)
一、集群部署
- 前提是:下载Windows版本的es,当前版本7.8.0
- 创建 elasticsearch-cluster 文件夹,在内部复制三个 elasticsearch 服务
- 修改集群文件目录中每个节点的
config/elasticsearch.yml配置文件- node-1001 节点 配置如下:
#节点 1 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1001 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1001 #tcp 监听端口 transport.tcp.port: 9301 #discovery.seed_hosts: ["localhost:9301", "localhost:9302","localhost:9303"] #discovery.zen.fd.ping_timeout: 1m #discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001", "node-1002","node-1003"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*" - node-1002 节点 配置如下:
#节点 2 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1002 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1002 #tcp 监听端口 transport.tcp.port: 9302 discovery.seed_hosts: ["localhost:9301"] discovery.zen.fd.ping_timeout: 1m discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*" - node-1003 节点 配置如下:
#节点 3 的配置信息: #集群名称,节点之间要保持一致 cluster.name: my-elasticsearch #节点名称,集群内要唯一 node.name: node-1003 node.master: true node.data: true #ip 地址 network.host: localhost #http 端口 http.port: 1003 #tcp 监听端口 transport.tcp.port: 9303 discovery.seed_hosts: ["localhost:9301", "localhost:9302"] discovery.zen.fd.ping_timeout: 1m discovery.zen.fd.ping_retries: 5 #集群内的可以被选为主节点的节点列表 #cluster.initial_master_nodes: ["node-1001", "node-1002","node-1003"] #跨域配置 #action.destructive_requires_name: true http.cors.enabled: true http.cors.allow-origin: "*"
- node-1001 节点 配置如下:
- 启动集群,先启动node-1001,再启动node-1002,最后是node-1003
- 进入到es解压之后的bin目录下
- 双击[【elasticsearch.bat】即可
- 启动成功之后,如下图所示:
二、集群验证
- 验证工具:【Postman】
- 查看集群状态,分别查看三个节点的状态:
-
node-1001状态
-
node-1002状态
-
node-1003状态
-
三、集群状态说明
- 【green】状态:所有主副分片都正常
- 【yellow】状态:所有主分片正常,但不是所有副分片都正常
- 【red】状态:所有主分片都不正常
四、创建索引(测试)
-
查询集群中索引列表
-
向集群中的 node-1001 节点增加索引
-
向集群中的 node-1002或者node1003 节点查询索引
问题:能否向node-1002或者node-1003中再次创建student索引呢?- 答案:不能。原因是PUT操作具有幂等性
本文标签: 集群elasticsearchWindows
版权声明:本文标题:ElasticSearch Windows集群安装部署 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1754824616a2730928.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论