elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.05k stars 4.89k forks source link

Official ARM builds #9442

Closed markwalkom closed 2 years ago

markwalkom commented 5 years ago

Describe the enhancement: This has been asked on https://discuss.elastic.co a few times, I wanted to raise this here as well. Official ARM builds would be super useful for many different use cases.

Describe a specific use case for the enhancement or feature: I have a bunch of Ubiquiti network gear that all runs ARM, it'd be great to be able to deploy beats on them to easily get stats. There are also vendors, like Scaleways or even now AWS, that offer ARM based servers so being able to deploy there makes sense.

legrego commented 5 years ago

What steps would be required to provide official ARM builds? I'd be happy to support this effort if I can

ghost commented 5 years ago

I need this to monitor all my Raspberry Pi's...

Either that or the correct instructions to cross-compile it myself :)

TIA!

njbmartin commented 5 years ago

Looking through the PRs and snapshots, it looks like the beats are already being built for ARM. However, they are not being published. It's that step which we require in order to use it.

Following these instructions on a Raspberry Pi: https://www.elastic.co/guide/en/beats/metricbeat/current/setup-repositories.html

We get the following message:

$ sudo apt-get update
...
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'https://artifacts.elastic.co/packages/7.x/apt stable InRelease' doesn't support architecture 'armhf'
markwalkom commented 4 years ago

Don't spose this is likely to happen anytime soon? It'd be super handy and awesome :)

josh-thurston commented 4 years ago

I have been reading through all of the various 'How To' guides scattered on the internet. Most are old and have errors when running with newer OS & software versions. I estimate that I have spent 20+ hours trying to get this working for two of my Raspberry Pi's with zero success so far. A lot of folks have spent time figuring this out, posting 'How To' guides, but those guides have short lifespans.

With the popularity of ARM these days, I don't understand why it is even a question for elastic to build, publish, and support.

mikemadden42 commented 4 years ago

@josephgaldino Thanks for reaching out. I am also running into issues building beats on ARM. What specific issues are you running into?

I’ve been doing this on my Raspberry Pi 3 Model B Plus. Unfortunately it only has 1 GB of RAM and runs into out of memory issues during the build.

[2413110.529707] Out of memory: Kill process 9553 (link) score 341 or sacrifice child
[2413110.537889] Killed process 9553 (link) total-vm:380184kB, anon-rss:320568kB, file-rss:0kB, shmem-rss:0kB
[2413110.638338] oom_reaper: reaped process 9553 (link), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

I think it may be more fruitful to cross compile for ARM instead of building on resource contrained devices. Our official builds for beats rely on the following project.

https://github.com/elastic/golang-crossbuild

We only publish artifacts for i386 and x86_64, but I will check if snapshot builds include other architectures like ARM.

Supporting ARM is definitely on our radar. We need to invest some time setting up and testing build and CI services for ARM.

maxviper commented 4 years ago

I managed to create ARM build for filebeat, metricbeat, heartbeat and auditbeat, based on https://github.com/caglar10ur/elk-usg/#build-beats-for-mips64-and-put-them-under-elk-usg however, I'm unable to do this for packetbeat. I already tried the https://github.com/elastic/golang-crossbuild but without any success. I'm not a specialist in this matter and would appreciate being able to download the different ARM and MIPS builds, rather than trying to build them myself. So please public ARM and MIPS build for beats

mikemadden42 commented 4 years ago

I agree that it would be ideal to have beats artifacts available for all our supported platforms. I'll continue this discussion internally to assess its feasibility.

In the meantime, I've had decent success running the following command to build packages for other platforms.

PLATFORMS='+linux/armv7 +linux/arm64 +linux/mips +linux/mips64' make release-manager-release

This will produce packages built for the normal architectures like i386 and x86_64, and it will also build packages for armv7, arm64, mips, and mips64.

All the supported platforms can be found here.

I've verified it produces packages for the following beats. I'm running into build issues for packetbeat, and I have not tried winlogbeat yet.

