Improve install instructions.
All checks were successful
Build Docker image / build (push) Successful in 1m17s
Build Golang packages / release (push) Has been skipped

This commit is contained in:
Pieter Hollander 2024-03-27 09:50:37 +01:00
parent d88d3fdef6
commit dfb5721e25
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -6,6 +6,8 @@ Optionally, TimescaleDB can be used.
## Install instructions ## Install instructions
Docker is the preferred way to install OpenDTU Logger, but using the binary is also possible.
### Docker ### Docker
```sh ```sh
@ -44,6 +46,12 @@ Add the contents of `systemd/opendtu-logger.service` and alter the `REMOTE_URL`
### PostgreSQL setup ### PostgreSQL setup
To install PostgreSQL on Debian / Ubuntu run
```sh
sudo apt install postgresql
```
The OpenDTU logger logs to a PostgreSQL database and optionally supports TimescaleDB. Create a separate database and user using the following commands. The OpenDTU logger logs to a PostgreSQL database and optionally supports TimescaleDB. Create a separate database and user using the following commands.
```sql ```sql
@ -53,7 +61,7 @@ GRANT ALL privileges ON DATABASE opendtu_logger TO opendtu_logger;
GRANT ALL ON SCHEMA public TO opendtu_logger; GRANT ALL ON SCHEMA public TO opendtu_logger;
``` ```
Optional: enable TimescaleDB extension Optional: enable the TimescaleDB extension. To make use of TimescaleDB, follow the steps outlined in [their documentation](https://docs.timescale.com/self-hosted/latest/install/installation-linux/). Then, enable TimescaleDB support for the `opendtu_logger` database by executing the following commands
```sql ```sql
\c opendtu_logger \c opendtu_logger
@ -71,9 +79,14 @@ TIMESCALEDB_ENABLED="true"
TZ="Europe/Amsterdam" TZ="Europe/Amsterdam"
``` ```
- `REMOTE_URL`is used to specify the IP address or hostname OpenDTU is running on. E.g.: `192.168.1.6` or `opendtu.internal`
- `DB_URL` specifies the credentials required to connect to the PostgreSQL database. All [connection parameters documented by golang's `lib/pq` package](https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters) can be used.
- `TIMESCALEDB_ENABLED` should be set to `true` or `false`.
- `TZ` is used to ensure data is recorded with the right timestamp. Choose the timezone valid for your location from [this Wikipedia page](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
## Grafana ## Grafana
The `grafana` folder contains example dashboards. The `grafana` folder contains example dashboards which can be imported into existing Grafana installs, or into the provided Docker Compose with Grafana setup.
- The `opendtu_` dashboards contain visualisations for each table the OpenDTU logger records to. - The `opendtu_` dashboards contain visualisations for each table the OpenDTU logger records to.
- `PV.json` is a dashboard which combines the visualisations of each table that I found to be most useful. - `PV.json` is a dashboard which combines the visualisations of each table that I found to be most useful.