配置文件
两个本地配置文件 $ES_HOME/config:
elastic配置文件:elasticsearch.yml
elastic日志配置文件:log4j2.properties
可以修改配置文件夹的路径:
./bin/elasticsearch -Epath.conf=/path/to/my/config
配置文件的格式
配置文件为YAML格式
path: data: /var/lib/elasticsearch logs: /var/log/elasticsearch
path.data: /var/lib/elasticsearchpath.logs: /var/log/elasticsearch
环境变量配置
node.name: ${HOSTNAME}network.host: ${ES_NETWORK_HOST}
日志配置
appender.rolling.type = RollingFile [图片上传中。。。(1)]appender.rolling.name = rollingappender.rolling.fileName = ${sys:es.logs}.log [图片上传中。。。(2)]appender.rolling.layout.type = PatternLayoutappender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %.10000m%nappender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log [图片上传中。。。(3)]appender.rolling.policies.type = Policiesappender.rolling.policies.time.type = TimeBasedTriggeringPolicy [图片上传中。。。(4)]appender.rolling.policies.time.interval = 1 [图片上传中。。。(5)]appender.rolling.policies.time.modulate = true [图片上传中。。。(6)]
Configure the RollingFile
appender
Log to /var/log/elasticsearch/production.log
Roll logs to /var/log/elasticsearch/production-yyyy-MM-dd.log
Using a time-based roll policy
Roll logs on a daily basis
Align rolls on the day boundary (as opposed to rolling every twenty-four hours)