Accesso al database
| Code Block |
|---|
$ mysql --host cld-acct.pd.infn.it -u apelro -p apel
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
|
Per vedere quanto ha consumato un certo progetto (es. Kafka-test" in termini di wallclocktime (in secondi) in un certo periodo (es. Luglio 2023) la query e`:
| Code Block |
|---|
[root@cld-acct ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 275462
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [apel]>
|
Esempi di query
Retrieval di tutti i record di accounting per un certo anno per un certo progetto
| Code Block |
|---|
MariaDB [apel]> select Month,GlobalUserName,Status,ImageId,WallDuration,CpuCount,Memory,Disk,NumberOfVMs from VCloudSummaries where VO="OTRI" AND year="2023";
+-------+----------------------------------+---------+--------------------------------------+--------------+----------+--------+------+-------------+
| Month | GlobalUserName | Status | ImageId | WallDuration | CpuCount | Memory | Disk | NumberOfVMs |
+-------+----------------------------------+---------+--------------------------------------+--------------+----------+--------+------+-------------+
| 1 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2678388 | 2 | 4096 | 25 | 1 |
| 1 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2678388 | 1 | 2048 | 10 | 1 |
| 1 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2678388 | 2 | 4096 | 25 | 1 |
| 2 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2419250 | 2 | 4096 | 25 | 1 |
| 2 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2419250 | 1 | 2048 | 10 | 1 |
| 2 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2419250 | 2 | 4096 | 25 | 1 |
| 3 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2674816 | 2 | 4096 | 25 | 1 |
| 3 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2674816 | 1 | 2048 | 10 | 1 |
| 3 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2674816 | 2 | 4096 | 25 | 1 |
| 4 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2592018 | 2 | 4096 | 25 | 1 |
| 4 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2592018 | 1 | 2048 | 10 | 1 |
| 4 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2592018 | 2 | 4096 | 25 | 1 |
| 5 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2678491 | 2 | 4096 | 25 | 1 |
| 5 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2678491 | 1 | 2048 | 10 | 1 |
| 5 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2678491 | 2 | 4096 | 25 | 1 |
| 6 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 2591986 | 2 | 4096 | 25 | 1 |
| 6 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2591986 | 1 | 2048 | 10 | 1 |
| 6 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 2591986 | 2 | 4096 | 25 | 1 |
| 7 | riccardo.dezen@studenti.unipd.it | unknown | 16410b90-6014-47c0-948b-47a6a0041407 | 957667 | 2 | 4096 | 25 | 1 |
| 7 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 957667 | 1 | 2048 | 10 | 1 |
| 7 | riccardo.dezen@studenti.unipd.it | unknown | 59dd477b-77b6-4d14-a54f-b45e30b2a05a | 957667 | 2 | 4096 | 25 | 1 |
+-------+----------------------------------+---------+--------------------------------------+--------------+----------+--------+------+-------------+
21 rows in set (0.01 sec)
|
WallClocktime consumato da un certo progetto in un certo anno
Per vedere quanto ha consumato un certo progetto (es. Kafka-test" in termini di wallclocktime (in secondi) in un certo anno (es. 2023) la query e`:
| Code Block |
|---|
MariaDB [apel]> select SUM(WallDuration * CpuCount) from VCloudSummaries where VO="Kafka-test" AND year="2023";
+------------------------------+
| SUM(WallDuration * CpuCount) |
+------------------------------+
| 128016664 |
+------------------------------+
1 row in set (0.01 sec)
MariaDB [apel]>
|
WallClocktime consumato da un certo progetto in un certo mese
Per vedere quanto ha consumato un certo progetto (es. Kafka-test" in termini di wallclocktime (in secondi) in un certo mese (es. Luglio 2023) la query e`:
| Code Block |
|---|
MariaDB [apel] use apel;
Database changed
MariaDB [apel]>
MariaDB [apel]> select SUM(WallDuration * CpuCount) from VCloudSummaries where VO="Kafka-test" AND year="2023" AND month="7";
+------------------------------+
| SUM(WallDuration * CpuCount) |
+------------------------------+
| 2938016 |
+------------------------------+ |
Backup
Il database viene backup giornamente dal cron backup in /backup-db
Gli ultimi 10 backup vengono copiati su un bucket S3 (s3://apeldb-backup) in rgw.cloudveneto.it (utente con accesskey Dw6gPbi9udi83RYnB8Sq221YmNvvCYAL9XfxFJc) dal cron copy_backup_to_s3_cron