diff options
author | Ava Hahn <a.hahn@f5.com> | 2024-07-03 12:44:56 -0700 |
---|---|---|
committer | Ava Hahn <110854134+avahahn@users.noreply.github.com> | 2024-07-08 11:58:09 -0700 |
commit | 706ea1a6890ac243d0aded8cfbcbd152affc8701 (patch) | |
tree | dcdf33182863012e30a8a306dd0e509a070c660a /tools/unitctl/README.md | |
parent | b5fe3eaf1a0bcbc98d274902f5e38f2c2ad71dbc (diff) | |
download | unit-706ea1a6890ac243d0aded8cfbcbd152affc8701.tar.gz unit-706ea1a6890ac243d0aded8cfbcbd152affc8701.tar.bz2 |
tools/unitctl: Enable Multi Socket Support
This commit refactors the CLI code to accept
multiple instances of the control socket flag.
All subcommands except for edit and save now
support being run against multiple specified
instances of unitd.
* control_socket_addresses CLI field is now a vector
* centralize error related logic into the error module
* wait_for_socket now returns a vector of sockets. all
sockets in vector are waited upon and validated
* extraneous code is removed
* applications, execute, import, listeners, and status
commands all run against N control sockets now
* edit and save commands return error when run against
a single control socket
Signed-off-by: Ava Hahn <a.hahn@f5.com>
Diffstat (limited to 'tools/unitctl/README.md')
-rw-r--r-- | tools/unitctl/README.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/unitctl/README.md b/tools/unitctl/README.md index 74366007..4aa6068c 100644 --- a/tools/unitctl/README.md +++ b/tools/unitctl/README.md @@ -111,6 +111,14 @@ $ unitctl app reload wasm } ``` +*Note:* Both of the above commands support operating on multiple instances +of Unit at once. To do this, pass multiple values for the `-s` flag as +shown below: + +``` +$ unitctl -s '127.0.0.1:8001' -s /run/nginx-unit.control.sock app list +``` + ### Lists active listeners from running Unit processes ``` unitctl listeners @@ -122,6 +130,13 @@ No socket path provided - attempting to detect from running instance } ``` +*Note:* This command supports operating on multiple instances of Unit at once. +To do this, pass multiple values for the `-s` flag as shown below: + +``` +$ unitctl -s '127.0.0.1:8001' -s /run/nginx-unit.control.sock listeners +``` + ### Get the current status of NGINX Unit processes ``` $ unitctl status -t yaml @@ -136,6 +151,13 @@ requests: applications: {} ``` +*Note:* This command supports operating on multiple instances of Unit at once. +To do this, pass multiple values for the `-s` flag as shown below: + +``` +$ unitctl -s '127.0.0.1:8001' -s /run/nginx-unit.control.sock status +``` + ### Send arbitrary configuration payloads to Unit ``` $ echo '{ @@ -158,6 +180,13 @@ $ echo '{ } ``` +*Note:* This command supports operating on multiple instances of Unit at once. +To do this, pass multiple values for the `-s` flag as shown below: + +``` +$ unitctl -s '127.0.0.1:8001' -s /run/nginx-unit.control.sock execute ... +``` + ### Edit current configuration in your favorite editor ``` $ unitctl edit @@ -168,6 +197,8 @@ $ unitctl edit } ``` +*Note:* This command does not support operating on multiple instances of Unit at once. + ### Import configuration, certificates, and NJS modules from directory ``` $ unitctl import /opt/unit/config @@ -191,6 +222,8 @@ $ unitctl export -f - > config.tar *Note:* The exported configuration omits certificates. +*Note:* This command does not support operating on multiple instances of Unit at once. + ### Wait for socket to become available ``` $ unitctl --wait-timeout-seconds=3 --wait-max-tries=4 import /opt/unit/config` |