Skip to content

Commit 472d262

Browse files
committed
updating README.md for adjusting-weight function
1 parent 7c50ef3 commit 472d262

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name
22
====
33

4-
nginx-upsync-module - Nginx C module, nginx + consul server discovery service, dynamicly update upstream backend servers, needn't reload nginx.
4+
nginx-upsync-module - Nginx C module, nginx + consul server discovery service, dynamicly update upstream backend servers, dynamicly adjust backend servers weight, needn't reload nginx.
55

66
Table of Contents
77
=================
@@ -71,7 +71,7 @@ http {
7171
Description
7272
======
7373

74-
This module provides a method to discover backend servers. Supporting dynamicly adding or deleting backend server through consul, module will timely pull new backend server list from consul to update nginx ip router. Nginx needn't reload. Having some advantages than others:
74+
This module provides a method to discover backend servers. Supporting dynamicly adding or deleting backend server through consul and dynamicly adjusting backend servers weight, module will timely pull new backend server list from consul to update nginx ip router. Nginx needn't reload. Having some advantages than others:
7575

7676
* timely
7777

@@ -83,7 +83,7 @@ This module provides a method to discover backend servers. Supporting dynamicly
8383

8484
* stability
8585

86-
Even if one pulling failed, it will pull next update_interval, so guaranteing backend server stably provides service.
86+
Even if one pulling failed, it will pull next update_interval, so guaranteing backend server stably provides service. And support dumping the latest config to location, so even if consul hung up, and nginx can be reload anytime.
8787

8888
* health_check
8989

@@ -167,7 +167,7 @@ http_interface example:
167167
default: weight=1 max_fails=2 fail_timeout=10 down=0 backup=0;
168168

169169
```
170-
curl -X PUT -d '{"weight":"1", "max_fails":"2", "fail_timeout":"10s"}' http://$consul_ip:$port/v1/kv/upstreams/$upstream_name/$backend_ip:$backend_port
170+
curl -X PUT -d '{\"weight\":1, \"max_fails\":2, \"fail_timeout\":10}' http://$consul_ip:$port/v1/kv/$dir1/$upstream_name/$backend_ip:$backend_port
171171
```
172172
value support json format.
173173

@@ -176,6 +176,11 @@ http_interface example:
176176
curl -X DELETE http://$consul_ip:$port/v1/kv/upstreams/$upstream_name/$backend_ip:$backend_port
177177
```
178178

179+
* adjust-weight
180+
```
181+
curl -X PUT -d '{\"weight\":2}' http://$consul_ip:$port/v1/kv/$dir1/$upstream_name/$backend_ip:$backend_port
182+
```
183+
179184
* check
180185
```
181186
curl http://$consul_ip:$port/v1/kv/upstreams/$upstream_name?recurse
@@ -193,7 +198,11 @@ TODO
193198
Compatibility
194199
=============
195200

196-
The module was developed base on nginx1.8.0, but it is not embeded to the request process, so it can be used in any version of nginx theoretically. To be veryfied.
201+
The module was developed base on nginx1.8.0.
202+
203+
Compatible with Nginx-1.8.x.
204+
205+
Compatible with Nginx-1.9.x.
197206

198207
[Back to TOC](#table-of-contents)
199208

0 commit comments

Comments
 (0)