第一步是参考网上各种网站搭建的。参考网站如下:
- https://blog.csdn.net/liubenlong007/article/details/53782955
- https://www.cnblogs.com/yuhuLin/p/7018858.html
- https://www.cnblogs.com/harvey2017/p/8922164.html
ELK下载:https://www.elastic.co/downloads/
配置ElasticSearch:
|
修改以下配置项
cluster.name=es_cluster
node.name=node0
path.data=
/tmp/elasticsearch/data
path.logs=
/tmp/elasticsearch/logs
#当前hostname或IP,我这里是node1
network.host=node1
network.port=9200
启动ES
nohup
sh elasticsearch >
nohup
.log &
注意:
1.需要添加用户elk,ES不能以root用户进行启动
2.可能出现的错误:
- max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
1 2 3 |
|
- max number of threads [1024] for user [work] likely too low, increase to at least [2048]
1 2 3 4 |
|
- max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
1 2 3 4 5 |
|
- 另外再配置ES的时候,threadpool.bulk.queue_size 已经变成了thread_pool.bulk.queue_size ,ES_HEAP_SIZE,ES_MAX_MEM等配置都变为ES_JAVA_OPTS这一配置项,如限制内存最大最小为1G:
1 |
|
访问检测elasticsearch是否安装成功
安装logstash
tar
-zxvf logstash-6.2.4.
tar
.gz
cd
logstash-6.2.4
vi config/log-es.config
配置内容如下:
input {
tcp {
host => "192.168.1.6"
port => 4560
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch{
hosts => ["localhost:9200"]
index => "log4j-%{+YYYY.MM.dd}"
document_type => "log4j_type"
}
}
启动logstash:
# -f为指定配置文件
nohup
sh .
/bin/logstash
-f ../config/
log-es.config > nohup
.log &
配置安装Kibana
tar
-zxvf kibana-6.2.4-linux-x86_64.
tar
.gz
cd
kibana-6.2.4-linux-x86_64
vim kibana-6.2.4-linux-x86_64/config/kibana.yml
修改以下几项
1 2 3 4 |
|
启动kibana:
1 |
|