前一段时间配置了公司offline,online的ES服务两组,根据节点分工不同,分为master,client,data三种类型节点;
服务器参数修改如下:
/etc/sysctl``.conf
增加:vm.max_map_count=262144 然后执行sysctl -p生效
/etc/security/limits.conf
elastic soft memlock unlimited
elastic hard memlock unlimited
(退出当前用户,重新登录生效)
修改配置参数如下:
master节点(内存8G)
node.name: master-56-1
node.master: true
node.voting_only: false
node.data: false
node.ingest: true
node.ml: false
cluster.remote.connect: false
http.cors.enabled: true
http.port: 9210
network.host: 100.100.200.56
transport.port: 9300
transport.compress: true
数据节点(data节点)(内存31G)
node.master: false
node.voting_only: false
node.data: true
node.ingest: false
node.ml: false
http.enabled: false
http.port: 0
network.host: 100.100.200.50
transport.port: 9300
transport.compress: true
bootstrap.memory_lock: true
cluster.remote.connect: false
cluster.routing.allocation.same_shard.host: true
indices.breaker.request.limit: 90%
thread_pool.search.max_queue_size 默认值为1000,与thread_pool.search.min_queue_size默认值一样,都为1000; 所以max_queue_size可以调为2000
thread_pool.search.size,默认生成与cpu核心数一至,可以改为cpu核心数2倍;
协调节点(client节点)(内存16G)
node.master: false
node.voting_only: false
node.data: false
node.ingest: false
node.ml: false
cluster.remote.connect: false
http.cors.enabled: true
http.port: 9200
http.cors.allow-headers: Authorization
xpack.security.enabled: true
network.host: 0.0.0.0
transport.port: 9310
transport.compress: true
bootstrap.memory_lock: true
discovery.seed_hosts: ["100.100.200.55:9300","10.110.200.56:9300","100.100.200.57:9300"]
主分片和副本分片分布在不同物理机上(这会防止同一个shard的主副本在一个物理机上):
cluster.routing.allocation.same_shard.host: true。