FrauBSD / beegfs_stats

Daemons for pulling beegfstop data into InfluxDB
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

/etc/init.d/beegfs_clientstatsd: 11: .: Can't open /etc/rc.d/init.d/functions #1

Open Ashok0586 opened 2 years ago

Ashok0586 commented 2 years ago

while staring the service

service beegfs_clientstatsd start

/etc/init.d/beegfs_clientstatsd: 11: .: Can't open /etc/rc.d/init.d/functions

below files are missing:- can help me to fix it

freebsdfrau commented 2 years ago

Thank you very much for reporting this. I can absolutely help fix this.

What Operating System are you using?

Ashok0586 commented 2 years ago

Thank you.. i am using the ubuntu 20.04 on the beegfs server side and arch on the client. while we have comment the

. /etc/rc.d/init.d/functions

in all path now the service is running but i am not able to get the graph.

freebsdfrau commented 2 years ago

To get a graph in Grafana, what you want to do is point a telegraf daemon at the JSON log and have it inject the data to your database of choice (I recommend Influx -- it's what the dashboards in the grafana directory use).

There are actually multiple daemons for multiple dashboards.

You've assuaged the issue for beegfs_clientstatsd service and got it running. This service runs "/usr/bin/beegfstop -cji60" in the background and stores the output in /var/log/beegfs_stats.log (JSON format).

ASIDE: The "-cji60" to beegfstop requests client-specific stats (-c) in JSON format (-j) every 60 seconds (-i60).

In order to get a graph, you need to then take the data produced by that service and -- through another service in this GitHub repo -- hoist that data into a database.

ASIDE: There are multiple services that dump to the same file. For example, the beegfs_clientstatsd service AND the beegfs_serverstatsd service AND the beegfs_userstatsd service ALL write to /var/log/beegfs_stats.log -- the ident property of the JSON data written to the file tells you which daemon wrote data. Likewise, there are three daemons that write to /var/log/beegfs_mstats.log (where m here is for metadata). The services beegfs_clientmstatsd, beegfs_servermstatsd, and beegfs_usermstatsd all write to /var/log/beegfs_mstats.log (where beegfs_stats.log is about regular data and beegfs_mstats.log is about metadata). Again, the ident JSON property of each data segment in either log identifies which service produced the data, be it client, server, or user centric.

There are two services that hoist the JSON data. beegfs_stats and beegfs_mstats are the watchers that use telegraf to upload the JSON data to the database.

beegfs_stats watches /var/log/beegfs_stats.log beegfs_mstats watches /var/log/beegfs_mstats.log

We can see here:

https://github.com/FrauBSD/beegfs_stats/blob/66ada22e9f646d5ebba7fa55f03a5a5495a2a0c3/beegfs_stats#L43

and here:

https://github.com/FrauBSD/beegfs_stats/blob/66ada22e9f646d5ebba7fa55f03a5a5495a2a0c3/beegfs_mstats#L43

That the beegfs_stats and beegfs_mstats services/utilities simply invoke telegraf to read either /etc/beegfs_stats.conf or /etc/beegfs_mstats.conf (respectively).

The telegraf config is where all the magic happens. For example:

https://github.com/FrauBSD/beegfs_stats/blob/master/etc/beegfs_stats.conf

Wherein you change "somehost" to be your InfluxDB host. Note that database creation is disabled so that you can get it set up before the data comes in -- upon executing influx -execute "create database beegfs_stats" for example (also taking care to create the beegfs_mstats database at the same time, if-so desired).

The command that I use to make sure that data has successfully arrived at Influx by-way of telegraf watching the JSON log file is to run influx -database beegfs_stats -execute "show tag keys" -- the command should always run quickly regardless of how much data you have stored (I recommend setting a retention policy of 2-4 weeks). If no data has arrived, the command will show no tags, but if the data has arrived -- and all 3 of beegfs_{client,user,server}statsd are writing to the log being processed by telegraf, then you should see these tags in the (beegfs_stats) database:

name: tail
tagKey
------
client
host
ident
path
server
uid
user

ASIDE: The tags for the mstats database (beegfs_mstats) are identical. ASIDE: You can also say influx -database beegfs_mstats -execute "show field keys" (and this does differ between beegfs_stats database and beegfs_mstats as the fields for tracking data utilization versus metadata are quite different).

Once you have data in the database, it's only a matter of telling Grafana about the InfluxDB data source and then importing the dashboard JSON for the dashboards in this GitHub repo.