ELK安装
Java安装
[root@localhost ~]# rpm -ivh jdk-11.0.4_linux-x64_bin.rpm
warning: jdk-11.0.4_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:jdk-11.0.4-2000:11.0.4-ga ################################# [100%]
[root@localhost ~]# rpm -qpl jdk-11.0.4_linux-x64_bin.rpm
/usr/java/jdk-11.0.4
[root@localhost ~]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk-11.0.4
export JAVA_BIN=/usr/java/jdk-11.0.4/bin
export PATH=${JAVA_HOME}/bin:$PATH
export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "11.0.4" 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
Elasticsearch安装
https://www.elastic.co/cn/what-is/elk-stack
[root@localhost ~]# rpm -ivh elasticsearch-7.3.1-x86_64.rpm
warning: elasticsearch-7.3.1-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing... ################################# [100%]
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Updating / installing...
1:elasticsearch-0:7.3.1-1 ################################# [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch
[root@localhost ~]# vi /etc/elasticsearch/elasticsearch.yml
path.data: /data/elasticsearch_data
#
# Path to log files:
#
path.logs: /data/elasticsearc_log
network.host: 127.0.0.1
http.port: 9200
[root@localhost ~]# systemctl restart elasticsearch
[root@localhost data]# curl 127.0.0.1:9200
{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "PxUu64U3RCau32h2F1AfOg",
"version" : {
"number" : "7.3.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "4749ba6",
"build_date" : "2019-08-19T20:19:25.651794Z",
"build_snapshot" : false,
"lucene_version" : "8.1.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
kibana安装
[root@localhost ~]# rpm -ivh kibana-7.3.1-x86_64.rpm
warning: kibana-7.3.1-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:kibana-7.3.1-1 ################################# [100%]
[root@localhost kibana]# vi /etc/kibana/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
# The Kibana server's name. This is used for display purposes.
server.name: "kibana-1"
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://localhost:9200"]
kibana.index: ".kibana"
[root@localhost kibana]# systemctl restart kibana
Logstash安装
[root@localhost ~]# rpm -ivh logstash-7.3.1.rpm
warning: logstash-7.3.1.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:logstash-1:7.3.1-1 ################################# [100%]
Using provided startup.options file: /etc/logstash/startup.options
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.30/lib/pleaserun/platform/base.rb:112: warning: constant ::Fixnum is deprecated
Successfully created system startup script for Logstash
[root@localhost ~]# vi /etc/logstash/logstash.yml
node.name: logstash-01
path.config: /etc/logstash/conf.d