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

相关内容

热门资讯

重磅消息“新海贝之城拼三张.真... 重磅消息“新海贝之城拼三张.真的有挂吗?”必胜开挂神器您好,新海贝之城拼三张这个游戏其实有挂的,确实...
玩家最新攻略“新华棋牌.到底是... 有 亲,根据资深记者爆料新华棋牌是可以开挂的,确实有挂(咨询软件无需打开...
今日重磅消息“神赚棋牌.真的有... 家人们!今天小编来为大家解答神赚棋牌透视挂怎么安装这个问题咨询软件客服徽9752949的挂在哪里买很...
我来教教您“杭州麻将.到底有挂... 家人们!今天小编来为大家解答杭州麻将透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪里买很...
最新引进“摇钱树拼三张.究竟有... 最新引进“摇钱树拼三张.究竟有挂吗?”外卦神器下载您好,摇钱树拼三张这个游戏其实有挂的,确实是有挂的...
今日重大通报“同城乐吧.有没有... 网上科普关于“同城乐吧有没有挂”话题很是火热,小编也是针对同城乐吧作*弊开挂的方法以及开挂对应的知识...
终于明白“,17麻将.开挂神器... 家人们!今天小编来为大家解答,17麻将透视挂怎么安装这个问题咨询软件客服徽4282891的挂在哪里买...
今日重磅消息“神殿娱乐.开挂器... 今日重磅消息“神殿娱乐.开挂器?”详细开挂教程您好,神殿娱乐这个游戏其实有挂的,确实是有挂的,需要了...
今日重大通报“新畅游互娱.到底... 家人们!今天小编来为大家解答新畅游互娱透视挂怎么安装这个问题咨询软件客服徽9752949的挂在哪里买...
终于明白“熊猫牛牛.究竟有挂吗... 您好:熊猫牛牛这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款游戏...