Crates.io | sozuctl |
lib.rs | sozuctl |
version | 0.13.0 |
source | src |
created_at | 2017-04-04 16:23:19.552533 |
updated_at | 2021-07-08 09:34:20.327564 |
description | command line application to configure a sozu instance |
homepage | http://sozu.io |
repository | https://github.com/sozu-proxy/sozu |
max_upload_size | |
id | 9600 |
size | 117,948 |
Sozuctl is a command line interface for the proxy. You can send configuration orders (e.g. Add a new worker) or reclaim some metrics at the proxy with this executable. Sozuctl talks to the proxy through a unix socket.
You can specify its path by adding to your config.toml
:
command_socket = "path/to/your/command_folder/sock"
First you need to create a new application with an id and a load balancing policy (roundrobin or random):
sozuctl --config /etc/sozu/config.toml application add --id <my_application_id> --load-balancing-policy roundrobin
It won't show anything but you can verify that the application has been added successfully by querying sozu:
sozuctl --config /etc/sozu/config.toml query applications
Then you need to add a backend:
sozuctl --config /etc/sozu/config.toml backend add --address 127.0.0.1:3000 --backend-id <my_backend_id> --id <my_application_id>
Finally you have to create a frontend to allow sozu to send traffic from the listener to your backend:
sozuctl --config /etc/sozu/config.toml frontend http add --address 0.0.0.0:80 --hostname <my_application_hostname> --id <my_application_id>
It shows a list of workers and show informations about their statuses.
sozuctl --config /etc/sozu/config.toml status
It will show global statistics about sozu, workers and applications metrics.
sozuctl --config /etc/sozu/config.toml metrics
If sozu configurations (applications, frontends & backends) are not written in the config file, you can save sozu state to restore it later.
sozuctl --config /etc/sozu/config.toml state save --file state.json
Then shutdown gracefully sozu:
sozuctl --config /etc/sozu/config.toml shutdown
Restart sozu and restore its state:
sozuctl --config /etc/sozu/config.toml state load --file state.json
You should be able to request your application like before the shutdown.