版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_27868061/article/details/84936458
1.主节点配置
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: elasticsearch
node.name: master
node.master: true
node.data: false
node.attr.rack: 主节点
path.data: D:\software\dev\elasticsearch\elasticsearch-6.4.3_master\data
path.logs: D:\software\dev\elasticsearch\elasticsearch-6.4.3_master\logs
bootstrap.memory_lock: true
network.host: localhost
http.port: 9200
discovery.zen.ping.unicast.hosts: ["localhost"]
gateway.recover_after_nodes: 3
discovery.zen.minimum_master_nodes: 1
2.副节点配置
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: elasticsearch
node.name: slave1
node.master: false
node.data: true
node.attr.rack: 副节点1
path.data: D:\software\dev\elasticsearch\elasticsearch-6.4.3_slave1\data
path.logs: D:\software\dev\elasticsearch\elasticsearch-6.4.3_slave1\logs
bootstrap.memory_lock: true
network.host: localhost
http.port: 9201
discovery.zen.ping.unicast.hosts: ["localhost"]
gateway.recover_after_nodes: 3
discovery.zen.minimum_master_nodes: 1
主要配置属性:
属性 | 描述 |
http.cors.enabled | 是否启用跨域 |
http.cors.allow-origin | 允许跨域的域名 |
cluster.name | 集群名称,所有节点必须相同 |
node.name | 节点名称,不同节点必须不同 |
node.master | 是否有主节点资格 |
node.data | 是否可以存储数据 |
node.attr.rack | 节点描述 |
path.data | 数据存储路径 |
path.logs | 日志存储路径 |
network.host | 域名 |
http.port | REST接口端口,ES有两种访问方式,一种是REST,一种是别的,这里如果REST端口改变为9201,则另一访问方式端口改变为9301,不会出现端口冲突 |