ARM64/aarch64 suppport (Debian Linux) for filebeat, metricbeat

I have been using rsyslogd as the log forwarder, but I would prefer to use filebeat (and metricbeat). However, arm64/aarch64 is not being built as a standard platform. I installed go, and downloaded v7.6 of beats, but I'm running into compile issues. I suspect these are some sort of settings or environment variables. The error is shown below:

sst@sstgateway:~/go/src/github.com/elastic/beats/filebeat$ make filebeat
go build -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=2020-04-09T23:23:18Z -X github.com/elastic/beats/libbeat/version.commit=d57bcf8684602e15000d65b75afcd110e2b12b59"

github.com/elastic/beats/libbeat/common/file

../libbeat/common/file/helper_other.go:28:6: SafeFileRotate redeclared in this block
previous declaration at ../libbeat/common/file/helper_aix.go:26:44
make: *** [../libbeat/scripts/Makefile:122: filebeat] Error 2

It appears to be trying to compile two mutually exclusive files for different operating systems (AIX and Linux). I have gone through the GO environment variables, and they should be correct, but clearly something is amiss. Any help would be gratefully appreciated. I am building this on the target machine.

Thanks

Hey @siva-eh, welcome to discuss!

I wonder why both helper_other.go and helper_aix.go are being compiled, only one of them should be compiled, what version of go are you using?

In any case I would recommend you to build the packages on your workstation using beats scripts. They use docker with the same parameters and go versions as the distributed binaries.
For example you can build Filebeat for arm64 using mage, running the following command from x-pack/filebeat:

PLATFORMS='+all linux/arm64' mage package

When this command finishes, you will find the packages in the build/distributions directory.

You can find more information about this topic in the following threads:

I originally installed Go version 1.14.2 (which appears to be the latest stable version) for Linux.

At your suggestion, I installed Go on my Mac (same version, different installer). After numerous attempts to get the right directory structure for the source, aligned with the $GOPATH, I was able successfully 'make filebeat'. I then used your suggestion above. I had to install mage. Now I get these errors:

MacBook-Pro:filebeat siva$ PLATFORMS='+all linux/arm64' mage package
2020/04/10 16:33:17 Found Elastic Beats dir at /Users/siva/SecureStream/Go/src/github.com/elastic/beats
No fields files for module azureeventhub
No fields files for module googlepubsub
No fields files for module httpjson
Generated fields.yml for filebeat to /Users/siva/SecureStream/Go/src/github.com/elastic/beats/x-pack/filebeat/fields.yml

Building filebeat.yml for linux/amd64
Building filebeat.reference.yml for linux/amd64
Building filebeat.docker.yml for linux/amd64
2020/04/10 16:33:21 Found Elastic Beats dir at /Users/siva/SecureStream/Go/src/github.com/elastic/beats
package ran for 4.531542443s
Error: docker is not available: failed to run "docker info -f {{ json .}}: exec: "docker": executable file not found in $PATH"
docker is not available: failed to run "docker info -f {{ json .}}: exec: "docker": executable file not found in $PATH"

It appears that I might need to install docker - correct? It's unclear to me both how and why this is needed, since I was not planning to use docker on the target machine.

Thanks again for continued assistance. Great progress with your help so far.

Docker is only needed for mage package, on the build machine, this is not needed in the target machine.

Unfortunately, there is no build/distributions directory,and thus no result. Am I looking in the wrong place, or is this error causing the build to fail?
Thanks again

NM - I installed Docker on the Mac, and voilà - distributions are built. On to installing and testing. Many thanks!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.