|
| 1 | +# macOS |
| 2 | + |
| 3 | +Fluent Bit is compatible with latest Apple macOS system on x86_64 and Apple Silicon M1 architectures. At the moment there is no official supported package but you can build it from sources by following the instructions below. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +For the next steps, you will need to have [Homebrew](https://brew.sh/) installed in your system, if is not there, you can install it with the following command: |
| 8 | + |
| 9 | +```bash |
| 10 | +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 11 | +``` |
| 12 | + |
| 13 | +### Install build dependencies |
| 14 | + |
| 15 | +Run the following brew command in your terminal to retrieve the dependencies: |
| 16 | + |
| 17 | +```bash |
| 18 | +brew install git cmake openssl bison |
| 19 | +``` |
| 20 | + |
| 21 | +## Get the source and build it |
| 22 | + |
| 23 | +Grab a fresh copy of the Fluent Bit source code (upstream): |
| 24 | + |
| 25 | +```bash |
| 26 | +git clone https://github.com/fluent/fluent-bit |
| 27 | +cd fluent-bit |
| 28 | +``` |
| 29 | + |
| 30 | +Optionally, if you want to use a specific version, just checkout to the proper tag. If you want to use `v1.8.13` just do: |
| 31 | + |
| 32 | +```bash |
| 33 | +git checkout v1.8.13 |
| 34 | +``` |
| 35 | + |
| 36 | +In order to prepare the build system, we need to expose certain environment variables so Fluent Bit CMake build rules can pick the right libraries: |
| 37 | + |
| 38 | +```bash |
| 39 | +export OPENSSL_ROOT_DIR=`brew --prefix openssl` |
| 40 | +export PATH=`brew --prefix bison`/bin:$PATH |
| 41 | +``` |
| 42 | + |
| 43 | +Build Fluent Bit. Note that we are indicating to the build system "where" the final binaries and config files should be installed: |
| 44 | + |
| 45 | +```bash |
| 46 | +cmake -DFLB_DEV=on -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit ../ |
| 47 | +make -j 16 |
| 48 | +``` |
| 49 | + |
| 50 | +Install the data. Note that this requires root privileges due to the directory we will write information to: |
| 51 | + |
| 52 | +```bash |
| 53 | +sudo make install |
| 54 | +``` |
| 55 | + |
| 56 | +The binaries and configuration examples can be located at `/opt/fluent-bit/`. |
| 57 | + |
| 58 | +## Running Fluent Bit |
| 59 | + |
| 60 | +To make the access path easier to Fluent Bit binary, in your terminal extend the `PATH` variable: |
| 61 | + |
| 62 | +```bash |
| 63 | +export PATH=/opt/fluent-bit/bin:$PATH |
| 64 | +``` |
| 65 | + |
| 66 | +Now as a simple test, try Fluent Bit by generating a simple dummy message which will be printed to the standard output interface every 1 second: |
| 67 | + |
| 68 | +```bash |
| 69 | + fluent-bit -i dummy -o stdout -f 1 |
| 70 | +``` |
| 71 | + |
| 72 | +You will see an output similar to this: |
| 73 | + |
| 74 | +```bash |
| 75 | +Fluent Bit v1.9.0 |
| 76 | +* Copyright (C) 2015-2021 The Fluent Bit Authors |
| 77 | +* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd |
| 78 | +* https://fluentbit.io |
| 79 | + |
| 80 | +[2022/02/08 17:13:52] [ info] [engine] started (pid=14160) |
| 81 | +[2022/02/08 17:13:52] [ info] [storage] version=1.1.6, initializing... |
| 82 | +[2022/02/08 17:13:52] [ info] [storage] in-memory |
| 83 | +[2022/02/08 17:13:52] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128 |
| 84 | +[2022/02/08 17:13:52] [ info] [cmetrics] version=0.2.2 |
| 85 | +[2022/02/08 17:13:52] [ info] [sp] stream processor started |
| 86 | +[0] dummy.0: [1644362033.676766000, {"message"=>"dummy"}] |
| 87 | +[0] dummy.0: [1644362034.676914000, {"message"=>"dummy"}] |
| 88 | +``` |
| 89 | + |
| 90 | +To halt the process, press `ctrl-c` in the terminal. |
| 91 | + |
0 commit comments