NOTE: This make target requires a development environment already setup for beats. This includes tools like make, go 1.12.x, mage, python 2.7.x, virtualenv, docker, and docker-compose.

More information about setting up a development environment for beats can be found at: https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html#setting-up-dev-environment

josh-thurston commented 4 years ago

@maxviper I just finished up a script that will run on Raspberry Pi and create filebeat.

https://github.com/josh-thurston/pibeat

Hope it works for you. In the next day or so, i will update to create the rest of the beats packages.

jbagel2 commented 4 years ago

With AWS having launched ARM instance types. I think there will be more and more interest in this. Hoping there may be a status update on this one? We currently just have a jenkins pipeline configured to rebuild each time a new version drops. but us doing that, is no better than you guys doing that for us and just giving it a alpha/beta designation. We are using it anyway...

mvaldes14 commented 4 years ago

Need beats for my IOT devices :+1:

devinbfergy commented 4 years ago

This would be great!

josh-thurston commented 4 years ago

Updated my script. Creating more than just filebeat for arm architecture now.

https://github.com/josh-thurston/easyBEATS

FreerideTheWorld commented 4 years ago

+1 on this topic I'm currently trying to replicate a portable Elasticsearch "work" environment that people could learn on with 5 Raspberry Pi 4b's and one LattePanda with Windows installed. The entire setup can be housed in a C4 labs case and its portability would allow me to teach people with a more hands on and visual experience.

I appreciate those of you who have put the time into creating elasticsearch/beats that run on ARM as much of this is way past my knowledge base. Its taken me quite some time to figure out how to get ES running on Pi and that was only due to the fact that someone had posted a very useful guide in the discussion forums. Even then I had to put a few different guides together, quit trying to install 7.5 and just install 7.2. Kibana I didn't even attempt on Pi due to its potential difficulty and I just installed it on the LattePanda without any problems.

richiejarvis commented 4 years ago

Hi Team,

Is there a way that we can continue the ARM compilation in an Elastic "unsupported" capacity?

My thinking is that if there was public access to the builds and yum/apt/brew repos, but at a "lesser" level than the officially supported Beats (due to the ARM support issue), would that be a possible way forward?

Cheers,

Richie

Diaoul commented 4 years ago

I'm trying to reuse the build targets for ARM compilation. It seems like DEV_OS=linux DEV_ARCH=arm make release does the trick to build everything. However after that it moves on to cross compile for amd64 despite PLATFORMS=linux/armv7. What's the best way to reuse build targets to build for arm only? What will make release produce?

FreerideTheWorld commented 4 years ago

I could see more requests for an ARM build coming in once these start to hit the market. Probably something Elastic should look into before people have to do a significant amount of extra leg work to install Elastic on their new Macs or they just don't do it at all. I understand that this is not what enterprise level people are utilizing or where the money is coming from but for single users that are interested in learning the stack it could impose a huge barrier. "Several’ ARM-based Mac laptops and desktops coming next year, says report" https://www.theverge.com/2020/3/27/21196611/arm-macbook-desktop-apple-2021-release-date

jakommo commented 4 years ago

Arm64/Aarch64 package coming soon https://github.com/elastic/beats/pull/17301 Aarch64 docker images soon after https://github.com/elastic/beats/issues/18334

MohitKS5 commented 3 years ago

@jakommo is there any alpha or beta release yet ?

Arm64/Aarch64 package coming soon #17301 Aarch64 docker images soon after #18334

jakommo commented 3 years ago

@MohitKS5 I'm not a beats developer and I haven't followed this closely in the last two month, but from looking at https://github.com/elastic/beats/pull/17301 it seems like there are already builds available. I just did a test download of https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.8.0-linux-arm64.tar.gz and it seems to be a arm64 executable (haven't tested further though) :

 ~/Downloads/filebeat-7.8.0-linux-arm64  file filebeat     
filebeat: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, Go BuildID=9R8zkx5cV9fd59ta3R8U/W5q6cJDsPT-Svd7K4gSF/tiLD7pymUZ8sSr5SEUkT/5H6ozO6ES8y-3zP86ZIa, BuildID[sha1]=27b0eb4a518068f0e2f859e023fa407c6373b310, stripped

https://github.com/elastic/beats/issues/18334 is labeled with 7.9.0, so I think it needs some more time since we just released 7.8.0

TinaHeiligers commented 3 years ago

I just did a test download of https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.8.0-linux-arm64.tar.gz and it seems to be a arm64 executable (haven't tested further though) Are there any plans for arm32 builds?

hingston commented 3 years ago

I really hope there will be arm32 builds to use with Raspberry Pis! 🤞

jakommo commented 3 years ago

I haven't heard of builds for arm32, but Raspberry Pi's starting from 3 are 64bit capable (actually Rpi 2 rev 1.2) and Raspbian also has a 64bit beta out already.

standa4 commented 3 years ago

I also hope that there will be arm32 builds but not just for Rpi. I would like to run beats (at least filebeat but also packetbeat would be cool) on my openwrt router with 32bit armv7 cpu.

mnorrsken commented 3 years ago

I (finally managed to) build filebeat and metricbeat oss for my different platforms (armhf/armv7 arm64 and amd64). If anyone finds it useful and wants more beats or platforms, just poke me and I'll put some more up until we have official builds.

I tried building packetbeat but I also had issues with cross platform builds. I may try building it native.

https://github.com/mnorrsken/beats

(is this OK i hope? IANAL)

TinaHeiligers commented 3 years ago

I haven't heard of builds for arm32, but Raspberry Pi's starting from 3 are 64bit capable (actually Rpi 2 rev 1.2) and Raspbian also has a 64bit beta out already.

@jakommo do you mean that I could try running a build on my Pi4?

jakommo commented 3 years ago

@jakommo do you mean that I could try running a build on my Pi4?

@TinaHeiligers that should work as well, but what I meant was that you can run an arm64 distro and then use the arm64 builds

avermeer commented 3 years ago

Hi, this issue is flagged 7.9.0, which is released, but still there is no ARM binaries at https://www.elastic.co/fr/downloads/beats/filebeat

Am I missing something?

ThisIsQasim commented 3 years ago

Looks like the .deb and .rpm packages for arm64 are officially available now. For someone looking to build for 32-bit ARM (armhf or armel) using their host machine, you can cross compile a .deb package using my script

ThisIsQasim commented 3 years ago

Hi, this issue is flagged 7.9.0, which is released, but still there is no ARM binaries at https://www.elastic.co/fr/downloads/beats/filebeat

Am I missing something?

Just replace the amd64 in the download url with arm64. E.g.

https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-arm64.deb

instead of https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-amd64.deb

avermeer commented 3 years ago

Thanks @ThisIsQasim , the ARM Debian can indeed be downloaded using your UR.

But unfortunately, my need is for CentOS and https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-arm64.rpm is not working : what is the URL for ARM 64 RPMs ?

ThisIsQasim commented 3 years ago

@avermeer the architecture name is different on RHEL/CentOS. Try https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-aarch64.rpm

avermeer commented 3 years ago

@ThisIsQasim excellent, I was able to download ARM 64 RPMs for filebeat, thank you very much!

Maybe a stupid question: is it intentional that official filebeat download page https://www.elastic.co/fr/downloads/beats/filebeat does not refers to ARM binaries ?

ThisIsQasim commented 3 years ago

@avermeer who knows! I don’t work for elastic.co so I can’t speak for their decisions

markwalkom commented 3 years ago

Can we get builds of the new elastic-agent for ARM as well please :)

holygrolli commented 3 years ago

PLATFORMS='+linux/armv7 +linux/arm64 +linux/mips +linux/mips64' make release-manager-release

For me this still only builds an amd64 build. I'm inside a docker golang environment on amd64 running a build for v7.10.1 @mikemadden42 Do you have a hint why this does not work on my end?

Update: Reading further on the link provided by @maxviper i was able to crossbuild on my amd64. for example inside metricbeat source folder: GOOS=linux GOARCH=arm GOARM=7 go build -o ~/metricbeat I have a working metricbeat setup for my raspi3

pjmorr commented 3 years ago

Hi, this issue is flagged 7.9.0, which is released, but still there is no ARM binaries at https://www.elastic.co/fr/downloads/beats/filebeat Am I missing something?

Just replace the amd64 in the download url with arm64. E.g.

https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-arm64.deb

instead of https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.0-amd64.deb

This has been working for me as well on UniFi Dream Machine Pro. I just have to learn where to look for logs on that platform. Perhaps they will include the link once they have documentation for that platform? who knows. But God bless whomever was involved in the CI/CD process to spit out an arm build.

lazywebm commented 3 years ago

For everyone who might be looking to keep filebeat up to date on armhf Raspbian, I wrote a small script [1] which creates a deployable armhf .deb file from the latest arm64 filebeat release. It doesn't need user input, and I was able to successfully deploy the resulting filebeat-release-armhf.deb on my RPis. The script itself has been tested on current Ubuntu / Debian amd64 systems. More verbosity on my blog page [2].

[1] https://gist.github.com/lazywebm/63ce309cffe6483bb5fc2d8a9e7cf50b [2] https://jschumacher.info/2021/03/up-to-date-filebeat-for-32bit-raspbian-armhf/

EricDavisX commented 3 years ago

the Elastic team keeps working on Linux and macOS ARM64 support - see the download site, per beat for more info: https://www.elastic.co/downloads/beats/filebeat

jlind23 commented 2 years ago

ping @nimarezainia should we move forward here?

michaelschem commented 2 years ago

@lazywebm thanks for your script! It worked for me on STLinux on the STM32MP1

jlind23 commented 2 years ago

Closing it as it is already supported.

michaelschem commented 2 years ago

@jlind23 it's supported as in the builds are available? Where so?

nimarezainia commented 2 years ago

@michaelschem you can find all the images here: https://www.elastic.co/downloads/ let us know if something is missing

michaelschem commented 2 years ago

@nimarezainia doesn't seem to be a build for filebeat in arm https://www.elastic.co/downloads/beats/filebeat

markwalkom commented 2 years ago

You want the aarch64 builds, that is arm.

On Sat, 29 Jan 2022 at 14:51, Mike Schem @.***> wrote:

@nimarezainia https://github.com/nimarezainia doesn't seem to be a build for filebeat in arm https://www.elastic.co/downloads/beats/filebeat

— Reply to this email directly, view it on GitHub https://github.com/elastic/beats/issues/9442#issuecomment-1024825411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYJQTRHDH5IYWNSJUYGPZ3UYNP3VANCNFSM4GJEWZDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

lazywebm commented 2 years ago

Yeah, this is about 32bit armhf packages, to be used for Raspbian and other 32bit ARM operating systems.

mnorrsken commented 2 years ago

I would say filebeat is the most lightweight log shipper for arm platforms, so it's strange that there is not even a "semi official" build, considering how easy it is to include in the build process. I use it (a custom built armv7 version) very successfully for a bunch of raspberry pi:s, other SBCs and even some "proprietary" routers and NAS platforms. I do understand that there's "no money" in it, however it would be a very minor effort to enable it in the automated build process.

vrince commented 2 years ago

Was tired to run after the last version of beats compiled for beat for 32 bits armv6 / v7 so I automated it with GitHub actions. Pre-built packages can be found in release section. I hope it helps.

https://github.com/vrince/arm-beats

Note : Building on buster for now, should works on bullseye out of the box, if necessary os can be added in the build matrix.

vielfarbig commented 2 years ago

It would be great if there will be more official ARM builds (for me esp. armv7).

For now, I also tried to compile it myself, but no instructions worked as it is out-of-the-box. I think vrince releases will work as expected, but I wanted an easy solution to follow and self-compile while there are no official binaries.

So I fixed beats4pi in https://github.com/vielfarbig/beats4pi with the help of https://gist.github.com/joariasl/153a1d5253dc938429e2e5936339959a but without mage, because it not works reliably with docker.