elasticsearch.yml配置文件


    Elasticsearch的配置文件在config文件夾下,其中有 elasticsearch.yml logging.yml兩個配置文件,其中 elasticsearch.yml是用來配置 Elasticsearch服務的, logging.yml是用來配置日志文件的。下面是 elasticsearch.yml配置文件的中文說明:
   
   
   
           
  1. # ---------------------------------- Cluster -----------------------------------
  2. # 配置es的集群名稱,默認是elasticsearch,es會自動發現在同一網段下的es,如果在同一網段下有多個集群,就可以用這個屬性來區分不同的集群
  3. cluster.name: elasticsearch
  4. #
  5. # ------------------------------------ Node ------------------------------------
  6. # 節點名,默認隨機指定一個name列表中名字,該列表在es的jar包中config文件夾里name.txt文件中,其中有很多作者添加的有趣名字
  7. node.name: "Franz Kafka"
  8. #
  9. # 指定該節點是否有資格被選舉成為node,默認是true,es是默認集群中的第一台機器為master,如果這台機掛了就會重新選舉master
  10. node.master: true
  11. #
  12. # 指定該節點是否存儲索引數據,默認為true
  13. node.data: true
  14. #
  15. # ------------------------------------ Index -----------------------------------
  16. # 設置默認索引分片個數,默認為5片
  17. index.number_of_shards: 5
  18. #
  19. # 設置默認索引副本個數,默認為1個副本
  20. index.number_of_replicas: 1
  21. #
  22. # ----------------------------------- Paths ------------------------------------
  23. # 設置配置文件的存儲路徑,默認是es根目錄下的config文件夾
  24. # path.conf: /path/to/conf
  25. #
  26. # 設置索引數據的存儲路徑,默認是es根目錄下的data文件夾,可以設置多個存儲路徑,用逗號隔開,例:
  27. # path.data: /path/to/data1,/path/to/data2
  28. # path.data: /path/to/data
  29. #
  30. # 設置日志文件的存儲路徑,默認是es根目錄下的logs文件夾
  31. # path.logs: /path/to/logs
  32. #
  33. # 設置臨時文件的存儲路徑,默認是es根目錄下的work文件夾
  34. # path.work: /path/to/work
  35. #
  36. # 設置插件的存放路徑,默認是es根目錄下的plugins文件夾
  37. # path.plugins: /path/to/plugins
  38. #
  39. # ----------------------------------- Memory -----------------------------------
  40. # 設置為true來鎖住內存。因為當jvm開始swapping時es的效率會降低,所以要保證它不swap,
  41. # 可以把ES_MIN_MEM和ES_MAX_MEM兩個環境變量設置成同一個值,並且保證機器有足夠的內存分配給es。
  42. # 同時也要允許elasticsearch的進程可以鎖住內存,linux下可以通過`ulimit -l unlimited`命令
  43. bootstrap.mlockall: true
  44. #
  45. # ---------------------------------- Network -----------------------------------
  46. # 設置綁定的ip地址,可以是ipv4或ipv6的,默認為0.0.0.0
  47. # network.bind_host: 192.168.0.1
  48. #
  49. # 設置其它節點和該節點交互的ip地址,如果不設置它會自動判斷,值必須是個真實的ip地址
  50. # network.publish_host: 192.168.0.1
  51. #
  52. # 這個參數是用來同時設置bind_host和publish_host上面兩個參數
  53. # network.host: 192.168.0.1
  54. #
  55. # 設置節點間交互的tcp端口,默認是9300
  56. transport.tcp.port: 9300
  57. #
  58. # 設置對外服務的http端口,默認為9200
  59. http.port: 9200
  60. #
  61. # 設置是否壓縮tcp傳輸時的數據,默認為false,不壓縮
  62. transport.tcp.compress: true
  63. #
  64. # 設置內容的最大容量,默認100mb
  65. http.max_content_length: 100mb
  66. #
  67. # 是否使用http協議對外提供服務,默認為true,開啟
  68. http.enabled: true
  69. #
  70. # ---------------------------------- Gateway -----------------------------------
  71. # gateway的類型,默認為local即為本地文件系統,可以設置為本地文件系統,分布式文件系統,hadoop的HDFS,和amazon的s3服務器
  72. gateway.type: local
  73. #
  74. # 設置集群中N個節點啟動時進行數據恢復,默認為1
  75. # gateway.recover_after_nodes: 1
  76. #
  77. # 設置初始化數據恢復進程的超時時間,默認是5分鍾
  78. # gateway.recover_after_time: 5m
  79. #
  80. # 設置這個集群中節點的數量,默認為2,一旦這N個節點啟動,就會立即進行數據恢復(無需等待 recover_after_time 過期)
  81. # gateway.expected_nodes: 2
  82. #
  83. # ----------------------------- Recovery Throttling ----------------------------
  84. # 初始化數據恢復時,並發恢復線程的個數,默認為4
  85. # cluster.routing.allocation.node_initial_primaries_recoveries: 4
  86. #
  87. # 添加刪除節點或負載均衡時並發恢復線程的個數,默認為4
  88. # cluster.routing.allocation.node_concurrent_recoveries: 2
  89. #
  90. # 設置數據恢復時限制的帶寬,如入100mb,默認為0,即無限制
  91. indices.recovery.max_size_per_sec: 20mb
  92. #
  93. # 設置這個參數來限制從其它分片恢復數據時最大同時打開並發流的個數,默認為5
  94. indices.recovery.concurrent_streams: 5
  95. #
  96. # --------------------------------- Discovery ----------------------------------
  97. # 設置這個參數來保證集群中的節點可以知道其它N個有master資格的節點。默認為1,對於大的集群來說,可以設置大一點的值(2-4)
  98. discovery.zen.minimum_master_nodes: 1
  99. #
  100. # 設置集群中自動發現其它節點時ping連接超時時間,默認為3秒,對於比較差的網絡環境可以高點的值來防止自動發現時出錯
  101. discovery.zen.ping.timeout: 3s
  102. #
  103. # 設置是否打開多播發現節點,默認是true
  104. discovery.zen.ping.multicast.enabled: true
  105. #
  106. # 設置集群中master節點的初始列表,可以通過這些節點來自動發現新加入集群的節點
  107. # discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]
  108. #
  109. # ---------------------------------- Slow Log ----------------------------------
  110. # 下面是一些查詢時的慢日志參數設置
  111. #
  112. #index.search.slowlog.threshold.query.warn: 10s
  113. #index.search.slowlog.threshold.query.info: 5s
  114. #index.search.slowlog.threshold.query.debug: 2s
  115. #index.search.slowlog.threshold.query.trace: 500ms
  116. #
  117. #index.search.slowlog.threshold.fetch.warn: 1s
  118. #index.search.slowlog.threshold.fetch.info: 800ms
  119. #index.search.slowlog.threshold.fetch.debug: 500ms
  120. #index.search.slowlog.threshold.fetch.trace: 200ms
  121. #
  122. #index.indexing.slowlog.threshold.index.warn: 10s
  123. #index.indexing.slowlog.threshold.index.info: 5s
  124. #index.indexing.slowlog.threshold.index.debug: 2s
  125. #index.indexing.slowlog.threshold.index.trace: 500ms
  126. #
  127. # --------------------------------- GC Logging ---------------------------------
  128. #
  129. #monitor.jvm.gc.young.warn: 1000ms
  130. #monitor.jvm.gc.young.info: 700ms
  131. #monitor.jvm.gc.young.debug: 400ms
  132. #
  133. #monitor.jvm.gc.old.warn: 10s
  134. #monitor.jvm.gc.old.info: 5s
  135. #monitor.jvm.gc.old.debug: 2s
  136. #
  137. # ---------------------------------- Security ----------------------------------
  138. # 是否啟用JSONP,默認禁用
  139. # http.jsonp.enable: false
  140. #
-------------------------------------------------------------------------------------------------------------------------------





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM