zabbix数据数据量大如何备份
由于线上zabbix的数据较大,data目录将近1.7T的数据,但这些数据主要都是一些历史数据
查看zabbix的各个表的大小:
mysql -uzabbix -p
MariaDB [zabbix]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| zabbix |
+--------------------+
2 rows in set (0.000 sec)
MariaDB [zabbix]> SELECT TABLE_NAME,DATA_LENGTH,INDEX_LENGTH,(DATA_LENGTH+INDEX_LENGTH) as length,TABLE_ROWS,concat(round((DATA_LENGTH+INDEX_LENGTH)/1024/1024,3), 'MB') as total_size FROM information_schema.TABLES WHERE TABLE_SCHEMA='zabbix' order by length desc;
+----------------------------+--------------+--------------+--------------+------------+--------------+
| TABLE_NAME | DATA_LENGTH | INDEX_LENGTH | length | TABLE_ROWS | total_size |
+----------------------------+--------------+--------------+--------------+------------+--------------+
| history_uint | 314004586496 | 219262763008 | 533267349504 | 5157074500 | 508563.375MB |
| history | 236318736384 | 170171023360 | 406489759744 | 3919360397 | 387658.844MB |
| history_text | 383274565632 | 7263895552 | 390538461184 | 252181395 | 372446.500MB |
| trends_uint | 142742749184 | 0 | 142742749184 | 1630448517 | 136130.094MB |
| trends | 83559415808 | 0 | 83559415808 | 967417853 | 79688.469MB |
| history_log | 16248700928 | 386727936 | 16635428864 | 13777815 | 15864.781MB |
| alerts | 2275393536 | 510099456 | 2785492992 | 2071400 | 2656.453MB |
| history_str | 1230585856 | 729366528 | 1959952384 | 19407623 | 1869.156MB |
| sessions | 270532608 | 325058560 | 595591168 | 3507460 | 568.000MB |
| auditlog | 278724608 | 169197568 | 447922176 | 3584870 | 427.172MB |
| events | 171655168 | 116768768 | 288423936 | 1380775 | 275.063MB |
| items | 79282176 | 60014592 | 139296768 | 301355 | 132.844MB |
| housekeeper | 89784320 | 0 | 89784320 | 1658125 | 85.625MB |
| event_recovery | 39927808 | 30474240 | 70402048 | 728272 | 67.141MB |
| items_applications | 26689536 | 31293440 | 57982976 | 361339 | 55.297MB |
| triggers | 35192832 | 14172160 | 49364992 | 180716 | 47.078MB |
| item_discovery | 22593536 | 18841600 | 41435136 | 210868 | 39.516MB |
| item_rtdata | 31965184 | 0 | 31965184 | 321620 | 30.484MB |
| problem | 20496384 | 11059200 | 31555584 | 85546 | 30.094MB |
| functions | 11026432 | 17891328 | 28917760 | 185402 | 27.578MB |
| graphs | 7880704 | 8454144 | 16334848 | 50587 | 15.578MB |
| graphs_items | 8929280 | 7372800 | 16302080 | 114126 | 15.547MB |
| trigger_discovery | 7864320 | 4702208 | 12566528 | 136780 | 11.984MB |
| item_preproc | 6832128 | 3653632 | 10485760 | 86456 | 10.000MB |
| application_template | 1572864 | 2998272 | 4571136 | 24629 | 4.359MB |
| event_tag | 2637824 | 1589248 | 4227072 | 34345 | 4.031MB |
| auditlog_details | 3686400 | 442368 | 4128768 | 15647 | 3.938MB |
| graph_discovery | 2588672 | 1490944 | 4079616 | 36381 | 3.891MB |
| applications | 1589248 | 1589248 | 3178496 | 26506 | 3.031MB |
| images | 1589248 | 16384 | 1605632 | 138 | 1.531MB |
| profiles | 524288 | 606208 | 1130496 | 5014 | 1.078MB |
| hosts | 409600 | 540672 | 950272 | 2024 | 0.906MB |
| widget_field | 278528 | 524288 | 802816 | 3068 | 0.766MB |
| hosts_templates | 311296 | 376832 | 688128 | 5401 | 0.656MB |
| autoreg_host | 327680 | 262144 | 589824 | 2880 | 0.563MB |
| item_condition | 360448 | 114688 | 475136 | 3916 | 0.453MB |
| interface | 212992 | 262144 | 475136 | 2090 | 0.453MB |
| hosts_groups | 131072 | 196608 | 327680 | 2171 | 0.313MB |
| hostmacro | 131072 | 114688 | 245760 | 1422 | 0.234MB |
| trigger_depends | 98304 | 131072 | 229376 | 1340 | 0.219MB |
| problem_tag | 114688 | 98304 | 212992 | 1426 | 0.203MB |
| actions | 131072 | 32768 | 163840 | 103 | 0.156MB |
| opmessage | 114688 | 16384 | 131072 | 251 | 0.125MB |
| items_part1 | 16384 | 98304 | 114688 | 52 | 0.109MB |
| escalations | 65536 | 49152 | 114688 | 407 | 0.109MB |
| sysmaps_elements | 16384 | 81920 | 98304 | 2 | 0.094MB |
| httptest | 16384 | 65536 | 81920 | 22 | 0.078MB |
| media | 49152 | 32768 | 81920 | 193 | 0.078MB |
| sysmaps | 16384 | 65536 | 81920 | 0 | 0.078MB |
| rights | 49152 | 32768 | 81920 | 382 | 0.078MB |
| mappings | 65536 | 16384 | 81920 | 707 | 0.078MB |
| lld_macro_path | 49152 | 16384 | 65536 | 276 | 0.063MB |
| users | 49152 | 16384 | 65536 | 106 | 0.063MB |
| scripts | 16384 | 49152 | 65536 | 3 | 0.063MB |
| event_suppress | 16384 | 49152 |