ElasticSearch配置

来源:互联网 发布:电脑dj软件 编辑:程序博客网 时间:2024/05/09 23:07
  1. # ---------------------------------- Cluster -----------------------------------
    #
    # Use a descriptive name for your cluster:
    # 配置es的集群名称,默认是elasticsearch,es会自动发现在同一网段下的es,
  2. # 如果在同一网段下有多个集群,就可以用这个属性来区分不同的集群
    cluster.name: utry_test
    #
    # ------------------------------------ Node ------------------------------------
    #
    # Use a descriptive name for the node:
    # 节点名,默认随机指定一个name列表中名字,该列表在es的jar包中config文件夹里name.txt文件中,其中有很多作者添加的有趣名字

  3. # node.name: node-1
    #
    # Add custom attributes to the node:
    #
    # node.rack: r1
    #
    #
    1. # ------------------------------------ Index -----------------------------------
    2. # 设置默认索引分片个数,默认为5片
    3. index.number_of_shards:5
    4. #
    5. # 设置默认索引副本个数,默认为1个副本
    6. index.number_of_replicas:1
    7. #
    8. # ----------------------------------- Paths ------------------------------------
    9. # 设置配置文件的存储路径,默认是es根目录下的config文件夹
    10. # path.conf: /path/to/conf
    11. #
    12. # 设置索引数据的存储路径,默认是es根目录下的data文件夹,可以设置多个存储路径,用逗号隔开,例:
    13. # path.data: /path/to/data1,/path/to/data2
    14. # path.data: /path/to/data
    15. #
    16. # 设置日志文件的存储路径,默认是es根目录下的logs文件夹
    17. # path.logs: /path/to/logs
    18. #
    19. # 设置临时文件的存储路径,默认是es根目录下的work文件夹
    20. # path.work: /path/to/work
    21. #
    22. # 设置插件的存放路径,默认是es根目录下的plugins文件夹
    23. # path.plugins: /path/to/plugins
    24. #
    25. # ----------------------------------- Memory -----------------------------------
    26. # 设置为true来锁住内存。因为当jvm开始swapping时es的效率会降低,所以要保证它不swap,
    27. # 可以把ES_MIN_MEM和ES_MAX_MEM两个环境变量设置成同一个值,并且保证机器有足够的内存分配给es。
    28. # 同时也要允许elasticsearch的进程可以锁住内存,linux下可以通过`ulimit -l unlimited`命令
    29. bootstrap.mlockall:true
    30. #
    31. # ---------------------------------- Network -----------------------------------
    32. # 设置绑定的ip地址,可以是ipv4或ipv6的,默认为0.0.0.0
    33. # network.bind_host: 192.168.0.1
    34. #
    35. # 设置其它节点和该节点交互的ip地址,如果不设置它会自动判断,值必须是个真实的ip地址
    36. # network.publish_host: 192.168.0.1
    37. #
    38. # 这个参数是用来同时设置bind_host和publish_host上面两个参数
    39. # network.host: 192.168.0.1
    40. #
    41. # 设置节点间交互的tcp端口,默认是9300
    42. transport.tcp.port:9300
    43. #
    44. # 设置对外服务的http端口,默认为9200
    45. http.port:9200
    46. #
    47. # 设置是否压缩tcp传输时的数据,默认为false,不压缩
    48. transport.tcp.compress:true
    49. #
    50. # 设置内容的最大容量,默认100mb
    51. http.max_content_length:100mb
    52. #
    53. # 是否使用http协议对外提供服务,默认为true,开启
    54. http.enabled:true
    55. #
    56. # ---------------------------------- Gateway -----------------------------------
    57. # gateway的类型,默认为local即为本地文件系统,可以设置为本地文件系统,分布式文件系统,hadoop的HDFS,和amazon的s3服务器
    58. gateway.type:local
    59. #
    60. # 设置集群中N个节点启动时进行数据恢复,默认为1
    61. # gateway.recover_after_nodes: 1
    62. #
    63. # 设置初始化数据恢复进程的超时时间,默认是5分钟
    64. # gateway.recover_after_time: 5m
    65. #
    66. # 设置这个集群中节点的数量,默认为2,一旦这N个节点启动,就会立即进行数据恢复(无需等待 recover_after_time 过期)
    67. # gateway.expected_nodes: 2
    68. #
    69. # ----------------------------- Recovery Throttling ----------------------------
    70. # 初始化数据恢复时,并发恢复线程的个数,默认为4
    71. # cluster.routing.allocation.node_initial_primaries_recoveries: 4
    72. #
    73. # 添加删除节点或负载均衡时并发恢复线程的个数,默认为4
    74. # cluster.routing.allocation.node_concurrent_recoveries: 2
    75. #
    76. # 设置数据恢复时限制的带宽,如入100mb,默认为0,即无限制
    77. indices.recovery.max_size_per_sec:20mb
    78. #
    79. # 设置这个参数来限制从其它分片恢复数据时最大同时打开并发流的个数,默认为5
    80. indices.recovery.concurrent_streams:5
    81. #
    82. # --------------------------------- Discovery ----------------------------------
    83. # 设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点。默认为1,对于大的集群来说,可以设置大一点的值(2-4)
    84. discovery.zen.minimum_master_nodes:1
    85. #
    86. # 设置集群中自动发现其它节点时ping连接超时时间,默认为3秒,对于比较差的网络环境可以高点的值来防止自动发现时出错
    87. discovery.zen.ping.timeout:3s
    88. #
    89. # 设置是否打开多播发现节点,默认是true
    90. discovery.zen.ping.multicast.enabled:true
    91. #
    92. # 设置集群中master节点的初始列表,可以通过这些节点来自动发现新加入集群的节点
    93. # discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]
    94. #
    95. # ---------------------------------- Slow Log ----------------------------------
    96. # 下面是一些查询时的慢日志参数设置
    97. #
    98. #index.search.slowlog.threshold.query.warn: 10s
    99. #index.search.slowlog.threshold.query.info: 5s
    100. #index.search.slowlog.threshold.query.debug: 2s
    101. #index.search.slowlog.threshold.query.trace: 500ms
    102. #
    103. #index.search.slowlog.threshold.fetch.warn: 1s
    104. #index.search.slowlog.threshold.fetch.info: 800ms
    105. #index.search.slowlog.threshold.fetch.debug: 500ms
    106. #index.search.slowlog.threshold.fetch.trace: 200ms
    107. #
    108. #index.indexing.slowlog.threshold.index.warn: 10s
    109. #index.indexing.slowlog.threshold.index.info: 5s
    110. #index.indexing.slowlog.threshold.index.debug: 2s
    111. #index.indexing.slowlog.threshold.index.trace: 500ms
    112. #
    113. # --------------------------------- GC Logging ---------------------------------
    114. #
    115. #monitor.jvm.gc.young.warn: 1000ms
    116. #monitor.jvm.gc.young.info: 700ms
    117. #monitor.jvm.gc.young.debug: 400ms
    118. #
    119. #monitor.jvm.gc.old.warn: 10s
    120. #monitor.jvm.gc.old.info: 5s
    121. #monitor.jvm.gc.old.debug: 2s
    122. #
    123. # ---------------------------------- Security ----------------------------------
    124. # 是否启用JSONP,默认禁用
    125. # http.jsonp.enable: false




转载自程序人生2014 《elasticsearch.yml配置文件
0 0
原创粉丝点击