elassticearch配置目录

配置目录

安装完毕后会生成很多文件,包括配置文件日志文件等等,下面几个是最主要的配置文件路径

/etc/elasticsearch/elasticsearch.yml # els的配置文件

/etc/elasticsearch/jvm.options # JVM相关的配置,内存大小等等

/etc/elasticsearch/log4j2.properties # 日志系统定义

/var/lib/elasticsearch # 数据的默认存放位置

 

配置文件

#集群的名称,同一个集群该值必须设置成相同的

cluster.name: my-application

#该节点的名字

node-name: els1

#如果是master节点设置成true

node.master: ture

#如果是data节点设置成true

node.data: ture

path.data: /var/lib/elasticsearch

path.logs: /var/log/elasticsearch

transport.tcp.port: 9300

discovery.zen.ping.unicast.hosts: ["10.7.7.23", "192.168.2.253"]

discovery.zen.minimum_master_nodes: 1

 

查看节点状态

然后执行

curl -XGET ‘10.87.202.44:9200/_cat/nodes?v&pretty’

查询节点状态,可以发现集群已经搭建好。

 

配置文件详解:

cluster.name:elasticsearch 
#集群的名称,同一个集群该值必须设置成相同的
node.name:"es2" 
#该节点的名字
node.master:true 
#该节点有机会成为master节点
node.data:true 
#该节点可以存储数据
node.rack:rack2 
#该节点所属的机架
index.number_of_shards:5 
#shard的数目
index.number_of_replicas:3 
#数据副本的数目
network.bind_host:0.0.0.0 
#设置绑定的IP地址,可以是IPV4或者IPV6
network.publish_host:10.0.0.209 
#设置其他节点与该节点交互的IP地址
network.host:10.0.0.209 
#该参数用于同时设置bind_host和publish_host
transport.tcp.port:9300 
#设置节点之间交互的端口号
transport.tcp.compress:true 
#设置是否压缩tcp上交互传输的数据
http.port:9200 
#设置对外服务的http端口号
http.max_content_length:100mb 
#设置http内容的最大大小
http.enabled:true 
#是否开启http服务对外提供服务
discovery.zen.minimum_master_nodes:2 
#设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点。默认为1,对于大的集群来说,可以设置大一点的值(2-4)
discovery.zen.ping.timeout:120s 
#设置集群中自动发现其他节点时ping连接的超时时间
discovery.zen.ping.multicast.enabled:true 
#设置是否打开多播发现节点
discovery.zen.ping.unicast.hosts:["10.0.0.209:9300","10.0.0.206:9300","10.0.0.208:9300"] 
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点

 

 

 

posted @ 2018-12-19 16:38  格桑梅朵儿  阅读(170)  评论(0)    收藏  举报