[](
)日志数据路径配置
- 配置方式
path.data: /opt/data/es
path.logs: /opt/log/es
path:
data: /opt/data/es
logs: /opt/log/es
- path.data, 可以设置多个目录
path:
logs: /opt/log/es
data:
-
/opt/data/es-A
-
/opt/data/es-B
-
/opt/data/es-C
[](
)集群发现配置
- discovery.seed_hosts 配置方式如下
用于多个集群节点进行发现,组成集群
discovery.seed_hosts: [“192.168.1.10:9300”, “192.168.1.11”, “seeds.mydomain.com”]
discovery.seed_hosts:
-
192.168.1.10:9300
-
192.168.1.11
-
seeds.mydomain.com
- cluster.initial_master_nodes 配置方式如下
用于集群在第一次启动时,指定可以参与选举的主节点列表 (node.master: true)
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
cluster.initial_master_nodes:
-es01
-es02
-es03
- discovery.seed_hosts 如果不配置,会自动监听本地回环地址 将本地多个elasticsearch实例加入到集群中。
[](
)jvm配置
- /opt/es/config/jvm.options (一般配置为机器内存大小的一半)
sed -i "s/-Xms1g/ 需要zi料+ 绿色徽【vip1024b】
-Xms"800m"/g" /opt/es/config/jvm.options
sed -i “s/-Xmx1g/-Xmx"800m”/g" /opt/es/config/jvm.options
[](
)es01
cluster.name: es-cluster-test
node.name: es01
path.logs: /opt/log/es
path.data: /opt/data/es
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [“172.16.1.236:9306”, “172.16.1.236:9307”]
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
[](
)es02
cluster.name: es-cluster-test
node.name: es02
path.logs: /opt/log/es
path.data: /opt/data/es
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [“172.16.1.236:9305”, “172.16.1.236:9307”]
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
[](
)es03
cluster.name: es-clu