2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Inhaltsverzeichnis
1. Stellen Sie Filebeat bereit
3. Überprüfung des Browser-Kibana-Zugriffs
CPU-Name | IP Adresse | Hauptsoftware |
---|---|---|
es01 | 192.168.9.114 | ElasticSearch |
es02 | 192.168.9.115 | ElasticSearch |
es03 | 192.168.9.116 | ElasticSearch, Kibana |
nginx01 | 192.168.9.113 | nginx, Logstash |
N / A | 192.168.9.111 | nginx, Filebeat |
N / A | 192.168.9.210 | Zookeeper, Kafka |
N / A | 192.168.9.120 | Zookeeper, Kafka |
N / A | 192.168.9.140 | Zookeeper, Kafka |
ELK, Filebead, Zookeeper und Kafka können erstellt werden, um frühere Blogs abzufragen
- cd /usr/local/filebeat
-
- vim filebeat.yml
- 注释162、164行内容
- 163行起添加
- output.kafka:
- enabled: true
- hosts: ["192.168.9.210:9092","192.168.9.120","192.168.9.140"] #指定 Kafka 集群配置
- topic: "nginx" #指定 Kafka 的 topic
-
- ————————————
Der Browser greift auf Filebeat zu und generiert neue Protokolldaten
(http://192.168.9.111/test.html、http://192.168.9.111/test1.html、http://192.168.9.111/)
- 启动 filebeat
- ./filebeat -e -c filebeat.yml
- cd /etc/logstash/conf.d/
- vim kafka.conf
- input {
- kafka {
- bootstrap_server => "192.168.9.210:9092,192.168.9.120:9092,192.168.9.140:9092"
- topics => "nginx"
- type => "nginx_kafka"
- auto_offset_reset => "latest"
- }
- }
-
- #filter {}
-
- output {
- elasticsearch {
- hosts => ["192.168.9.114:9200", "192.168.9.115:9200", "192.168.9.116:9200"]
- index => "nginx_kafka-%{+yyyy.MM.dd}"
- }
- }
-
-
-
- logstash -t -f kafka.conf
- logstash -f kafka.conf
Besuchen Sie http://192.168.9.116:5601 mit dem Browser, melden Sie sich bei Kibana an, klicken Sie auf die Schaltfläche [Verwalten], [Indexmodus erstellen], suchen Sie nach [nginx_kafka-*], klicken Sie zum Erstellen auf die Schaltfläche [Weiter] und wählen Sie [ @timestamp]-Schaltfläche, [Indexmodus erstellen]; Sie können Diagramminformationen und Protokollinformationen anzeigen.