美文网首页
elasticsearch01 windows版本及基础配置详解

elasticsearch01 windows版本及基础配置详解

作者: 肆无忌惮的绅士 | 来源:发表于2019-02-13 17:29 被阅读0次

     windows版本目录描述

    1.基本目录:

    (1)bin:该文件夹下包含es的运行的可执行文件

    (2)config:该文件夹下主要包含es 的相关配置文件

    (3)lib:该文件夹下主要是es运行所需要的jar包

    (4)modules:该文件夹表示的es模块组成包含很多的模块也可理解为es在工作时内部需要的一些组件

    (5)plugins:该文件夹下主要是存放es辅助的一些插件,如:中文分词器

    2. 目录详解:

    (1)bin目录:

    目录下包含很多可执行文件,而elasticsearch.bat 为es的windos下启动文件,双击既可以启动es,其他的执行文件在具体使用中我们再解析

    (2)conf目录:

    elasticsearch.yml 

           elasticsearch主配置文件也是非常核心的一个配置文件,它默认会配置一些合理的常用配置,在不修改任何配置情况下,elasticsearch也能正常运行,但是大多数是根据个人需求进行不同的配置 。

    elasticsearch.yml 常用配置:打开elasticsearch.yml 配置文件(翻译后)可以看到如下信息:

    # ======================== Elasticsearch配置 =========================

    #注意:对于大多数设置,Elasticsearch都有合理的默认值。

    #在你开始调整和调整配置之前,请确保你

    #了解你想要完成什么以及后果。

    #配置节点的主要方法是通过此文件。 此模板列出

    #您可能要为生产群集配置的最重要的设置。

    #有关配置选项的更多信息,请参阅文档:

    #https://www.elastic.co/guide/en/elasticsearch/reference/index.htm

    #

    # ---------------------------------- Cluster(集群配置)-----------------------------------

    #

    # 为群集使用描述性名称

    # 集群的名称:默认为 elasticsearch

    #cluster.name: my-application

    #

    # ------------------------------------ Node(节点配置) ------------------------------------

    #

    #为节点使用描述性名称

    #节点名称

    #node.name: node-1

    # 将自定义属性添加到节点

    #node.attr.rack: r1

    #

    # ----------------------------------- Paths(涉及到的路径配置) ------------------------------------

    #

    # 目录存储数据的路径(用逗号分隔多个位置)

    #  默认存储在根目录下的data文件夹

    #path.data: /path/to/data

    #

    # 可以指定es的日志存储目录,默认存储在根目录下的logs文件夹

    #

    #path.logs: /path/to/logs

    #

    # ----------------------------------- Memory (内存相关配置)-----------------------------------

    #

    # 锁定物理内存地址,防止elasticsearch内存被交换出去,这样保证了es运行固定需要的内存大小 有助于es服务稳定

    #

    #bootstrap.memory_lock: true

    #  确保ES_HEAP_SIZE参数设置为系统可用内存的一半左右

    # 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.

    # 当es与系统进行内存交互的时候 性能会很差

    # Elasticsearch performs poorly when the system is swapping the memory.

    #

    # ---------------------------------- Network(网络相关配置) -----------------------------------

    #

    # 将绑定地址设置为特定IP(IPv4或IPv6):

    # 默认是127.0.0.1,也就是默认只能通过127.0.0.1 或者localhost才能访问

    # es1.x版本默认绑定的是0.0.0.0 所以不需要配置,但是es2.x版本默认绑定的是 127.0.0.1,需要配置

    #network.host: 192.168.0.1

    #

    # Set a custom port for HTTP:

    # 为HTTP设置自定义端口 默认是 9200

    #http.port: 9200

    #

    # For more information, consult the network module documentation.

    #更多的配置请参考文档

    # --------------------------------- Discovery(发现者配置 主要用于集群中节点的发现) ----------------------------------

    #

    # 传递初始主机列表以在启动新节点时执行发现

    # Pass an initial list of hosts to perform discovery when new node is started:

    # 当启动新节点时,通过这个ip列表进行节点发现,组建集群

    # 默认节点列表:

    # 127.0.0.1,表示ipv4的回环地址。

    # [::1],表示ipv6的回环地址

    # 在es1.x中默认使用的是组播(multicast)协议,默认会自动发现同一网段的es节点组建集群,

    # 在es2.x中默认使用的是单播(unicast)协议,想要组建集群的话就需要在这指定要发现的节点信息了。

    # 注意:如果是发现其他服务器中的es服务,可以不指定端口[默认9300],如果是发现同一个服务器中的es服务,就需要指定端口了。

    # The default list of hosts is ["127.0.0.1", "[::1]"]

    #

    #discovery.zen.ping.unicast.hosts: ["host1", "host2"]

    #通过配置这个参数(集群节点总数/ 2 + 1)来防止“裂脑”:

    # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

    #

    #discovery.zen.minimum_master_nodes:

    #更多的配置请参考文档

    # For more information, consult the zen discovery module documentation.

    #

    # ---------------------------------- Gateway(网关配置) -----------------------------------

    #

    # Block initial recovery after a full cluster restart until N nodes are started:

    #一个集群中的N个节点启动后,才允许进行数据恢复处理,默认是1

    #gateway.recover_after_nodes: 3

    #更多的配置请参考文档

    # For more information, consult the gateway module documentation.

    #

    # ---------------------------------- Various(其他) -----------------------------------

    # 删除索引时需要显式名称:

    # Require explicit names when deleting indices:

    #

    以上是es6.5.4配置文件默认的一些基础配置 其他配置可去查看文档

    相关文章

      网友评论

          本文标题:elasticsearch01 windows版本及基础配置详解

          本文链接:https://www.haomeiwen.com/subject/ldzqdqtx.html