Skip to content

Commit afd95a6

Browse files
committed
REL-1123365: Re-arranged steps and updated commands
1 parent fd56723 commit afd95a6

3 files changed

Lines changed: 93 additions & 509 deletions

File tree

docs/elastic-stack-setup-01-installation.md

Lines changed: 93 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
4949

5050
**Step 2: Install and Configure Elasticsearch 8.x.x or 9.x.x**
5151

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:
5353
```
54-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch.bat
54+
.\elasticsearch.bat
5555
```
5656
<a id="enrollment-token-generation"></a>
5757
@@ -69,9 +69,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
6969
> [!NOTE]
7070
> 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.
7171
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:
7373
```
74-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch-service.bat install
74+
.\elasticsearch-service.bat install
7575
```
7676
7777
The output will look similar to:
@@ -83,9 +83,9 @@ If you download a .zip or other file from the internet, Windows may block the fi
8383
8484
**Step 3: Run Elasticsearch as a Windows Service**
8585
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:
8787
```
88-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch-service.bat start
88+
.\elasticsearch-service.bat start
8989
```
9090
9191
The output will look similar to:
@@ -131,31 +131,16 @@ If you download a .zip or other file from the internet, Windows may block the fi
131131
> [!NOTE]
132132
> **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).
133133
134-
> [!IMPORTANT]
135-
> **Node role separation is the most critical production architectural difference**
136-
>
137-
> **Master Nodes** (`node.roles: ["master"]`):
138-
> - Manage cluster state and coordination
139-
> - Lightweight operations - do NOT store data
140-
> - Resources: 2-4 CPU, 8-16GB RAM
141-
>
142-
> **Data Nodes** (`node.roles: ["data", "ingest"]`):
143-
> - Store indices and execute queries
144-
> - Resource-intensive - do NOT participate in master elections
145-
> - Minimum 2 nodes for redundancy
146-
> - Resources: Based on data volume (high CPU, RAM, fast storage)
147-
>
148-
> **Critical Rules:**
149-
> - NEVER mix master and data roles in production
150-
> - Roles must be explicitly planned for 2-node, 3-node, or larger clusters
151-
> - Master and data nodes have very different configurations
152-
> - Proper master/data node setup is the most important production concern
153-
>
154-
> **Development Environment:**
155-
> - For development purposes, a single node can have all roles assigned
156-
> - Example: `node.roles: ["master", "data", "ingest"]`
134+
**Master Nodes** (`node.roles: ["master"]`):
135+
- Manage cluster state and coordination
136+
- Lightweight operations - do NOT store data
137+
- Resources: 2-4 CPU, 8-16GB RAM
157138
158-
![Node Configuration](../resources/troubleshooting-images/node_configuration_dev_environment.PNG)
139+
**Data Nodes** (`node.roles: ["data", "ingest"]`):
140+
- Store indices and execute queries
141+
- Resource-intensive - do NOT participate in master elections
142+
- Minimum 2 nodes for redundancy
143+
- Resources: Based on data volume (high CPU, RAM, fast storage)
159144
160145
> [!NOTE]
161146
> This configuration is NOT recommended for production environments
@@ -220,6 +205,24 @@ If you download a .zip or other file from the internet, Windows may block the fi
220205
221206
2. For dedicated master nodes use `node.roles: ["master"]` and ensure they do not hold data (`node.data: false`) if desired.
222207
208+
> [!IMPORTANT]
209+
> **Node role separation is the most critical production architectural difference**
210+
>
211+
> **Critical Rules:**
212+
> - NEVER mix master and data roles in production
213+
> - Roles must be explicitly planned for 2-node, 3-node, or larger clusters
214+
> - Master and data nodes have very different configurations
215+
> - Proper master/data node setup is the most important production concern
216+
>
217+
> **Development Environment:**
218+
> - For development purposes, a single node can have all roles assigned
219+
> - Example: `node.roles: ["master", "data", "ingest"]`
220+
221+
![Node Configuration](../resources/troubleshooting-images/node_configuration_dev_environment.PNG)
222+
223+
> [!NOTE]
224+
> This configuration is NOT recommended for production environments
225+
223226
**Step 7: Configure Storage Paths**
224227
225228
> [!IMPORTANT]
@@ -255,19 +258,28 @@ These are separate directories because data directories require high-performance
255258
256259
2. Save the changes and restart the Elasticsearch service:
257260
261+
258262
```powershell
259263
Restart-Service -Name "elasticsearch-service-x64"
260264
```
261265
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+
262274
**Step 8: Install the 'mapper-size' plugin**
263275
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:
265277
```
266-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch-plugin install mapper-size
278+
.\elasticsearch-plugin install mapper-size
267279
```
268280
2. To verify the 'mapper-size' plugin is installed, run:
269281
```
270-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch-plugin list
282+
.\elasticsearch-plugin list
271283
```
272284
3. Restart the Elasticsearch Service. To restart the Elasticsearch service, run the following in an elevated PowerShell session:
273285
```
@@ -321,7 +333,7 @@ Restart-Service -Name "elasticsearch-service-x64"
321333

322334
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:
323335
```
324-
curl -u <username>:<password> --cacert C:\elastic\secrets\ca\ca.crt https://<hostname_or_ip>:9200
336+
curl.exe -u <username>:<password> --cacert "C:\elastic\config\certs\http_ca.crt" --ssl-no-revoke https://<hostname_or_ip>:9200
325337
```
326338
Or with PowerShell (validates TLS by default):
327339
```powershell
@@ -370,7 +382,7 @@ Restart-Service -Name "elasticsearch-service-x64"
370382
1. Navigate to Kibana's `bin` folder (e.g., `C:\elastic\kibana\bin`).
371383
2. Open an elevated PowerShell and run the following command:
372384
```
373-
C:\Kibana\kibana-x.x.x\bin\kibana.bat
385+
.\kibana.bat
374386
```
375387
3. If successful, you should see output indicating that the Kibana server has started and is listening on port 5601. Look for lines similar to:
376388
```
@@ -380,35 +392,18 @@ Restart-Service -Name "elasticsearch-service-x64"
380392
Go to https://localhost:5601/?code=xyz to get started
381393
```
382394
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`).
389-
```
390-
C:\elastic\elasticsearch-x.x.x\bin\elasticsearch-create-enrollment-token --scope kibana
391-
```
392-
<details>
393-
<summary>Sample output</summary>
394-
eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTAuMC4yLjI6OTIwMCJdLCJmZ3IiOiI4ZGE1MWZkYTExZmM1ZDAwNDBhZWZlNTJlNmRiYzQ5ZTM2NmYxYTkyOGIwY2NiMzExOGY0MWFjZTczODNkZDliIiwia2V5IjoiOGFfc1BKZ0Jra09qNlh6dngycS06bG5sWkNEMnpSbFNiZjZZclpRSHF6dyJ9
395-
</details>
396-
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-
![](../resources/elasticsearch_setup_003.png)
400-
401-
**Step 4: Enable TLS for Kibana**
395+
**Step 3: Enable TLS for Kibana**
402396
403397
> [!NOTE]
404398
> **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).
405399
406400
1. Generate certificates Option A: Use elasticsearch-certutil
407401
1. Open an elevated PowerShell in C:\elastic\elasticsearch\bin.
408402
2. Create CA:
409-
1. Run the following command
403+
1. Run the following command:
404+
410405
```
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"
412407
```
413408
2. Extract zip contents into `C:\elastic\secrets\ca\ (you should have ca.crt and ca.key)`.
414409
@@ -417,7 +412,7 @@ Restart-Service -Name "elasticsearch-service-x64"
417412
418413
2. Run the following command:
419414
```
420-
elasticsearch-certutil.bat cert --silent --pem --ca-cert "C:\elastic\secrets\ca\ca.crt" --ca-key "C:\elastic\secrets\ca\ca.key" --name kibana [SAN args] --out "C:\elastic\secrets\kibana_server.zip"
415+
.\elasticsearch-certutil.bat cert --silent --pem --ca-cert "C:\elastic\secrets\ca\ca.crt" --ca-key "C:\elastic\secrets\ca\ca.key" --name kibana [SAN args] --out "C:\elastic\secrets\kibana_server.zip"
421416
```
422417
3. Extract zip contents into `C:\elastic\secrets\kibana\` to get kibana.crt and kibana.key
423418
@@ -436,7 +431,7 @@ Restart-Service -Name "elasticsearch-service-x64"
436431
437432
2. Run the following command using an elevated Powershell
438433
```
439-
certutil.exe -addstore -f Root "C:\elastic\kibana\config\certs\ca.crt".
434+
certutil.exe -addstore -f Root "C:\elastic\kibana\config\certs\ca.crt"
440435
```
441436
442437
2. Use OpenSSL (if certutil missing or for self-signed)
@@ -520,17 +515,17 @@ Restart-Service -Name "elasticsearch-service-x64"
520515
521516
Use forward slashes in paths (C:/...) to avoid YAML escape issues.
522517
523-
**Step 5: Generate Kibana encryption keys**
518+
**Step 4: Generate Kibana encryption keys**
524519
525520
> [!NOTE]
526521
> **Official Documentation:** For encryption key details, see [Elastic's Kibana encryption keys documentation](https://www.elastic.co/guide/en/kibana/current/xpack-security-secure-saved-objects.html).
527522
528523
> [!NOTE]
529524
> Skipping the steps below will cause the Relativity Server CLI to fail.
530525
531-
1. Open an elevated PowerShell and run the following command:
526+
1. Open an elevated PowerShell, navigate to bin folder(C:\Kibana\kibana-x.x.x\bin) and run the following command:
532527
```
533-
C:\Kibana\kibana-x.x.x\bin\kibana-encryption-keys generate
528+
.\kibana-encryption-keys generate
534529
```
535530
536531
2. If successful, you will see output showing the generated encryption keys. For example:
@@ -571,9 +566,9 @@ Restart-Service -Name "elasticsearch-service-x64"
571566
2. After adding secrets, restart Kibana so it reads the keystore.
572567
3. Ensure the keystore file has restrictive ACLs so only the Kibana service account can read it.
573568
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:
575570
```
576-
C:\Kibana\kibana-x.x.x\bin\kibana.bat
571+
.\kibana.bat
577572
```
578573
579574
5. To verify success, check the terminal output for lines indicating that Kibana has started successfully. You can also refer to the screenshots below:
@@ -587,6 +582,24 @@ Restart-Service -Name "elasticsearch-service-x64"
587582
588583
8. For more details, refer to the official documentation: https://www.elastic.co/guide/en/kibana/current/kibana-encryption-keys.html
589584
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`).
591+
```
592+
.\elasticsearch-create-enrollment-token --scope kibana
593+
```
594+
<details>
595+
<summary>Sample output</summary>
596+
eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTAuMC4yLjI6OTIwMCJdLCJmZ3IiOiI4ZGE1MWZkYTExZmM1ZDAwNDBhZWZlNTJlNmRiYzQ5ZTM2NmYxYTkyOGIwY2NiMzExOGY0MWFjZTczODNkZDliIiwia2V5IjoiOGFfc1BKZ0Jra09qNlh6dngycS06bG5sWkNEMnpSbFNiZjZZclpRSHF6dyJ9
597+
</details>
598+
4. Log in to Kibana as the `elastic` user with the password that was generated when you started Elasticsearch.
599+
5. See the screenshot below for the login screen:
600+
601+
![](../resources/elasticsearch_setup_003.png)
602+
590603
**Step 6: Create Kibana Windows Service**
591604
592605
> [!IMPORTANT]
@@ -603,10 +616,10 @@ Restart-Service -Name "elasticsearch-service-x64"
603616
> [!NOTE]
604617
> 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.
605618
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:
607620
608621
```
609-
C:\nssm-2.24\win64\nssm.exe install kibana
622+
.\nssm.exe install kibana
610623
```
611624
612625
This will open a popup to create a Windows service for Kibana.
@@ -681,7 +694,7 @@ Restart-Service -Name "elasticsearch-service-x64"
681694
2. Create CA:
682695
1. Run the following command
683696
```
684-
elasticsearch-certutil.bat ca --silent --pem --out "C:\elastic\secrets\apm_ca.zip"
697+
.\elasticsearch-certutil.bat ca --silent --pem --out "C:\elastic\secrets\apm_ca.zip"
685698
```
686699
2. Extract apm_ca.zip contents into `C:\elastic\secrets\apm-ca\ (you should have ca.crt and ca.key inside the folder)`.
687700
@@ -690,7 +703,7 @@ Restart-Service -Name "elasticsearch-service-x64"
690703
691704
2. Run the following command:
692705
```
693-
elasticsearch-certutil.bat cert --silent --pem --ca-cert "C:\elastic\secrets\apm-ca\ca.crt" --ca-key "C:\elastic\secrets\apm-ca\ca.key" --name apm-server [SAN args] --out "C:\elastic\secrets\apm-server.zip"
706+
.\elasticsearch-certutil.bat cert --silent --pem --ca-cert "C:\elastic\secrets\apm-ca\ca.crt" --ca-key "C:\elastic\secrets\apm-ca\ca.key" --name apm-server [SAN args] --out "C:\elastic\secrets\apm-server.zip"
694707
```
695708
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)
696709
@@ -709,7 +722,7 @@ Restart-Service -Name "elasticsearch-service-x64"
709722
710723
2. Run the following command using an elevated Powershell
711724
```
712-
certutil.exe -addstore -f Root "C:\elastic\apm-server\config\certs\ca.crt".
725+
certutil.exe -addstore -f Root "C:\elastic\apm-server\config\certs\ca.crt"
713726
```
714727
715728
2. Option B: Use OpenSSL (if certutil missing or for self-signed)
@@ -801,22 +814,23 @@ Restart-Service -Name "elasticsearch-service-x64"
801814
802815
```yaml
803816
apm-server:
804-
host: "<apm-server-hostname_or_ip>:8200"
805-
817+
host: "<apm-server-hostname-or-ip>:8200"
818+
ssl.enabled: true
819+
ssl.certificate: C:/elastic/apm-server/config/certs/apm-server.crt
820+
ssl.key: C:/elastic/apm-server/config/certs/apm-server.key
806821
output.elasticsearch:
807-
hosts: ["https://<elasticsearch-hostname_or_ip>:9200"]
808-
protocol: "https"
809-
api_key: "<id>:<api-key>"
822+
hosts: ["https://<elasticsearch-hostname-or-ip>:9200"]
823+
api_key: "api_key: "<id>:<api-key>""
810824
ssl.enabled: true
811-
# Validate the Elasticsearch HTTP layer using the CA cert
812-
ssl.certificate_authorities: ["C:/elastic/apm-server/config/certs/ca.crt"]
825+
ssl.certificate_authorities: ["C:/elastic/elasticsearch/config/certs/http_ca.crt"]
813826
ssl.verification_mode: full
814-
827+
setup.kibana:
828+
host: "https://<kibana-hostname-or-ip>:5601"
829+
ssl.enabled: true
830+
ssl.certificate_authorities: ["C:/elastic/kibana/config/certs/ca.crt"] # <-- if Kibana cert was signed by http_ca, point to http_ca.crt
815831
instrumentation:
816832
enabled: true
817833
environment: production
818-
hosts:
819-
- "https://<apm-server-hostname_or_ip>:8200"
820834
```
821835
822836
**Step 5: Execute required scripts to install APM Server as a Windows service**
@@ -825,7 +839,7 @@ Restart-Service -Name "elasticsearch-service-x64"
825839
2. Run the following code to install the APM Server as a Windows service:
826840
827841
```
828-
PowerShell.exe -ExecutionPolicy UnRestricted -File C:\apm-server-x.x.x-windows-x86_64\install-service.ps1
842+
PowerShell.exe -ExecutionPolicy UnRestricted -File C:\apm-server-8.17.3-windows-x86_64\install-service.ps1
829843
```
830844
The output will look similar to:
831845

0 commit comments

Comments
 (0)