Metricbeat组件安装部署教程

下载安装

tar -zxvf metricbeat-6.5.1-linux-x86_64.tar
配置 metricbeat.yml , 样例如下:

########################## Metricbeat Configuration ###########################
metricbeat.config.modules:
path: ${path.config}/conf.d/*.yml
reload.period: 10s
reload.enabled: true
metricbeat.max_start_delay: 10s

#========================== Modules configuration ============================
metricbeat.modules:
#------------------------------- System Module -------------------------------
- module: system
metricsets:
- cpu # CPU usage
- load # CPU load averages
- memory # Memory usage
- network # Network IO
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
#- fsstat # File system summary metrics
#- raid # Raid
#- socket # Sockets and connection info (linux only)
enabled: true
period: 5s
processes: ['.*']
# Configure the metric types that are included by these metricsets.
cpu.metrics: ["percentages"] # The other available options are normalized_percentages and ticks.
core.metrics: ["percentages"] # The other available option is ticks.
#---------------------------- Elasticsearch Module ---------------------------
- module: elasticsearch
metricsets:
- node
- node_stats
#- index
#- index_recovery
#- index_summary
#- shard
#- ml_job
period: 10s
hosts: ["172.18.96.32:9200"]
#username: "elastic"
#password: "changeme"
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
# Set to false to fetch all entries
#index_recovery.active_only: true
#------------------------------- Kibana Module -------------------------------
- module: kibana
metricsets: ["status"]
period: 10s
hosts: ["172.18.96.32:8888"]
basepath: ""
enabled: true
#------------------------------ Logstash Module ------------------------------
- module: logstash
metricsets: ["node", "node_stats"]
enabled: true
period: 10s
hosts: ["172.18.96.32:9600"]
#-------------------------------- Redis Module -------------------------------
- module: redis
metricsets: ["info", "keyspace"]
enabled: true
period: 10s
hosts: ["106.15.102.235:8888"]
#================================ Outputs ======================================
#------------------------------- Redis output ----------------------------------
output.redis:
enabled: true
hosts: ["106.15.102.235"]
port: 8888
key: "metricbeat_log_key"
db: 0
datatype: list

setup.dashboards.enabled: true

启动metricbeat

./metricbeat -e -c metricbeat.yml -d "publish"
./metricbeat -c /home/elk/config/demo.yml > metricbeat.log &  – 后台启动

在这里插入图片描述

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
要在Docker中安装Metricbeat,可以按照以下步骤进行操作: 1. 首先,确保您已经安装了Docker。如果尚未安装,请根据您的操作系统进行安装。 2. 创建一个新的文件夹来存放Metricbeat的配置文件和数据。在命令行中运行以下命令: ```shell mkdir metricbeat cd metricbeat ``` 3. 创建一个名为`docker-compose.yml`的文件,并使用文本编辑器打开它: ```shell touch docker-compose.yml nano docker-compose.yml ``` 4. 在`docker-compose.yml`文件中添加以下内容: ```yaml version: '2' services: metricbeat: container_name: metricbeat image: docker.elastic.co/beats/metricbeat:7.15.0 volumes: - /var/run/docker.sock:/var/run/docker.sock - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro - ./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml command: - -E setup.kibana.host=kibana:5601 restart: always ``` 在上述配置中,我们使用了Metricbeat 7.15.0版本的Docker镜像,并将它命名为`metricbeat`。 5. 创建一个名为`metricbeat.yml`的文件,并使用文本编辑器打开它: ```shell touch metricbeat.yml nano metricbeat.yml ``` 6. 在`metricbeat.yml`文件中添加以下内容: ```yaml metricbeat.modules: - module: docker metricsets: ["container"] hosts: ["unix:///var/run/docker.sock"] enabled: true period: 10s tags: ["docker"] output.elasticsearch: hosts: ["your-elasticsearch-host:9200"] setup.ilm.enabled: false setup.kibana: host: "your-kibana-host:5601" ``` 在上述配置中,将`your-elasticsearch-host`和`your-kibana-host`替换为您的Elasticsearch和Kibana主机的地址。 7. 运行以下命令启动Metricbeat容器: ```shell docker-compose up -d ``` Metricbeat将开始收集来自Docker容器的指标数据,并将其发送到Elasticsearch和Kibana。 现在,您已经成功在Docker中安装Metricbeat

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值