Skip to content

Commit 9dd8c5c

Browse files
committed
update prometheus files
1 parent 267f98c commit 9dd8c5c

File tree

4 files changed

+14
-77
lines changed

4 files changed

+14
-77
lines changed

docs/http/clusters.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Define Key Value store, backup state file, timeout, and enable sync
1111

12-
keyval_zone zone=split:1m state=/var/lib/nginx/state/split.keyval timeout=30d sync;
12+
keyval_zone zone=split:1m state=/var/lib/nginx/state/split.keyval timeout=365d sync;
1313
keyval $host $split_level zone=split;
1414

1515
# Main Nginx Server Block for cafe.example.com, with TLS

docs/http/default-http.conf

-28
This file was deleted.

docs/http/http-installation-guide.md

+12-47
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,18 @@ This can be any standard Linux OS system, based on the Linux Distro and Technica
231231
<br/>
232232

233233
### This is the NGINX configuration required for the NGINX Loadbalancing Server, external to the cluster. It must be configured for the following:
234-
235-
1. Move the NGINX default Welcome page from port 80 to port 8080. Port 80 will be used by Prometheus in this Solution.
236234

237-
2. The NGINX NJS module is enabled, and configured to export the NGINX Plus statistics.
235+
1. The NGINX NJS module is enabled, and configured to export the NGINX Plus statistics.
238236

239-
3. A self-signed TLS cert/key are used in this example for terminating TLS traffic for the Demo application, https://cafe.example.com.
237+
2. A self-signed TLS cert/key are used in this example for terminating TLS traffic for the Demo application, https://cafe.example.com.
240238

241-
4. Plus API with write access enabled on port 9000. The Plus Dashboard is also enabled, used for testing, monitoring, and visualization of the Solution working.
239+
3. Plus API with write access enabled on port 9000. The Plus Dashboard is also enabled, used for testing, monitoring, and visualization of the Solution working.
242240

243-
5. The `http` context is used for MultiCluster Loadbalancing, for HTTP/S processing, Split Clients ratio. The Plus Key Value Store is configured, to hold the dynamic Split ratio metadata.
241+
4. The `http` context is used for MultiCluster Loadbalancing, for HTTP/S processing, Split Clients ratio. The Plus Key Value Store is configured, to hold the dynamic Split ratio metadata.
244242

245-
6. Enable Prometheus metrics exporting.
243+
5. Enable Prometheus metrics exporting.
246244

247-
7. Plus Zone Sync on Port 9001 is configured, to synchronize the dynamic KeyVal data between multiple NGINX Loadbalancing Servers.
245+
6. Plus Zone Sync on Port 9001 is configured, to synchronize the dynamic KeyVal data between multiple NGINX Loadbalancing Servers.
248246

249247
<br/>
250248

@@ -266,7 +264,6 @@ etc/
266264
├── conf.d/
267265
│ ├── clusters.conf.......... MultiCluster Loadbalancing and split clients config
268266
│ ├── dashboard.conf......... NGINX Plus API and Dashboard config
269-
│ ├── default-http.conf...... New default.conf config
270267
│ └── prometheus.conf........ NGINX Prometheus config
271268
├── nginx.conf................. New nginx.conf
272269
└── stream
@@ -277,41 +274,6 @@ etc/
277274

278275
After a new installation of NGINX Plus, make the following configuration changes:
279276

280-
1. Change NGINX's http default server to port 8080. See the included `default-http.conf` file. After reloading nginx, the default `Welcome to NGINX` page will be located at http://localhost:8080.
281-
282-
```bash
283-
cat /etc/nginx/conf.d/default.conf
284-
# NGINX Loadbalancer for Kubernetes Solution
285-
# Chris Akker, Apr 2023
286-
# Example default.conf
287-
# Change default_server to port 8080
288-
#
289-
server {
290-
listen 8080 default_server; # Changed to 8080
291-
server_name localhost;
292-
293-
#access_log /var/log/nginx/host.access.log main;
294-
295-
location / {
296-
root /usr/share/nginx/html;
297-
index index.html index.htm;
298-
}
299-
300-
#error_page 404 /404.html;
301-
302-
# redirect server error pages to the static page /50x.html
303-
#
304-
error_page 500 502 503 504 /50x.html;
305-
location = /50x.html {
306-
root /usr/share/nginx/html;
307-
}
308-
309-
### other sections removed for clarity
310-
311-
}
312-
313-
```
314-
315277
1. Use the included nginx.conf file, it enables the NGINX NJS module, for exporting the Plus statistics:
316278

317279
```bash
@@ -403,7 +365,7 @@ After a new installation of NGINX Plus, make the following configuration changes
403365
404366
# Define Key Value store, backup state file, timeout, and enable sync
405367
406-
keyval_zone zone=split:1m state=/var/lib/nginx/state/split.keyval timeout=30d sync;
368+
keyval_zone zone=split:1m state=/var/lib/nginx/state/split.keyval timeout=365d sync;
407369
keyval $host $split_level zone=split;
408370
409371
# Main NGINX Server Block for cafe.example.com, with TLS
@@ -556,6 +518,9 @@ After a new installation of NGINX Plus, make the following configuration changes
556518
js_import /usr/share/nginx-plus-module-prometheus/prometheus.js;
557519
558520
server {
521+
listen 9113;
522+
status_zone prometheus;
523+
559524
location = /metrics {
560525
js_content prometheus.metrics;
561526
}
@@ -1014,7 +979,7 @@ Here are the instructions to run 2 Docker containers on a Monitor Server, which
1014979
1015980
<br/>
1016981
1017-
1. Configure your Prometheus server to collect NGINX Plus statistics from the scraper page. Use the prometheus.yml file provided, edit the IP addresses to match your NGINX Loadbalancing Server(s).
982+
1. Configure your Prometheus server to collect NGINX Plus statistics from the scraper page. You can use the prometheus.yml file provided, edit the IP addresses to match your NGINX Loadbalancing Server(s).
1018983
1019984
```bash
1020985
cat prometheus.yaml
@@ -1033,7 +998,7 @@ Here are the instructions to run 2 Docker containers on a Monitor Server, which
1033998
scrape_interval: 5s
1034999
10351000
static_configs:
1036-
- targets: ['10.1.1.4:80', '10.1.1.5:80'] # NGINX Loadbalancing Servers
1001+
- targets: ['10.1.1.4:9113', '10.1.1.5:9113'] # NGINX Loadbalancing Servers
10371002
```
10381003
10391004
1. Review, edit and place the sample `prometheus.yml` file in /etc/prometheus folder.

docs/http/prometheus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ scrape_configs:
1010
scrape_interval: 5s
1111

1212
static_configs:
13-
- targets: ['10.1.1.4:80', '10.1.1.5:80']
13+
- targets: ['10.1.1.4:9113', '10.1.1.5:9113']
1414

0 commit comments

Comments
 (0)