Skip to content

Commit 8353f70

Browse files
Merge pull request #1925 from fluent/alexakreizinger/sc-141836/fix-commands-in-windows-install-doc-for-fluent
2 parents 82ed1e2 + 118e175 commit 8353f70

File tree

1 file changed

+46
-58
lines changed

1 file changed

+46
-58
lines changed

installation/windows.md

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ MSI installers are also available:
109109

110110
To check the integrity, use the `Get-FileHash` cmdlet for PowerShell.
111111

112-
```text copy
113-
PS> Get-FileHash fluent-bit-4.0.4-win32.exe
112+
```shell copy
113+
Get-FileHash fluent-bit-4.0.4-win32.exe
114114
```
115115

116116
## Installing from a ZIP archive
@@ -121,8 +121,8 @@ PS> Get-FileHash fluent-bit-4.0.4-win32.exe
121121
1. Expand the ZIP archive. You can do this by clicking **Extract All** in Explorer
122122
or `Expand-Archive` in PowerShell.
123123

124-
```text
125-
PS> Expand-Archive fluent-bit-4.0.4-win64.zip
124+
```shell
125+
Expand-Archive fluent-bit-4.0.4-win64.zip
126126
```
127127

128128
The ZIP package contains the following set of files.
@@ -146,14 +146,14 @@ PS> Get-FileHash fluent-bit-4.0.4-win32.exe
146146

147147
1. Launch `cmd.exe` or PowerShell on your machine, and execute `fluent-bit.exe`:
148148

149-
```text
150-
PS> .\bin\fluent-bit.exe -i dummy -o stdout
149+
```shell
150+
.\bin\fluent-bit.exe -i dummy -o stdout
151151
```
152152

153153
The following output indicates Fluent Bit is running:
154154

155-
```text
156-
PS> .\bin\fluent-bit.exe -i dummy -o stdout
155+
```shell
156+
.\bin\fluent-bit.exe -i dummy -o stdout
157157
Fluent Bit v2.0.x
158158
* Copyright (C) 2019-2020 The Fluent Bit Authors
159159
* Copyright (C) 2015-2018 Treasure Data
@@ -178,15 +178,11 @@ To halt the process, press `Control+C` in the terminal.
178178
1. Download an EXE installer for the appropriate 32-bit or 64-bit build.
179179
1. Double-click the EXE installer you've downloaded. The installation wizard starts.
180180

181-
![Installation wizard screenshot](<../.gitbook/assets/windows\_installer (1) (1).png>)
182-
183181
1. Click **Next** and finish the installation. By default, Fluent Bit is installed
184182
in `C:\Program Files\fluent-bit\`.
185183

186-
You should be able to launch Fluent Bit using the following PowerShell command:.
187-
188-
```text
189-
PS> C:\Program Files\fluent-bit\bin\fluent-bit.exe -i dummy -o stdout
184+
```shell
185+
& "C:\Program Files\fluent-bit\bin\fluent-bit.exe" -i dummy -o stdout
190186
```
191187

192188
### Installer options
@@ -198,8 +194,8 @@ for silent installation and install directory.
198194

199195
To silently install to `C:\fluent-bit` directory here is an example:
200196

201-
```text
202-
PS> <installer exe> /S /D=C:\fluent-bit
197+
```shell
198+
<installer exe> /S /D=C:\fluent-bit
203199
```
204200

205201
The uninstaller also supports a silent uninstall using the same `/S` flag.
@@ -228,15 +224,15 @@ C:\fluent-bit\
228224
To register Fluent Bit as a Windows service, execute the following command on
229225
at a command prompt. A single space is required after `binpath=`.
230226

231-
```text
227+
```shell
232228
sc.exe create fluent-bit binpath= "\fluent-bit\bin\fluent-bit.exe -c \fluent-bit\conf\fluent-bit.conf"
233229
```
234230

235231
Fluent Bit can be started and managed as a normal Windows service.
236232

237-
```text
238-
% sc.exe start fluent-bit
239-
% sc.exe query fluent-bit
233+
```shell
234+
sc.exe start fluent-bit
235+
sc.exe query fluent-bit
240236
SERVICE_NAME: fluent-bit
241237
TYPE : 10 WIN32_OWN_PROCESS
242238
STATE : 4 Running
@@ -245,46 +241,38 @@ SERVICE_NAME: fluent-bit
245241

246242
To halt the Fluent Bit service, use the `stop` command.
247243

248-
```text
244+
```shell
249245
sc.exe stop fluent-bit
250246
```
251247

252248
To start Fluent Bit automatically on boot, execute the following:
253249

254-
```text
250+
```shell
255251
sc.exe config fluent-bit start= auto
256252
```
257253

258254
## FAQs
259255

