Multi instance monitoring
smycek opened this issue · 8 comments
Do you have some recommendations or best practice when setting up monitoring multiple Nextcloud Instances?
I personally have no experience with monitoring a large Nextcloud installation, because I only host relatively small ones.
Exporters usually have a 1:1 relationship with the service they are monitoring. In this case this could be interpreted as one of the following:
- one exporter instancer per server hosting the Nextcloud instance
- one exporter per "logical Nextcloud instance"
I'm leaning towards the second one, because the exporter mostly monitors metrics of the Nextcloud installation and not the underlying server, for which there should be other exporters available already.
We run a nextcloud installation of 10 Nextcloud-Apache-Hosts in front of DB- and Redis-Clusters.
For the monitoring we have an additional host fully equipped with nextclouds code. On this node we query the serverinfo.php to write the output into our time-series-database.
Detailed metrics (OS, Filesystems etc.) of the servers we collect with an extra server-agent on all servers, that indepently writes this metrics into our monitoring-database.
I can confirm, that querying the nextcloud endpoint only from one server is suitable in larger setups, too. Although at some scaling point this will ran into some issues and timeouts with the storage-countings they implemented there. But it reports the metrics for the whole "logical Nextclound instance".
Because of the scaling issues, we experimenting now with this nextcloud-exporter, instead of running the serverinf.php-polling locally. :)
Hi,
I just want to share my setup, with "multi" (3 instances).
For example, config files are thrown in "/etc/prometheus_nextcloud_exporter/".
Then I created this unitfile, which is suitable for multiple instance of the nc-exporter: /etc/systemd/system/prometheus_nextcloud_exporter@.service
[Unit]
Description=%i service for prometheus exporter for nextcloud
Requires=nginx.service
After=nginx.service
[Service]
Type=simple
RemainAfterExit=true
ExecStart=prometheus_nextcloud_exporter -c /etc/prometheus_nextcloud_exporter/%i.yml
[Install]
WantedBy=multi-user.target
where
systemctl start prometheus_nextcloud_exporter@nextcloud_instance_1
i.e. is
/etc/prometheus_nextcloud_exporter/nextcloud_instance_1.yml
this is actually just what i ws looking for! awesome!
Just for info: To cope with the scaling issues while counting files-statistics in large installation nextcloud tranferred theses queries to a long-running background cronjob (since Version 21.0.2 - nextcloud/serverinfo#298).
@smycek Has any of the existing posts answered your questions? Would it be okay to close the issue?
My question has been answered, I am fine if you close the issue. Thanks to everybody!
Great. Thanks for the input, everyone.