CentOS7安装EFK

编程

前言

JDK选择了1.8

EFK的版本要一直,可以从官网下载

一、安装JDK

安装完毕JDK后,配置环境变量

vi /etc/profile

export JAVA_HOME=/java/jdk1.8.0_171

export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$JAVA_HOME/bin:$PATH

source /etc/profile

二、安装ElasticSearsh

编辑配置文件

vim config/elasticsearch.yml

修改文件节点

cluster.name: my-application

node.name: node-1

network.host: 0.0.0.0

http.port: 9200

root不能启动elasticsearsh:can not run elasticsearch as root

#创建用户

adduser elastic

#设置密码

passwd elastic

#需要输入2次密码

#授权

chmod -R 777 /usr/local/elasticsearch-6.2.4

#切换用户

su elastic

启动时如果报错:

max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

vi /etc/security/limits.conf

内容是:

* soft nofile 65535

* hard nofile 65535

启动时如果报错:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vi /etc/sysctl.conf

内容是:

vm.max_map_count=262144

然后执行命令:

sysctl -p

启动时如果报错:

the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
则要在配置文件中设置:

cluster.initial_master_nodes: ["node-1"] 

三、安装Kibana

修改配置文件

vi config/kibana.yml

内容:

elasticsearch.url: "http://localhost:9200"

server.host: "0.0.0.0"

kibana.index: ".kibana"

 四、安装FileBeat

修改配置文件

vi filebeat.yml

内容:

filebeat.prospectors:

- type: log

enabled: true

paths:

- /var/xxx/*.log

- /var/xxx/*.out

multiline.pattern: ^[

multiline.negate: true

multiline.match: after

setup.kibana:

host: "localhost:5601"

output.elasticsearch:

hosts: ["localhost:9200"]

 

以上是 CentOS7安装EFK 的全部内容, 来源链接: utcz.com/z/510510.html

回到顶部