ES在liunx环境下的集群配置

elasticsearch.yml配置如下

# 加入如下配置
# 集群名称
cluster.name: cluster-es
#节点名称:每个节点的名称不能重复
node.name: node-1
#ip地址,每个节点的地址不能重复
network.host: 192.168.100.150
#是不是有资格主节点
node.master: true
node.data: true
http.port: 9200
#head 插件需要这打开两个配置
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
#es7.x 之后新增的配置,初始化一个新的集群时需要此配置来选举master
cluster.initial_master_nodes: ["node-1"]
#es7.x 之后新增的配置,节点发现
discovery.seed_hosts: ["192.168.100.150:9300","192.168.100.130:9300","192.168.100.160:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
#集群内同时启动的数据任务个数,默认是2个
cluster.routing.allocation.cluster_concurrent_rebalance: 16
#添加或删除节点及负载均衡时并发恢复的线程个数,默认4个
cluster.routing.allocation.node_concurrent_recoveries: 16
#初始化数据恢复时,并发恢复的线程的个数,默认4个
cluster.routing.allocation.node_initial_primaries_recoveries: 16

修改 /etc/security/limits.conf,分发文件

es soft nofile 65536

es hard nofile 65536

修改 /etc/security/limits.d/20-nproc.conf

es         soft    nofile    65536
es         hard    nofile    65536
*          soft    nproc     4096
root       soft    nproc     unlimited

修改 /etc/sysctl.conf

vm.max_map_count=655360

然后重新加载

sysctl -p

 

 

# 加入如下配置
# 集群名称
cluster.name: cluster-es
#节点名称:每个节点的名称不能重复
node.name: node-1
#ip地址,每个节点的地址不能重复
network.host: 192.168.100.150
#是不是有资格主节点
node.master: true
node.data: true
http.port: 9200
#head 插件需要这打开两个配置
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
#es7.x 之后新增的配置,初始化一个新的集群时需要此配置来选举master
cluster.initial_master_nodes: ["node-1"]
#es7.x 之后新增的配置,节点发现
discovery.seed_hosts: ["192.168.100.150:9300","192.168.100.130:9300","192.168.100.160:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
#集群内同时启动的数据任务个数,默认是2个
cluster.routing.allocation.cluster_concurrent_rebalance: 16
#添加或删除节点及负载均衡时并发恢复的线程个数,默认4个
cluster.routing.allocation.node_concurrent_recoveries: 16
#初始化数据恢复时,并发恢复的线程的个数,默认4个
cluster.routing.allocation.node_initial_primaries_recoveries: 16

posted @ 2022-03-21 20:40  J.....ava  阅读(113)  评论(0编辑  收藏  举报