[2-02-02].第03节:环境搭建 - Win10搭建ES集群环境

ElasticSearch学习大纲


基于ElasticSearch7.8版本


一、ElasticStack下载:


二、集群搭建:

第1步:创建es目录:

  • 1.创建 elasticsearch-cluster 文件夹,在内部复制三个 elasticsearch 服务

第2步:更改配置:

修改集群文件目录中每个节点的 config/elasticsearch.yml 配置文件

  • node-1001 节点

    yml 复制代码
    #节点 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-1", "node-2","node-3"]
    #跨域配置
    #action.destructive_requires_name: true
    http.cors.enabled: true
    http.cors.allow-origin: "*"
  • node-1002 节点

    yml 复制代码
    #节点 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-1", "node-2","node-3"]
    #跨域配置
    #action.destructive_requires_name: true
    http.cors.enabled: true
    http.cors.allow-origin: "*"
  • 3.节点 3 的配置信息:

    yml 复制代码
    #集群名称,节点之间要保持一致
    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-1", "node-2","node-3"]
    #跨域配置
    #action.destructive_requires_name: true
    http.cors.enabled: true
    http.cors.allow-origin: "*"

第3步:启动节点:

  • 1.启动前先删除每个节点中的 data 目录中所有内容(如果存在)
  • 2.分别双击执行 bin/elasticsearch.bat, 启动节点服务器,启动后,会自动加入指定名称的集

相关推荐
云原生指北3 小时前
命令行四件套:fd-rg-fzf-bat
java·大数据·elasticsearch
umeelove356 小时前
Java进阶(ElasticSearch的安装与使用)
java·elasticsearch·jenkins
一只会跑会跳会发疯的猴子12 小时前
php操作elasticsearch,亲测可用
开发语言·elasticsearch·php
qq56801807613 小时前
Springboot中使用Elasticsearch(部署+使用+讲解 最完整)
spring boot·elasticsearch·jenkins
Eternity_GQM14 小时前
【Git入门】
大数据·git·elasticsearch
Elasticsearch14 小时前
从判断列表到训练好的 Learning to Rank( LTR )模型
elasticsearch
FlyChat14 小时前
自研搜索引擎实战:全栈PHP扛下核心,ES+Redis+Kafka+多语言爬虫构建高性能“智搜搜索”深度拆解
elasticsearch·搜索引擎·php
FlyChat15 小时前
从零到亿:拆解“智搜搜索”工业化引擎——PHP如何驯服ElasticSearch、Kafka与多语言爬虫巨兽
elasticsearch·kafka·php
尽兴-15 小时前
Elasticsearch 高可用集群架构:Master 选举、Shard 分配与容灾设计
大数据·elasticsearch·架构·集群·节点·可视化工具·分片
Elastic 中国社区官方博客15 小时前
从 Elasticsearch runtime fields 到 ES|QL:将传统工具适配到当前技术
大数据·数据库·sql·elasticsearch·搜索引擎·全文检索