Elasticsearch 设置系统配置
warning:
这篇文章距离上次修改已过427天,其中的内容可能已经有所变动。
在Elasticsearch中,系统配置通常在elasticsearch.yml文件中设置。以下是一些常见的系统配置设置:
- 集群名称(
cluster.name):
cluster.name: my-cluster- 节点名称(
node.name):
node.name: node-1- 是否有资格被选为主节点(
node.master):
node.master: true- 是否存储数据(
node.data):
node.data: true- 网络绑定地址(
network.host):
network.host: 192.168.1.1- 设置HTTP端口(
http.port):
http.port: 9200- 设置内部节点通讯端口(
transport.tcp.port):
transport.tcp.port: 9300- 设置节点发现(
discovery.seed_hosts):
discovery.seed_hosts: ["host1", "host2"]- 设置初始主节点列表(
cluster.initial_master_nodes):
cluster.initial_master_nodes: ["node-1", "node-2"]- 设置分片数量(
index.number_of_shards):
index.number_of_shards: 3- 设置副本分片数量(
index.number_of_replicas):
index.number_of_replicas: 2这些配置可以根据你的需求和Elasticsearch集群的规模进行调整。在修改配置后,你需要重启Elasticsearch节点以使更改生效。
评论已关闭