1.配置文件(elasticsearch.yml)
cluster.name: ES-Cluster
node.name: ES-master-01
node.master: true
node.data: true
path.data: /usr/local/elasticsearch-cluster/elasticsearch-a/data
path.logs: /usr/local/elasticsearch-cluster/elasticsearch-a/logs
bootstrap.memory_lock: true
network.host: 192.168.3.21
network.tcp.no_delay: true
network.tcp.keep_alive: true
network.tcp.reuse_address: true
network.tcp.send_buffer_size: 128mb
network.tcp.receive_buffer_size: 128mb
transport.tcp.port: 9301
transport.tcp.compress: true
http.max_content_length: 200mb
http.cors.enabled: true
http.cors.allow-origin: "*"
http.port: 9201
discovery.seed_hosts: ["192.168.3.21:9301", "192.168.3.22:9301","192.168.3.23:9301"]
cluster.initial_master_nodes: ["192.168.3.21:9301", "192.168.3.22:9301","192.168.3.23:9301"]
cluster.fault_detection.leader_check.interval: 2s
discovery.cluster_formation_warning_timeout: 30s
cluster.join.timeout: 30s
cluster.publish.timeout: 90s
cluster.routing.allocation.cluster_concurrent_rebalance: 32
cluster.routing.allocation.node_concurrent_recoveries: 32
cluster.routing.allocation.node_initial_primaries_recoveries: 32
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
更多配置请看官网:传送门
2.JVM配置
jvm配置在conf目录下 vim jvm.options 。
ES默认JVM配置 Xms(minimum heap size)=1g,Xmx(maxmimum heap size)=1g
生产环境,这个配置就比较重要了,需要确保 ES 有足够堆空间可用。
注意:Xms 和 Xmx 不能大于你物理机内存的 50%。
-Xms16g
-Xmx16g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
最新评论