ES配置及FAQ

################################### Cluster ###################################
#定义集群名称,默认是elasticsearch
cluster.name: elasticsearch
#################################### Node #####################################
#定义此节点名称
node.name: "elk001"
#此节点是否为master,master作用就是做协调,协调集群的状态,数据的读取时由集群的各个节点共同完成的,但是数据的修改只能master完成
#node.master: true
#此节点是否为子节点,功能就是存储数据,存储索引之类的
#node.data: true
#node.rack: rack314
# 设置一台服务器能运行的节点数,一般为1就好,因为一般情况下一台机器只跑一个节点
#node.max_local_storage_nodes: 1
#################################### Index ####################################
#定义索引分片的数量
#index.number_of_shards: 5
#定义副本的数量
#index.number_of_replicas: 1
#################################### Paths ####################################
#定义配置文件的设置
#path.conf: /path/to/conf
#定义索引数据存储的位置
#path.data: /path/to/data
#path.data: /path/to/data1,/path/to/data2

#定义临时文件的位置
#path.work: /path/to/work

# Path to log files:
#定义日志文件的路径
#path.logs: /path/to/logs

#定义插件的位置
#path.plugins: /path/to/plugins

#################################### Plugin ###################################
#这个属性值为各个插件的名称,如果该值里的所列的插件没安装,则该节点不能启动,默认是没有插件
#plugin.mandatory: mapper-attachments,lang-groovy
################################### Memory ####################################
#es在内存不够jvm开启swapping的时候,表现的会很差,所以为了避免这个问题,将概述性设置为true,表示锁定es所使用的内存
############################## Network And HTTP ###############################
#elasticsearch节点绑定的地址
#network.bind_host: 192.168.0.1
#elasticsearch和其他节点通信的地址,如果不设置的话 会自动获取
#network.publish_host: 192.168.0.1

# Set both 'bind_host' and 'publish_host':
#
#network.host: 192.168.0.1
#设置节点之间通信的端口
#transport.tcp.port: 9300
#定义是否压缩tcp传输时的数据
#transport.tcp.compress: true
#定义http传输监听的端口
#http.port: 9200
#设置http交互中传输内容的最大长度
#http.max_content_length: 100mb
#是否启用http协议,如果不想让elasticsearch走http协议就设置为FALSE
#http.enabled: false

################################### Gateway ###################################
#elasticsearch底层持久化,默认是走的本地,也可以设置为aws的s3
#gateway.type: local
#控制集群在达到多少个节点之后才会开始数据恢复,通过这个设置可以避免集群自动相互发现的初期,shard分片不全的问题,假如es集群内一共有5个节点,就可以设置为5,那么这个集群必须有5个节点启动后才会开始数据分片,如果设置为3,就有可能另外两个节点没存储数据分片
#gateway.recover_after_nodes: 1
#初始化数据恢复的超时时间,假如gateway.recover_after_nodes参数设置为5,就是5个节点全部启动后,再过5分钟开始数据恢复
#gateway.recover_after_time: 5m

# Set how many nodes are expected in this cluster. Once these N nodes
# are up (and recover_after_nodes is met), begin recovery process immediately
# (without waiting for recover_after_time to expire):
#启动几个节点后开始数据恢复,假如gateway.recover_after_nodes这个参数设置为5,那么等到这5个节点全部启动后直接可以数据恢复,不用等待gateway.recover_after_time设置的时间
#gateway.expected_nodes: 2
############################# Recovery Throttling #############################
#设置一个节点的并发数量,
#cluster.routing.allocation.node_initial_primaries_recoveries: 4
#cluster.routing.allocation.node_concurrent_recoveries: 2
# Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
#恢复数据时,限制的宽带流量,如果是0就是无限制
#indices.recovery.max_bytes_per_sec: 20mb

#从其他分片恢复数据时,最大打开并发的值
#indices.recovery.concurrent_streams: 5

################################## Discovery ##################################
#设置这个集群,有多少个节点有master候选资格,如果集群较大官方建议为2-4个
#discovery.zen.minimum_master_nodes: 1

# 配置该节点会与哪些候选地址进行通信 discovery.seed_hosts: ["ip:9300", "ip:9300"]


#集群初始化的提供的master候选地址 cluster.initial_master_nodes: ["es-node01"]

参考:https://www.cnblogs.com/xiaochina/p/6855591.html

 FAQ

1.Could not index event to Elasticsearch

[logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=>404, :action=>["index", {:_id=>nil, :_index=>"nginx-172.16.2.13-2019.11.12".......

修改配置:

action.auto_create_index: .monitoring-kibana*,test_log*,test_web_log*

 2.curl创建报406

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

在curl -XPUT......中添加

 -H 'content-Type:application/json'

 

 

 

Elasticsearch 节点角色说明

https://www.cnblogs.com/37yan/p/9928748.html

 

posted @ 2020-08-17 17:25  鱼丸河粉  阅读(232)  评论(0编辑  收藏  举报