Update Module Reference
The dynamic-update
section uses the following syntax:
dynamic-update
update id <id> url <url> [delay <delay> | xdelay <delay start next retry>] [timeout <timeout>] [retries <nb>] [modified] [source <addr>[:<port>]] [log] [dontlog-normal] [map] [tls-ticket-keys] [param*]
with the following parameters:
Parameter | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
| If set, enables the use of the time from the Last-Modified response HTTP header, i.e. checking whether or not to update the data using the If-Modified-Since request HTTP header. |
| Set the source address for outgoing connections.
|
| Enables logging for the module using the log server specified in the |
| Disables logging for successful updates. |
| Informs that the downloaded file must be interpreted as a |
| Sets the TLS ticket keys file from which to load the keys. |
| A list of other server parameters. Useful to configure special SSL features. You can also apply any of the configuration parameters available to the |
Things to know:
ACL and Map files are simple text files. The difference between them is that ACL files contain a single column of data, one value per row, while Map files contain two columns: a key and value per row. By convention, the files have .acl and .map file extensions, respectively.
HAProxy Enterprise updates the contents of a
map
oracl
file only if the file was properly downloaded.If HAProxy Enterprise cannot connect to the server within the time defined in
<timeout>
, it retries for the number of times defined in<retries>
before it quits.
Runtime API
API | Description |
---|---|
| Returns the list of |
| Launches an immediate update for the selected |
| Shows the module status |
Examples
Below are examples of using the Update module's Runtime API commands.
Use lb-update list
to display the files that the Update module manages.
$ echo "lb-update list" | sudo socat stdio /var/run/hapee-1.6/hapee-lb.sock
# lb-update configured entries
# id: next update
/etc/hapee-1.6/redirects.map: 4m49s
Use lb-update force-update
to update a file immediately.
$ echo "lb-update force-update /etc/hapee-1.6/redirects.map" | sudo socat stdio /var/run/hapee-1.6/hapee-lb.sock
lb-update: force-update `/etc/hapee-1.6/redirects.map`.
Use lb-update status
to show the status of the Update module.
$ echo "lb-update status" | sudo socat stdio /var/run/hapee-1.6/hapee-lb.sock
lb-update module status
------------------------------------------------------------------------------
initialized: yes
SMP update
configuration: /etc/hapee-1.6/hapee-lb.cfg:30
entry: /etc/hapee-1.6/redirects.map
url: http://127.0.0.1:3000/redirects.map
http status count: 0 44 0 0 0
period/delay: 10s / 5s 10s 5s
use modified: no
reload/retry count: 44 0 0 / 0 0
reload time: 2021-02-15 22:11:48 / <NEVER> / <NEVER>
download time: 2021-02-15 22:11:48 / <NEVER>
next update in: 4s
The fields of the lb-update status
command are described below:
Field | Description |
---|---|
initialized | Whether the Update module was initialized. Initialization in this case does not mean that the module read the configuration (if any), but only that HAProxy Enterprise called the module initialization function. |
configuration | The configuration file and the line number where the |
entry | The value of the |
url | The item's download URL. HTTP and HTTPS web protocols are supported. |
http status count | The download HTTP status counter, sorted by status classes 1xx, 2xx, 3xx, 4xx, and 5xx. |
period | The download period. Every so often there will be an attempt to download the data. In case the download cannot be completed within that period, it will be aborted and the data discarded. |
delay | Indicates three values: start/next/retry. The <start> value specifies the initial (first) download delay. The <next> value is not used in this module and its value is not important. It is present only because of the compatibility of delay parameters with other lb-update-like modules. If the download fails, <retry> determines the delay for the next attempt. The number of consecutive downloads is 3 (after that the download is canceled until the next time specified by the download period). |
use modified | Indicates whether the module uses the time from the Last-Modified response HTTP header to check whether to update the data using the If-Modified-Since request HTTP header. |
reload count | Indicates three numbers. The first indicates the number of times the data reload was performed. The second indicates the number of times the data was not reloaded because the data did not differ from the old data. The third indicates the number of times the data reload failed because the data was incorrect. |
retry count | Indicates two numbers: the number of unsuccessful downloads and the number of final unsuccessful downloads. For example, if each download is tried 3 times (the first number) and if that fails, then the second number is increased by 1. After that, the subsequent download attempt is aborted for the respective cycle and the time for the next cycle is awaited. |
reload time | Indicates the date a reload was last performed, the date when data was not reloaded because the data did not differ from the old data, and the date when the data reload failed because the data was incorrect. |
download time | Indicates the date of the last successful download and the date of the last unsuccessful download. |
next update in | Indicates the time until the download of new data will be started. Also, if the download is in the process, then it is indicated here. |
Next up
Service Discovery