sozuctl

Crates.iosozuctl
lib.rssozuctl
version0.13.0
sourcesrc
created_at2017-04-04 16:23:19.552533
updated_at2021-07-08 09:34:20.327564
descriptioncommand line application to configure a sozu instance
homepagehttp://sozu.io
repositoryhttps://github.com/sozu-proxy/sozu
max_upload_size
id9600
size117,948
owners (github:sozu-proxy:owners)

documentation

https://docs.rs/sozuctl

README

sozuctl, a command line interface for the sozu proxy

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"

Add application with http frontend

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>

Check the status of sozu

It shows a list of workers and show informations about their statuses.

sozuctl --config /etc/sozu/config.toml status

Get metrics and statistics

It will show global statistics about sozu, workers and applications metrics.

sozuctl --config /etc/sozu/config.toml metrics

Dump and restore state

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.

Commit count: 3525

cargo fmt