Windows环境下配置heartbeat

windows环境


Heartbeat Doc: https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-installation.html


1.安装并配置Heartbeat运行环境 

下载windows版本的Heartbeat

https://www.elastic.co/products/beats

解压Heartbeat zip包

移动到Heartbeat目录

管理员权限运行PowerShell

执行install脚本:   .\install-service-heartbeat.ps1

执行策略出错时更改执行策略:set-executionpolicy remotesigned

脚本执行结果:

 


 2.配置Heartbeat.yml

监听的端口   数据传输类型   请求间隔

############################# Heartbeat ######################################

# Configure monitors
heartbeat.monitors:
- type: http

  # List or urls to query
  urls: ["http://*.*.*.*:9200"]

  # Configure task schedule
  schedule: '@every 10s'
  
- type: tcp
  urls: ["http://*.*.*.*:5044"]  
  schedule: '@every 10s'

  # Total test connection and data exchange timeout
  #timeout: 16s

配置Kibana

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "*.*.*.*:5601"

配置Message的输出

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

# Configure what output to use when sending the data collected by the beat.

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

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

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

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

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

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


3.运行Heartbeat

.\heartbeat.exe

作为windows服务启动: Start-Service packetbeat 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值