260-
### Fluent Bit fails to start up when installed under `C:\Program Files`
261-
262-
Quotations are required if file paths contain spaces. For example:
263-
264-
```text
265-
sc.exe create fluent-bit binpath= "\"C:\Program Files\fluent-bit\bin\fluent-bit.exe\" -c \"C:\Program Files\fluent-bit\conf\fluent-bit.conf\""
266-
```
267-
268256
### Can you manage Fluent Bit service using PowerShell?
269257

270258
Instead of `sc.exe`, PowerShell can be used to manage Windows services.
271259

272260
Create a Fluent Bit service:
273261

274-
```text
275-
PS> New-Service fluent-bit -BinaryPathName "`"C:\Program Files\fluent-bit\bin\fluent-bit.exe`" -c `"C:\Program Files\fluent-bit\conf\fluent-bit.conf`"" -StartupType Automatic -Description "This service runs Fluent Bit, a log collector that enables real-time processing and delivery of log data to centralized logging systems."
262+
```shell
263+
New-Service fluent-bit -BinaryPathName "`"C:\Program Files\fluent-bit\bin\fluent-bit.exe`" -c `"C:\Program Files\fluent-bit\conf\fluent-bit.conf`"" -StartupType Automatic -Description "This service runs Fluent Bit, a log collector that enables real-time processing and delivery of log data to centralized logging systems."
276264
```
277265
278266
Start the service:
279267
280-
```text
281-
PS> Start-Service fluent-bit
268+
```shell
269+
Start-Service fluent-bit
282270
```
283271
284272
Query the service status:
285273
286-
```text
287-
PS> get-Service fluent-bit | format-list
274+
```shell
275+
get-Service fluent-bit | format-list
288276
Name : fluent-bit
289277
DisplayName : fluent-bit
290278
Status : Running
@@ -298,14 +286,14 @@ ServiceType : Win32OwnProcess
298286
299287
Stop the service:
300288
301-
```text
302-
PS> Stop-Service fluent-bit
289+
```shell
290+
Stop-Service fluent-bit
303291
```
304292
305293
Remove the service (requires PowerShell 6.0 or later)
306294
307-
```text
308-
PS> Remove-Service fluent-bit
295+
```shell
296+
Remove-Service fluent-bit
309297
```
310298
311299
## Compile from Source
@@ -318,21 +306,21 @@ compile Fluent Bit by yourself.
318306
1. Install Microsoft Visual C++ to compile Fluent Bit. You can install the minimum
319307
toolkit using the following command:
320308
321-
```text
322-
PS> wget -o vs.exe https://aka.ms/vs/16/release/vs_buildtools.exe
323-
PS> start vs.exe
309+
```shell
310+
wget -o vs.exe https://aka.ms/vs/16/release/vs_buildtools.exe
311+
start vs.exe
324312
```
325313
326314
1. Choose `C++ Build Tools` and `C++ CMake tools for Windows` and wait until the process finishes.
327315
328316
1. Install flex and bison. One way to install them on Windows is to use
329317
[winflexbison](https://github.com/lexxmark/winflexbison).
330318
331-
```text
332-
PS> wget -o winflexbison.zip https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
333-
PS> Expand-Archive winflexbison.zip -Destination C:\WinFlexBison
334-
PS> cp -Path C:\WinFlexBison\win_bison.exe C:\WinFlexBison\bison.exe
335-
PS> cp -Path C:\WinFlexBison\win_flex.exe C:\WinFlexBison\flex.exe
319+
```shell
320+
wget -o winflexbison.zip https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
321+
Expand-Archive winflexbison.zip -Destination C:\WinFlexBison
322+
cp -Path C:\WinFlexBison\win_bison.exe C:\WinFlexBison\bison.exe
323+
cp -Path C:\WinFlexBison\win_flex.exe C:\WinFlexBison\flex.exe
336324
```
337325
338326
1. Add the path `C:\WinFlexBison` to your systems environment variable `Path`.
@@ -342,9 +330,9 @@ PS> start vs.exe
342330
343331
1. Install [Git](https://git-scm.com/download/win) to pull the source code from the repository.
344332
345-
```text
346-
PS> wget -o git.exe https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe
347-
PS> start git.exe
333+
```shell
334+
wget -o git.exe https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe
335+
start git.exe
348336
```
349337
350338
### Compilation
@@ -358,21 +346,21 @@ PS> start vs.exe
358346
359347
1. Clone the source code of Fluent Bit.
360348
361-
```text
362-
% git clone https://github.com/fluent/fluent-bit
363-
% cd fluent-bit/build
349+
```shell
350+
git clone https://github.com/fluent/fluent-bit
351+
cd fluent-bit/build
364352
```
365353
366354
1. Compile the source code.
367355
368-
```text
369-
% cmake .. -G "NMake Makefiles"
370-
% cmake --build .
356+
```shell
357+
cmake .. -G "NMake Makefiles"
358+
cmake --build .
371359
```
372360
373361
Now you should be able to run Fluent Bit:
374362
375-
```text
363+
```shell
376364
.\bin\debug\fluent-bit.exe -i dummy -o stdout
377365
```
378366

0 commit comments

Comments
 (0)