同一台机器配置两个elasticsearch7.6.2实例
使用软件版本:elasticsearch7.6.2
配置运行环境更改系统参数:
-
vim /etc/security/limits.conf
-
* soft nofile 65537
-
* hard nofile 65537
-
* soft nproc 65537
-
* hard nproc 65537
-
vim /etc/sysctl.conf
-
vm.max_map_count = 262144
-
net.core.somaxconn = 65535
-
net.ipv4.ip_forward = 1
#1
cluster.name: my-application
node.name: node-1
node.master: true
node.data: true
path.data: /opt/es/forlinux7/es7-1/data
path.logs: /opt/es/forlinux7/es7-1/logs
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300
discovery.seed_hosts: ["106.54.110.*:9300", "106.54.110.*:9301"]
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
#2
cluster.name: my-application
node.name: node-2
node.master: false
node.data: true
path.data: /opt/es/forlinux7/es7-2/data
path.logs: /opt/es/forlinux7/es7-2/logs
network.host: 106.54.110.35
http.port: 9201
transport.port: 9301
discovery.seed_hosts: ["106.54.110.*:9300", "106.54.110.*:9301"]
cluster.initial_master_nodes: ["node-1", "node-2"]
http.cors.enabled: true
http.cors.allow-origin: "*"