README update

This commit is contained in:
Adam Štrauch 2021-09-05 12:36:02 +02:00
parent 5b7459afb5
commit ced732b7e6
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -47,6 +47,8 @@ The quickest way how to run lobbyd on your server is this:
```shell ```shell
wget -O /usr/local/bin/lobbyd https://.... wget -O /usr/local/bin/lobbyd https://....
chmod +x /usr/local/bin/lobbyd chmod +x /usr/local/bin/lobbyd
wget -O /usr/local/bin/lobbyctl https://....
chmod +x /usr/local/bin/lobbyctl
# Update NATS_URL and LABELS here # Update NATS_URL and LABELS here
cat << EOF > /etc/systemd/system/lobbyd.service cat << EOF > /etc/systemd/system/lobbyd.service
@ -72,6 +74,10 @@ systemctl enable lobbyd
If you run lobbyd in production, consider to create its own system user and group and add both into this If you run lobbyd in production, consider to create its own system user and group and add both into this
service file. It doesn't need to access almost anything in your system. service file. It doesn't need to access almost anything in your system.
To test if local instance is running call this:
lobbyctl discovery
## Daemon ## Daemon
There are other config directives you can use to fine-tune lobbyd to exactly what you need. There are other config directives you can use to fine-tune lobbyd to exactly what you need.
@ -93,6 +99,31 @@ There are other config directives you can use to fine-tune lobbyd to exactly wha
| NODE_EXPORTER_PORT | int | 9100 | no | Default port where node_exporter listens on all registered servers, this is used when the special prometheus labels doesn't contain port | | NODE_EXPORTER_PORT | int | 9100 | no | Default port where node_exporter listens on all registered servers, this is used when the special prometheus labels doesn't contain port |
| REGISTER | bool | true | no | If true (default) then local instance is registered with other instance (discovery packet is sent regularly), if false the daemon runs only as a client | | REGISTER | bool | true | no | If true (default) then local instance is registered with other instance (discovery packet is sent regularly), if false the daemon runs only as a client |
## Command line tool
To access your servers from command line or shell scripts you can use *lobbyctl*.
```
Usage of lobbyctl:
-host string
Hostname or IP address of lobby daemon
-port uint
Port of lobby daemon
-proto string
Select HTTP or HTTPS protocol
-token string
Token needed to communicate lobby daemon, if empty auth is disabled
Commands:
discovery returns discovery packet of the server where the client is connected to
discoveries returns list of all registered discovery packets
labels add LABEL [LABEL] ... adds new runtime labels
labels del LABEL [LABEL] ... deletes runtime labels
```
It uses Go client library also located in this repository.
### Service discovery for Prometheus ### Service discovery for Prometheus
Lobbyd has an API endpoint that returns list of targets for [Prometheus's HTTP SD config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config). That Lobbyd has an API endpoint that returns list of targets for [Prometheus's HTTP SD config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config). That