2017-08-22 76 views
1

我是新來的彈性堆棧。我正嘗試使用Metricbeat和logstash將度量標準從一臺PC(ubuntu)發送到另一臺遠程服務器。下面是我的配置文件, metricbeat.ymlMetricbeat到Logstash遠程服務器不能正常工作

metricbeat.modules: 

#------------------------------- System Module ------------------------------- 
- module: system 
    metricsets: 
    # CPU stats 
    - cpu 

    # System Load stats 
    - load 

    # Per CPU core stats 
    #- core 

    # IO stats 
    #- diskio 

    # Per filesystem stats 
    - filesystem 

    # File system summary stats 
    - fsstat 

    # Memory stats 
    - memory 

    # Network stats 
    - network 

    # Per process stats 
    - process 

    # Sockets (linux only) 
    #- socket 
    enabled: true 
    period: 10s 
    processes: ['.*'] 
    cpu_ticks : false 



#================================ General ===================================== 

# The name of the shipper that publishes the network data. It can be used to group 
# all the transactions sent by a single shipper in the web interface. 
#name: 

# The tags of the shipper are included in their own field with each 
# transaction published. 
#tags: ["service-X", "web-tier"] 

# Optional fields that you can specify to add additional information to the 
# output. 
#fields: 
# env: staging 

#================================ Outputs ===================================== 

# Configure what outputs to use when sending the data collected by the beat. 
# Multiple outputs may be used. 

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

    # Optional protocol and basic auth credentials. 
    #protocol: "https" 
    #username: "elastic" 
    #password: "changeme" 

#----------------------------- Logstash output -------------------------------- 
#output.logstash: 
    # The Logstash hosts 
    hosts: ["127.0.0.1:5044"] 

    # Optional SSL. By default is off. 
    # List of root certificates for HTTPS server verifications 
    ssl.certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"] 

    # Certificate for SSL client authentication 
    #ssl.certificate: "/etc/pki/client/cert.pem" 

    # Client Certificate Key 
    #ssl.key: "/etc/pki/client/cert.key" 

#================================ Logging ===================================== 

# Sets log level. The default log level is info. 
# Available log levels are: critical, error, warning, info, debug 
logging.level: debug 

logstash.conf

input { 
     beats { 
     port => 5044 
     ssl => true 
     ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt" 
     ssl_key => "/etc/pki/tls/private/logstash-forwarder.key" 
     } 
    } 




output { 
     elasticsearch { 
     hosts => ["localhost:9200"] 
     sniffing => true 
     manage_template => false 
     index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}" 
     document_type => "%{[@metadata][type]}" 
     } 
    } 

我正在metricbeat服務,但在Kibana不能得到指數(本地主機:5601) 。有什麼問題,我找不出來? 謝謝。

回答

1

看起來您正在嘗試使用metricbeat的elasticsearch輸出將數據發送到您的logstash。

事實上,在你的metricbeat.yml你有這行註釋掉:

output.elasticsearch: 

,這一次說:

#output.logstash: 

如果您在切換兩行的註釋它可以工作。