Thanks @jayeff
So I made the following change in the file: /etc/systemd/system/cratedb-prometheus-adapter.service:
Added the Line:
CRATEDB_PROMETHEUS_ADAPTER_OPTS=-config.file=/etc/cratedb-prometheus-adapter/config.yml
Next, this is what the actual file looks like now with the added line:
# -*- mode: conf -*-
[Unit]
Description=Prometheus adapter to write to CrateDB
Documentation=https://github.com/crate/cratedb-prometheus-adapter/
After=network.target
[Service]
EnvironmentFile=-/etc/cratedb-prometheus-adapter/config.yml
CRATEDB_PROMETHEUS_ADAPTER_OPTS=-config.file=/etc/cratedb-prometheus-adapter/config.yml
User=prometheus
ExecStart=/usr/bin/cratedb-prometheus-adapter $CRATEDB_PROMETHEUS_ADAPTER_OPTS
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
LimitNOFILE=65536
LimitNPROC=4096
Now the file “/etc/cratedb-prometheus-adapter/config.yml” is referenced in the “cat /etc/cratedb-prometheus-adapter/config.yml” variable.
Below is the content of that file:
cratedb_endpoints:
- host: "localhost" # Host to connect to (default: "localhost").
port: 5432 # Port to connect to (default: 5432).
user: "crate" # Username to use (default: "crate")
password: "" # Password to use (default: "").
schema: "" # Schema to use (default: "").
connect_timeout: 10 # TCP connect timeout (seconds) (default: 10).
max_connections: 5 # The maximum number of concurrent connections (default: 5).
enable_tls: false # Whether to connect using TLS (default: false).
allow_insecure_tls: false # Whether to allow insecure / invalid TLS certificates (default: false).
Finally, I attempt to start the service and then check the status:
systemctl start cratedb-prometheus-adapter
Checking the status:
systemctl status cratedb-prometheus-adapter
â—Ź cratedb-prometheus-adapter.service - Prometheus adapter to write to CrateDB
Loaded: loaded (/etc/systemd/system/cratedb-prometheus-adapter.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2022-01-14 12:50:10 EST; 4s ago
Docs: https://github.com/crate/cratedb-prometheus-adapter/
Process: 863958 ExecStart=/usr/bin/cratedb-prometheus-adapter $CRATEDB_PROMETHEUS_ADAPTER_OPTS (code=exited, status=1/FAILURE)
Main PID: 863958 (code=exited, status=1/FAILURE)
Jan 14 12:50:10 myhostsrv1 systemd[1]: cratedb-prometheus-adapter.service: Service RestartSec=100ms expired, scheduling restart.
Jan 14 12:50:10 myhostsrv1 systemd[1]: cratedb-prometheus-adapter.service: Scheduled restart job, restart counter is at 5.
Jan 14 12:50:10 myhostsrv1 systemd[1]: Stopped Prometheus adapter to write to CrateDB.
Jan 14 12:50:10 myhostsrv1 systemd[1]: cratedb-prometheus-adapter.service: Start request repeated too quickly.
Jan 14 12:50:10 myhostsrv1 systemd[1]: cratedb-prometheus-adapter.service: Failed with result 'exit-code'.
Jan 14 12:50:10 myhostsrv1 systemd[1]: Failed to start Prometheus adapter to write to CrateDB.
Unfortunately it still fails to start the cratedb-protheus service.
When I check the prometheus service, it continues to run just fine as you can see from the output below of the status command:
systemctl status prometheus.service
â—Ź prometheus.service - Prometheus
Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-01-14 13:04:35 EST; 30s ago
Docs: https://prometheus.io/docs/introduction/overview/
Main PID: 864985 (prometheus)
Tasks: 14 (limit: 410197)
Memory: 45.5M
CGroup: /system.slice/prometheus.service
└─864985 /usr/local/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus ->
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.333Z caller=main.go:945 level=info fs_type=EXT4_SUPER_MAGIC
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.333Z caller=main.go:948 level=info msg="TSDB started"
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.333Z caller=main.go:1129 level=info msg="Loading configuratio>
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.334Z caller=dedupe.go:112 component=remote level=info remote_>
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.334Z caller=dedupe.go:112 component=remote level=info remote_>
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.334Z caller=dedupe.go:112 component=remote level=info remote_>
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.341Z caller=main.go:1166 level=info msg="Completed loading of>
Jan 14 13:04:36 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:36.341Z caller=main.go:897 level=info msg="Server is ready to re>
Jan 14 13:04:46 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:46.165Z caller=dedupe.go:112 component=remote level=info remote_>
Jan 14 13:04:46 myhostsrv1 prometheus[864985]: ts=2022-01-14T18:04:46.196Z caller=dedupe.go:112 component=remote level=warn remote_
Not sure what else may be missing.
Any other suggestion, we be appreciated.
Thanks