# File/Packet/Metric beat on Raspi Centos 7 (armhf/armv7l)

**URL:** https://discuss.elastic.co/t/file-packet-metric-beat-on-raspi-centos-7-armhf-armv7l/184048
**Category:** Beats
**Created:** [June 3, 2019, 7:54pm UTC](https://discuss.elastic.co/t/file-packet-metric-beat-on-raspi-centos-7-armhf-armv7l/184048 "2019-06-03T19:54:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![davemoore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davemoore/32/134233_2.png) [@davemoore](https://discuss.elastic.co/u/davemoore)
#### Post date: [June 4, 2019, 2:13pm UTC](https://discuss.elastic.co/t/file-packet-metric-beat-on-raspi-centos-7-armhf-armv7l/184048/2 "2019-06-04T14:13:56Z")

</div>

@m.pers

There aren't official builds for Beats on ARM. But you can make them and they will work.

Recently I built **Beats 7.1.0** on **Raspberry Pi 3 B+ Ubuntu 18.04 64-bit ARMv8**. Specifically I built Filebeat, Metricbeat, Auditbeat, and Heartbeat. Of those, I tested (and continue to run) Metricbeat and Auditbeat.

I'll walk through the build process that worked for me. It was a different OS (Ubuntu), a different version of ARM (v8), and I didn't try to build Packetbeat or run Filebeat. I won't try to adapt my steps to a platform that I haven't tested. But I expect this walkthrough will be similar enough that you can adjust the steps as needed, such as using `yum` instead of `apt-get`.

I look forward to hearing if these instructions help you build Beats on CentOS and ARMv7, and if Packetbeat and Filebeat work as expected on that platform.

# Building Beats 7.1.0 on Ubuntu 18.04 (64-bit) ARMv8

Assume you have signed into the terminal as the `ubuntu` user.

## Step 1: Install dependencies

```bash
sudo apt-get update
sudo apt-get install -y gcc git make wget

```

## Step 2: Get Golang for ARM (64-bit)

Download Golang.

```bash
wget https://dl.google.com/go/go1.12.5.linux-arm64.tar.gz
tar -xzf go1.12.5.linux-arm64.tar.gz
mkdir go_projects

```

Export the new environment variables.

```bash
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go_projects
export PATH=$GOPATH/bin:$PATH

```

Persist the new environment variables.

```bash
echo -e "export GOROOT=$HOME/go" | tee -a ~/.profile
echo -e "export PATH=$PATH:$GOROOT/bin" | tee -a ~/.profile
echo -e "export GOPATH=$HOME/go_projects" | tee -a ~/.profile
echo -e "export PATH=$PATH:$GOPATH/bin" | tee -a ~/.profile

```

## Step 3: Get Beats

Get the source code for Beats from the official git repo, and then checkout the commit on which Beats 7.1.0 was built. If you want to build a [specific version](https://www.elastic.co/downloads/past-releases) of Beats, then download the .tar.gz file for one of the Beats, extract it, and view the contents of the `.build_hash` file which shows the commit hash of that build. This build process was tested with the commit hash from [metricbeat-7.1.0-linux-x86\_64.tar.gz](https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.1.0-linux-x86_64.tar.gz) (`03b3db2`).

```bash
go get github.com/elastic/beats
cd $GOPATH/src/github.com/elastic/beats
git fetch
git checkout 03b3db2

```

## Step 4: Build Beats

Temporarily enable swap space. The build process may require more memory than the capacity of the Raspberry Pi.

```bash
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo -e "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
sudo swapon --show

```

Make Metricbeat. An executable file named `metricbeat` will be created in `$GOPATH/src/github.com/elastic/beats`.

```bash
cd $GOPATH/src/github.com/elastic/beats/metricbeat
GOOS=linux GOARCH=arm64 go get
make

```

Make Auditbeat. An executable file named `auditbeat` will be created in `$GOPATH/src/github.com/elastic/beats`.

```bash
cd $GOPATH/src/github.com/elastic/beats/auditbeat
GOOS=linux GOARCH=arm64 go get
make

```

Make Filebeat. An executable file named `filebeat` will be created in `$GOPATH/src/github.com/elastic/beats`.

```bash
cd $GOPATH/src/github.com/elastic/beats/filebeat
GOOS=linux GOARCH=arm64 go get
make

```

Make Heartbeat. An executable file named `heartbeat` will be created in `$GOPATH/src/github.com/elastic/beats`.

```bash
cd $GOPATH/src/github.com/elastic/beats/heartbeat
GOOS=linux GOARCH=arm64 go get
make

```

Disable swap when done.

```bash
sudo swapoff -v /swapfile
# Remove the line below from /etc/fstab:
# /swapfile swap swap defaults 0 0
sudo rm /swapfile

```

## Step 5: Organize Beats

Move each Beat to its own subdirectory under a single `~/beats` directory.

```bash
cd ~
mkdir beats
cp -R $GOPATH/src/github.com/elastic/beats/auditbeat ~/beats/auditbeat
cp -R $GOPATH/src/github.com/elastic/beats/filebeat ~/beats/filebeat
cp -R $GOPATH/src/github.com/elastic/beats/heartbeat ~/beats/heartbeat
cp -R $GOPATH/src/github.com/elastic/beats/metricbeat ~/beats/metricbeat
cp $GOPATH/bin/auditbeat ~/beats/auditbeat
cp $GOPATH/bin/filebeat ~/beats/filebeat
cp $GOPATH/bin/heartbeat ~/beats/heartbeat
cp $GOPATH/bin/metricbeat ~/beats/metricbeat

```

Adjust the permissions and ownership for each Beat.

```bash
chmod go-w ~/beats/auditbeat/auditbeat.yml
chmod go-w ~/beats/filebeat/filebeat.yml
chmod go-w -R ~/beats/filebeat/modules.d
chmod go-w ~/beats/heartbeat/heartbeat.yml
chmod go-w ~/beats/metricbeat/metricbeat.yml
chmod go-w -R ~/beats/metricbeat/modules.d
sudo chown root:root ~/beats/auditbeat/auditbeat.yml

```

## Step 6: Configure Beats

Configure each `.yml` file as you normally would.

## Step 7: Setup Index Templates

Before running Beats for the first time, you should [run the setup script](https://www.elastic.co/guide/en/beats/metricbeat/7.1/metricbeat-template.html) to create the index templates and dashboards.

Our build process didn't package those index templates or dashboards. If you want to use this build to run the setup script, then [download the official .tar.gz](https://www.elastic.co/downloads/past-releases) of each Beat and then copy its `kibana` directory into the right subdirectory of your `~/beats` directory. After you do that, you can run commands such as `./metricbeat setup`.

## Step 8. Run Beats

We didn't build a convenient service script. But we can run Beats in the background using `nohup`.

For example, here's how to run Metricbeat in the background:

```bash
cd $HOME/beats/metricbeat && nohup ./metricbeat -e

```

## Step 9. Start Beats on boot

You can schedule the command from Step 8 to run on boot using the crontab for the `ubuntu` user.

For example, here's how to schedule Metricbeat to run on boot:

```bash
(sudo crontab -u ubuntu -l; echo "@reboot . $HOME/.profile && cd $HOME/beats/metricbeat && nohup ./metricbeat -e &" ) | sudo crontab -u ubuntu -

```

Any Beats that must run as root, such as Auditbeat, need to be added to the crontab of the `root` user.

## Proof

Here's an Elasticsearch cluster on six nodes of Raspberry Pi 3 B+ with each node running Metricbeat.

_Cluster running over two availability zones:_

 ![cluster-infinity](https://us1.discourse-cdn.com/elastic/original/3X/5/3/5312598e9c725f9d7cef64dce620ae415fa75960.jpeg)

_Metricbeat system overview dashboard:_

 ![cluster-infinity-metricbeat](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5b8b30af65cfccefe4fc46995d47b0b5cd27ce5.png)

_Beats monitoring overview:_

 ![beats-monitoring-overview](https://us1.discourse-cdn.com/elastic/original/3X/5/9/59df6eb06eac64d4f5f68bb3b04e3f71e3585ac1.png)

_Beats monitoring for one Beat:_

 ![beats-monitoring-single](https://us1.discourse-cdn.com/elastic/original/3X/5/4/54ad2724c0d63142e97dfdc9d0d98d74a8470690.png)

---

_[View the full topic](https://discuss.elastic.co/t/file-packet-metric-beat-on-raspi-centos-7-armhf-armv7l/184048)._
