Elasticsearch-6.7.0系列(五)5044端口 logstash安装

centos7环境

下载logstash

wget https://artifacts.elastic.co/downloads/logstash/logstash-6.7.0.tar.gz          下载

logstash-sample.conf是默认配置文件,里面的默认端口是5044

tar -zxvf logstash-6.7.0.tar.gz

 ./bin/logstash -f demo-metrics-pipeline.conf      启动Logstash,如果遇到以下错误,则把虚拟机的CPU内核数从1改为2即可。

[root@192 logstash-6.7.0]# ./bin/logstash -f demo-metrics-pipeline.conf
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

修改metric配置

安装目录/metricbeat-6.7.0-darwin-x86_64/metricbeat.yml配置文件,把output从elasticsearch改为logstash:

#-------------------------- Elasticsearch output ------------------------------
#output.elasticsearch:
  # Array of hosts to connect to.
  #hosts: ["localhost:9200"]
#----------------------------- Logstash output --------------------------------
output.logstash:
  # The Logstash hosts
  hosts: ["localhost:5044"]

service metricbeat stop          停止metric服务

service metricbeat status          查看服务状态

 service metricbeat start          重新启动服务

原文地址:https://www.cnblogs.com/zhuwenjoyce/p/10636832.html