---
title: 编译和安装
description: "1. 使用PuTTY工具，以root用户登录服务器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/centos_kunpeng_filebeat_792_02_0006.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/centos_kunpeng_filebeat_792_02_0006.html
indexId: 5dd0e3cb8055743e18c488c94afd447f6c120f8102583841e726428c7c5dfd9e82
---
# 编译和安装

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令进入源码包存放的目录。

```
cd
/path/to
```


3. 执行以下命令解压压缩包。

```
tar -xf v7.9.2.tar.gz
```


4. 执行以下命令进入Filebeat源码文件夹。

```
cd beats-7.9.2/filebeat
make
```


  生成filebeat可执行文件。

5. 执行以下命令修改filebeat.yml文件。

```
vi filebeat.yml
```


  需要修改的内容如下。

```
- type: log
# Change to true to enable this input configuration.
enabled: true
setup.kibana:
host: "127.0.0.1:5601"
output.elasticsearch:
hosts: ["127.0.0.1:9200","127.0.0.1:9201","127.0.0.1:9202"]
```

kibana和elasticsearch的地址以实际为准。
