You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/elastic-stack-setup-01-installation.md
+93-79Lines changed: 93 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
49
49
50
50
**Step 2: Install and Configure Elasticsearch 8.x.x or 9.x.x**
51
51
52
-
1. Open an elevated PowerShell and run the following command to start Elasticsearch and perform the auto installation steps:
52
+
1. Open an elevated PowerShell, navigate to ElasticSearch's bin folder(`C:\elastic\elasticsearch-x.x.x\bin`) and run the following command to start Elasticsearch and perform the auto installation steps:
@@ -69,9 +69,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
69
69
> [!NOTE]
70
70
> To stop Elasticsearch after you have copied the enrollment token, click inside the PowerShell window and press `Ctrl` and `C` at the same time. This will end the running process.
71
71
72
-
3. Open an elevated PowerShell and run the following command to install Elasticsearch as a Windows service:
72
+
3. Open an elevated PowerShell, navigate to ElasticSearch's bin folder(`C:\elastic\elasticsearch-x.x.x\bin`) and run the following command to install Elasticsearch as a Windows service:
@@ -83,9 +83,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
83
83
84
84
**Step 3: Run Elasticsearch as a Windows Service**
85
85
86
-
1. Open an elevated PowerShell and run the following command to start the Elasticsearch service:
86
+
1. Open an elevated PowerShell, navigate to ElasticSearch's bin folder(`C:\elastic\elasticsearch-x.x.x\bin`) and run the following command to start the Elasticsearch service:
@@ -131,31 +131,16 @@ If you download a .zip or other file from the internet, Windows may block the fi
131
131
> [!NOTE]
132
132
> **Official Documentation:** For comprehensive configuration details, see [Elasticsearch configuration documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html), [Node roles](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html), and [Discovery and cluster formation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html).
133
133
134
-
> [!IMPORTANT]
135
-
> **Node role separation is the most critical production architectural difference**
> This configuration is NOT recommended for production environments
225
+
223
226
**Step 7: Configure Storage Paths**
224
227
225
228
> [!IMPORTANT]
@@ -255,19 +258,28 @@ These are separate directories because data directories require high-performance
255
258
256
259
2. Save the changes and restart the Elasticsearch service:
257
260
261
+
258
262
```powershell
259
263
Restart-Service -Name "elasticsearch-service-x64"
260
264
```
261
265
266
+
> [!NOTE]
267
+
> **Development Environment:**
268
+
> If you are running a single-node development environment and have changed the data path, you may need to reset the `elastic` user password after restarting the service. Use the following command in the Elasticsearch bin directory:
269
+
> ```
270
+
> .\elasticsearch-reset-password -u elastic
271
+
> ```
272
+
> This ensures you can log in to Kibana and perform admin tasks after moving the data directory.
273
+
262
274
**Step 8: Install the 'mapper-size' plugin**
263
275
264
-
1. Open an elevated PowerShell and run the following command to install the 'mapper-size' plugin:
276
+
1. Open an elevated PowerShell, navigate to ElasticSearch's bin folder(C:\elastic\elasticsearch-x.x.x\bin) and run the following command to install the 'mapper-size' plugin:
1. To verify Elasticsearch is running, open an elevated Command Prompt and run the following command (replace `<username>`, `<password>`, and `<hostname_or_ip>` with your actual values). In production do NOT use `-k`; validate the server certificate using the CA certificate you installed:
Go to https://localhost:5601/?code=xyz to get started
381
393
```
382
394
383
-
**Step 3: Enroll Kibana**
384
-
385
-
1. In your terminal, click the generated link to open Kibana in your browser.
386
-
2. In your browser, paste the enrollment token that was generated in the terminal when you started Elasticsearch, then click the Configure Elastic button to connect your Kibana instance with Elasticsearch.
387
-
[See where the enrollment token is generated.](#enrollment-token-generation)
388
-
3. If the token has expired, generate a new one by running the following command in the Elasticsearch's bin folder (e.g., `C:\elastic\elasticsearch-x.x.x\bin`).
4. Log in to Kibana as the `elastic` user with the password that was generated when you started Elasticsearch.
397
-
5. See the screenshot below for the login screen:
398
-
399
-

400
-
401
-
**Step 4: Enable TLS for Kibana**
395
+
**Step 3: Enable TLS for Kibana**
402
396
403
397
> [!NOTE]
404
398
> **Official Documentation:** For comprehensive TLS configuration details, see [Elastic's Kibana security documentation](https://www.elastic.co/guide/en/kibana/current/using-kibana-with-security.html) and [Encrypt communications in Kibana](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html).
405
399
406
400
1. Generate certificates Option A: Use elasticsearch-certutil
407
401
1. Open an elevated PowerShell in C:\elastic\elasticsearch\bin.
408
402
2. Create CA:
409
-
1. Run the following command
403
+
1. Run the following command:
404
+
410
405
```
411
-
elasticsearch-certutil.bat ca --silent --pem --out "C:\elastic\secrets\kibana_ca.zip"
406
+
.\elasticsearch-certutil.bat ca --silent --pem --out "C:\elastic\secrets\kibana_ca.zip"
412
407
```
413
408
2. Extract zip contents into `C:\elastic\secrets\ca\ (you should have ca.crt and ca.key)`.
2. After adding secrets, restart Kibana so it reads the keystore.
572
567
3. Ensure the keystore file has restrictive ACLs so only the Kibana service account can read it.
573
568
574
-
4. Restart the Kibana service, by opening an elevated PowerShell and run the following command:
569
+
4. Restart the Kibana service, by opening an elevated PowerShell, navigate to bin folder(C:\Kibana\kibana-x.x.x\bin) and run the following command:
575
570
```
576
-
C:\Kibana\kibana-x.x.x\bin\kibana.bat
571
+
.\kibana.bat
577
572
```
578
573
579
574
5. To verify success, check the terminal output for lines indicating that Kibana has started successfully. You can also refer to the screenshots below:
8. For more details, refer to the official documentation: https://www.elastic.co/guide/en/kibana/current/kibana-encryption-keys.html
589
584
585
+
**Step 5: Enroll Kibana**
586
+
587
+
1. In your terminal, click the generated link to open Kibana in your browser.
588
+
2. In your browser, paste the enrollment token that was generated in the terminal when you started Elasticsearch, then click the Configure Elastic button to connect your Kibana instance with Elasticsearch.
589
+
[See where the enrollment token is generated.](#enrollment-token-generation)
590
+
3. If the token has expired, generate a new one by running the following command in the Elasticsearch's bin folder (e.g., `C:\elastic\elasticsearch-x.x.x\bin`).
> Kibana does not install as a Windows service by default. We recommend using NSSM — a commonly used open-source tool—to run Kibana as a Windows service.
605
618
606
-
2. Open an elevated PowerShell and run the following command:
619
+
2. Open an elevated PowerShell, navigate to "C:\nssm-2.24\win64" and run the following command:
607
620
608
621
```
609
-
C:\nssm-2.24\win64\nssm.exe install kibana
622
+
.\nssm.exe install kibana
610
623
```
611
624
612
625
This will open a popup to create a Windows service for Kibana.
3. Extract zip contents into `C:\elastic\secrets\apm-server\` to get APM.crt and APM.key (you should have C:/elastic/secrets/apm-server/apm-server.crt and apm-server.key)
0 commit comments