Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 85 additions & 77 deletions installation/macos.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# macOS

Fluent Bit is compatible with latest Apple macOS system on x86_64 and Apple Silicon architectures.
Fluent Bit is compatible with latest Apple macOS software for x86_64 and
Apple Silicon architectures.

## Installation Packages
## Installation packages

The packages can be found here: <https://packages.fluentbit.io/macos/>
Installation packages can be found [here](https://packages.fluentbit.io/macos/).

## Requirements

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:
You must have [Homebrew](https://brew.sh/) installed in your system.
If it isn't present, install it with the following command:

```bash
```bash copy
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

## Installing from Homebrew

The Fluent Bit package on Homebrew is not officially supported, but should work for basic use cases and testing. It can be installed using:
The Fluent Bit package on Homebrew isn't officially supported, but should work for
basic use cases and testing. It can be installed using:

```bash
```bash copy
brew install fluent-bit
```

## Compile from Source
## Compile from source

### Install build dependencies

Expand All @@ -33,97 +35,101 @@ Run the following brew command in your terminal to retrieve the dependencies:
brew install git cmake openssl bison
```

## Get the source and build it
## Download and build the source

Grab a fresh copy of the Fluent Bit source code (upstream):
1. Download a copy of the Fluent Bit source code (upstream):

```bash
git clone https://github.com/fluent/fluent-bit
cd fluent-bit
```
```bash
git clone https://github.com/fluent/fluent-bit
cd fluent-bit
```

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:
If you want to use a specific version, checkout to the proper tag.
For example, to use `v1.8.13`, use the command:

```bash
git checkout v1.8.13
```
```bash copy
git checkout v1.8.13
```

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:
1. To prepare the build system, you must expose certain environment variables so
Fluent Bit CMake build rules can pick the right libraries:

```bash
export OPENSSL_ROOT_DIR=`brew --prefix openssl`
export PATH=`brew --prefix bison`/bin:$PATH
```
```bash copy
export OPENSSL_ROOT_DIR=`brew --prefix openssl`
export PATH=`brew --prefix bison`/bin:$PATH
```

Change to the _build/_ directory inside the Fluent Bit sources:
1. Change to the `build/` directory inside the Fluent Bit sources:

```bash
cd build/
```
```bash
cd build/
```

Build Fluent Bit.
Note that we are indicating to the build system "where" the final binaries and config files should be installed:
1. Build Fluent Bit. This example indicates to the build system the location
the final binaries and `config` files should be installed:

```bash
cmake -DFLB_DEV=on -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit ../
make -j 16
```
```bash
cmake -DFLB_DEV=on -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit ../
make -j 16
```

Install Fluent Bit to the directory specified above.
Note that this requires root privileges due to the directory we will write information to:
1. Install Fluent Bit to the directory specified previously.
Writing to this directory requires root privileges.

```bash
sudo make install
```
```bash
sudo make install
```

The binaries and configuration examples can be located at `/opt/fluent-bit/`.

## Create macOS installer from source

Grab a fresh copy of the Fluent Bit source code (upstream):
1. Clone the Fluent Bit source code (upstream):

```bash
git clone https://github.com/fluent/fluent-bit
cd fluent-bit
```
```bash
git clone https://github.com/fluent/fluent-bit
cd fluent-bit
```

Optionally, if you want to use a specific version, just checkout to the proper tag. If you want to use `v1.9.2` just do:
If you want to use a specific version, checkout to the proper tag. For example,
to use `v1.9.2` do:

```bash
git checkout v1.9.2
```
```bash
git checkout v1.9.2
```

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:
1. To prepare the build system, you must expose certain environment variables so
Fluent Bit CMake build rules can pick the right libraries:

```bash
export OPENSSL_ROOT_DIR=`brew --prefix openssl`
export PATH=`brew --prefix bison`/bin:$PATH
```
```bash copy
export OPENSSL_ROOT_DIR=`brew --prefix openssl`
export PATH=`brew --prefix bison`/bin:$PATH
```

And then, creating the specific macOS SDK target (For example, specifying macOS Big Sur (11.3) SDK environment):
1. Create the specific macOS SDK target. For example, to specify macOS Big Sur
(11.3) SDK environment):

```bash
export MACOSX_DEPLOYMENT_TARGET=11.3
```
```bash copy
export MACOSX_DEPLOYMENT_TARGET=11.3
```

Change to the _build/_ directory inside the Fluent Bit sources:
1. Change to the `build/` directory inside the Fluent Bit sources:

```bash
cd build/
```
```bash copy
cd build/
```

Build the Fluent Bit macOS installer.
1. Build the Fluent Bit macOS installer.

```bash
cmake -DCPACK_GENERATOR=productbuild -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit ../
make -j 16
cpack -G productbuild
```
```bash copy
cmake -DCPACK_GENERATOR=productbuild -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit ../
make -j 16
cpack -G productbuild
```

Then, macOS installer will be generated as:
The macOS installer will be generated as:

```log
```text
CPack: Create package using productbuild
CPack: Install projects
CPack: - Run preinstall target for: fluent-bit
Expand All @@ -140,27 +146,29 @@ CPack: - Building component package: /Users/fluent-bit-builder/GitHub/fluent-b
CPack: - package: /Users/fluent-bit-builder/GitHub/fluent-bit/build/fluent-bit-1.9.2-apple.pkg generated.
```

Finally, fluent-bit-`<fluent-bit version>`-`(intel or apple)`.pkg will be generated.
Finally, the `fluent-bit-<fluent-bit version>-(intel or apple)`.pkg will be generated.

The created installer will put binaries at `/opt/fluent-bit/`.

## Running Fluent Bit

To make the access path easier to Fluent Bit binary, in your terminal extend the `PATH` variable:
To make the access path easier to Fluent Bit binary, extend the `PATH` variable:

```bash
```bash copy
export PATH=/opt/fluent-bit/bin:$PATH
```

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:
To test, try Fluent Bit by generating a test message using the
[Dummy input plugin](https://docs.fluentbit.io/manual/pipeline/inputs/dummy)
which prints to the standard output interface every 1 second:

```bash
fluent-bit -i dummy -o stdout -f 1
```bash copy
fluent-bit -i dummy -o stdout -f 1
```

You will see an output similar to this:

```bash
```text
Fluent Bit v1.9.0
* Copyright (C) 2015-2021 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
Expand Down
Loading