kibana使用metricbeat性能监控
admin
2023-03-02 14:41:03
0
安装下载
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install metricbeat
配置启动
 cat /etc/metricbeat/metricbeat.yml |grep -vE "^#|^$"
      metricbeat.config.modules:
     # Glob pattern for configuration loading
     path: ${path.config}/modules.d/*.yml
     # Set to true to enable config reloading
     reload.enabled: false
     # Period on which files under path should be checked for changes
     #reload.period: 10s
   setup.template.settings:
     index.number_of_shards: 1
     index.codec: best_compression
     #_source.enabled: false
   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: "192.168.1.43:5601"
     # Kibana Space ID
     # ID of the Kibana Space into which the dashboards should be loaded. By default,
     # the Default Space will be used.
     #space.id:
   output.elasticsearch:
     # Array of hosts to connect to.
     hosts: ["192.168.1.43:9200"]
     # Enabled ilm (beta) to use index lifecycle management instead daily indices.
     #ilm.enabled: false
     # Optional protocol and basic auth credentials.
     #protocol: "https"
     #username: "elastic"
     #password: "changeme"
     # The Logstash hosts
     #hosts: ["localhost: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"
   processors:
     - add_host_metadata: ~
     - add_cloud_metadata: ~
启动和启动
update-rc.d metricbeat defaults 95 10
/etc/init.d/metricbeat restart   #重新启动
metricbeat setup --dashboards  #启动dashboards
查看kibana的dashboards

kibana使用metricbeat性能监控

启动监控服务模块(nginx,redis,mysql)
metricbeat  modules enable redis
metricbeat  modules enable mysql
metricbeat  modules enable nginx
查看服务性能监控

kibana使用metricbeat性能监控
kibana使用metricbeat性能监控

查看启动模块
 metricbeat modules list
     #Enabled模块为启用模块 Disabled模块为未启用模块
.

kibana使用metricbeat性能监控

启动新模块
启用新模块命令,例如启用nginx模块
metricbeat modules enable nginx
设置监控nginx
root@debian43:/etc/metricbeat/modules.d# cat nginx.yml 
# Module: nginx
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.8/metricbeat-module-nginx.html
- module: nginx
  metricsets:
    - stubstatus
  enabled: true
  period: 10s
  # Nginx hosts
  hosts: ["http://127.0.0.1"]
  # Path to server status. Default server-status
  server_status_path: "nginx_status"
  #username: "user"
  #password: "secret"
nginx设置
     server {
   server_name _;
   location /nginx_status {
       stub_status on;
       access_log off;
      allow 127.0.0.1;
      deny all;
      }
  }

kibana使用metricbeat性能监控

设置监控mysql
root@debian43:/etc/metricbeat/modules.d# cat mysql.yml 
# Module: mysql
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.8/metricbeat-module-mysql.html

- module: mysql
  metricsets:
    - status
  #  - galera_status
  period: 10s

  # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"
  # The username and password can either be set in the DSN or using the username
  # and password config options. Those specified in the DSN take precedence.
  hosts: ["tcp(192.168.1.39:3306)/"]

  # Username of hosts. Empty by default.
  username: root

  # Password of hosts. Empty by default.
  password: 123456
#- module: 45-mysql
#  metricsets:
#    - status
#  period: 10s
#  hosts: ["tcp(192.168.1.45:3306)/"]
#  username: ops
#  password: ops12300.

kibana使用metricbeat性能监控

设置监控redis
   - module: redis
     hosts: ["192.168.1.43:6379"]
     metricsets: ["info","keyspace"]
     enables: true
     period: 10s
     password: password

相关内容

热门资讯

榴莲遭“仅退款”,商家花500... 极目新闻记者 王鹏2026年5月7日,河南濮阳一冷冻榴莲果肉商家反映,自己遭遇山东德州买家恶意“仅退...
4只皮皮虾1035元店主事发次... 近日,有网友反映其5月4日在三亚一家海鲜店宵夜时仅4只皮皮虾就花费1035元,价格过高,质疑店家存在...
分析师称《GTA6》发售主机或... IT之家 5 月 8 日消息,据游戏媒体 Insider Gaming 昨天报道,Circana 分...
利拓光电取得高稳定性激光器封装... 国家知识产权局信息显示,深圳市利拓光电有限公司取得一项名为“一种高稳定性激光器的封装结构”的专利,授...
别被“120W闪充”骗了:央视... 【太平洋科技快讯】央视新闻近期调查发现,市面上大量标称120W、66W的快充头存在严重功率虚标问题,...
古巴政府:美国新一轮制裁措施是... 新华社哈瓦那5月7日电 古巴外交部7日发布公告说,美国对古巴新一轮制裁措施是“经济侵略”行为,企图制...
邮轮暴发汉坦病毒疫情,世卫确认... 据凤凰卫视报道,大西洋邮轮“洪迪厄斯”号暴发汉坦病毒疫情,世界卫生组识5月7日证实,船上共有5宗确诊...
内蒙古赤峰两村半个多世纪的土地... 澎湃新闻记者 王选辉争议土地大北叉沟。本文图均为 受访者 提供备受社会关注的“赤峰两村半个多世纪的土...
冥王星5月8日开启逆行 持续约... 被“逐出”太阳系大行星序列的冥王星5月8日将结束顺行,开启为期约5个月的逆行。这也是2026年冥王星...
夸大AI功能被起诉 苹果2.5... 当地时间5月5日,因夸大AI系统“苹果智能”(Apple Intelligence)的能力,误导数百...