接上一篇,es部署很简单,很快就弄好了。

但是还是有很多不玩美。

比如说:主机是本地的IP或机器名,端口是固定的9200. 而且是只有一个节点,我要在一台机器上部署多个节点呢。

经过一段时间的摸索,做起来也很简单,但过程切实很痛苦。

具体做法是:你想部署多少个节点,你就重复多少次上一步的做法。启动就可以啦。

但是仅仅这样,所有的配置都是默认的,看起来很不舒服,这时你就要更改一个配置文件:..\elasticsearch-7.2.0\config\elasticsearch.yml

1.  我部署了三个节点, 具体如下:

Node-1:

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: owen
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: E:/Services/ELK/data/node-1
#
# Path to log files:
#
#path.logs: E:/Services/ELK/logs/node-1
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
transport.tcp.port: 9300
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9301", "127.0.0.1:9302"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["127.0.0.1:9300"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"

Node-2:

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: owen
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-2
node.master: false
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: E:/Services/ELK/data/node-2
#
# Path to log files:
#
#path.logs: E:/Services/ELK/logs/node-2
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9201
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9301", "127.0.0.1:9302"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["127.0.0.1:9300"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"

Node-3:

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: owen
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-3
node.master: false
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: E:\Services\ELK\data\node-3
#
# Path to log files:
#
#path.logs: E:\Services\ELK\logs\node-3
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9202
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9301", "127.0.0.1:9302"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["127.0.0.1:9300"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"

具体代表什么意思请参考:

https://www.cnblogs.com/shaosks/p/7490751.html

分享windows 10 下部署 elasticsearch 和 logstash (二)的更多相关文章

  1. 分享windows 10 下部署 elasticsearch 和 logstash

    最近和es杠上了.以前只听说过es一直没有机会体验一下. 最近有点时间,就着手体验一把.因为是第一次接触es,没有任何基础.入门的第一件是就是用 百度了, [不过建议改名为白度,基本上查不到想要的,一 ...

  2. windows 10 下部署WCF 一些细节

    总体上在IIS中部署一个WCF服务和Win7没有什么区别 但是,如果你使用的是.NET 4.5开发的 WCF服务,而windows10 又安装了.net 4.7 那么你需要注意下面问题

  3. 使用PHPstudy在Windows服务器下部署PHP系统

    PHP网站一般运行在Apache服务器上,IIS服务器上也可以运行,但是不推荐,windows服务器上没有集成Apache跟PHP的运行环境,但是借助第三方的软件就能很好的搞定,一般这样的软件有很多, ...

  4. 基于TDengine-ver-1.6.4.4在windows 10下cmake+msys2编译(windows cgo 使用)

    目录 基于TDengine-ver-1.6.4.4在windows 10下cmake+msys2编译(windows cgo 使用) 背景 下载地址 仓库地址 安装部署 msys2 安装 配置环境变量 ...

  5. (搬运)使用PHPstudy在Windows服务器下部署PHP系统

    原帖地址:http://www.php.cn/php-weizijiaocheng-406175.html 这篇文章主要介绍了关于使用PHPstudy在Windows服务器下部署PHP系统,有着一定的 ...

  6. 解决Windows 10下Wireshark运行问题

    解决Windows 10下Wireshark运行问题在Windows 10下,安装Wireshark时候,提示WinPcap不被系统系统支持.这是由于最新版的WinPcap 4.1.3只支持到Wind ...

  7. 在Windows环境下部署Axis2/C服务

    Apache Axis2/C是C语言实现的网络服务引擎,基于Axis2架构,支持SOAP1.1和SOAP1.2协议,并且支持RESTful风格的Web service. 下面是本人在Windows 7 ...

  8. Windows 10下Markdown不能显示预览

    Windows 10下Markdown不能显示预览 结局办法 下载awesomium的SDK,安装后重启Markdown即可 实测最新版本的SDK不行,建议安装1.6.6 下载地址:http://ww ...

  9. 在windows 10下使用docker

    准备工作 Windows 10下的Docker是依赖于Hyper-v的,首先我们需要启用它:控制面板 -> 程序 -> 启用或关闭Windows功能 -> 选中Hyper-V 安装D ...

随机推荐

  1. python基础(3):变量、常量、注释、基本数据类型

    1. 变量 变量:将运算的中间结果暂存到内存,以便后续程序调⽤. 可以直接运算,如下所示: print(3+5+6) print((3+5+6)*12) print(((3+5+6)*12)+3) p ...

  2. 内置模块:time, datetime, random, json, pickle, os, sys, hashlib, collections, re

    1.time模块 import time time.time() # 时间戳 浮点数 time.sleep() # 睡眠 time.gmtime()/time.localtime() #结构化时间 数 ...

  3. nfs共享文件系统

    NFS服务简介 NFS 就是 Network FileSystem 的缩写,最早之前是由sun 这家公司所发展出来的. 它最大的功能就是可以透过网络,让不同的机器.不同的操作系统.可以彼此分享个别的档 ...

  4. 手写面试编程题- 数组去重 深拷贝 获取文本节点 设置奇数偶数背景色 JS中检测变量为string类型的方法 第6题闭包 将两个数组合并为一个数组 怎样添加、移除、移动、复制、创建和查找节点? 继承 对一个数组实现随机排序 让元素水平 垂直居中的三种方式 通过jQuery的extend方法实现深拷贝

    第1题==>实现数组去重 通过 new Set(数组名) // var arr = [12, 12, 3, 4, 5, 4, 5, 6, 6]; // var newarr1 = new Set ...

  5. 【CF981F】Round Marriage(二分答案,hall定理)

    传送门 题意: 给出一个长度为\(L\)的环,标号从\(0\)到\(L-1\). 之后给出\(n\)个新郎,\(n\)个新娘离起点的距离. 现在新郎.新娘要一一配对,但显然每一对新人的产生都会走一定的 ...

  6. FPDF_CloseDocument(doc);

    FPDF_CloseDocument(doc); 创建不加载就会段错误 必须创建     doc = FPDF_CreateNewDocument();

  7. Java代码精进

    一.代码命名规范 驼峰命名法(CamelCase) Google 定义了以下的转换规则: 从正常的表达形式开始,把短语转换成 ASCII 码,并且移除单引号. 例如,“Müller’s algorit ...

  8. luoguP4254 [JSOI2008]Blue Mary开公司

    题意 李超树裸题,注意一开始截距是\(S-P\). code: #include<bits/stdc++.h> using namespace std; #define ls(p) (p& ...

  9. C# git忽略文件 (.gitignore )

    # Visual Studio # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific fi ...

  10. 【转】Struts2 表单验证与验证框架

    版权声明:好笔头不如烂记性 https://blog.csdn.net/zsbgood/article/details/81114038 表单数据验证是很常见的功能,通常前端页面会有一次 js验证,但 ...