伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

监控系统项目实施--安装与部署-- MySQL数据库--分区表创建2

来源:本站原创 浏览:90次 时间:2022-06-15
历史记录表进行处理
[root@zabbix-mysql01 ~]# mysql -uroot -pRoot@123456mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 12Server version: 8.0.23 MySQL Community Server - GPLCopyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> use zabbixReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> mysql> mysql> truncate table history;                              optimize table history;              Query OK, 0 rows affected (0.01 sec)mysql> optimize table history;              truncate table history_str;          +----------------+----------+----------+-------------------------------------------------------------------+| Table          | Op       | Msg_type | Msg_text                                                          |+----------------+----------+----------+-------------------------------------------------------------------+| zabbix.history | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.history | optimize | status   | OK                                                                |+----------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.01 sec)mysql> truncate table history_str;          optimize table history_str;          Query OK, 0 rows affected (0.01 sec)mysql> optimize table history_str;          truncate table history_uint;         optimize table history_uint;  truncate table history_log;   +--------------------+----------+----------+-------------------------------------------------------------------+| Table              | Op       | Msg_type | Msg_text                                                          |+--------------------+----------+----------+-------------------------------------------------------------------+| zabbix.history_str | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.history_str | optimize | status   | OK                                                                |+--------------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.02 sec)mysql> truncate table history_uint;         optimize table history_log;   Query OK, 0 rows affected (0.01 sec)mysql> optimize table history_uint;  truncate table history_text;  optimize table history_text;      +---------------------+----------+----------+-------------------------------------------------------------------+| Table               | Op       | Msg_type | Msg_text                                                          |+---------------------+----------+----------+-------------------------------------------------------------------+| zabbix.history_uint | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.history_uint | optimize | status   | OK                                                                |+---------------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.01 sec)mysql> truncate table history_log;   truncate table trends;               Query OK, 0 rows affected (0.01 sec)mysql> optimize table history_log;   optimize table trends;               truncate table trends_uint;          ptimize table trends_uint;  +--------------------+----------+----------+-------------------------------------------------------------------+| Table              | Op       | Msg_type | Msg_text                                                          |+--------------------+----------+----------+-------------------------------------------------------------------+| zabbix.history_log | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.history_log | optimize | status   | OK                                                                |+--------------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.02 sec)mysql> truncate table history_text;  Query OK, 0 rows affected (0.00 sec)mysql> optimize table history_text;      +---------------------+----------+----------+-------------------------------------------------------------------+| Table               | Op       | Msg_type | Msg_text                                                          |+---------------------+----------+----------+-------------------------------------------------------------------+| zabbix.history_text | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.history_text | optimize | status   | OK                                                                |+---------------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.02 sec)mysql> truncate table trends;               Query OK, 0 rows affected (0.01 sec)mysql> optimize table trends;               +---------------+----------+----------+-------------------------------------------------------------------+| Table         | Op       | Msg_type | Msg_text                                                          |+---------------+----------+----------+-------------------------------------------------------------------+| zabbix.trends | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.trends | optimize | status   | OK                                                                |+---------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.01 sec)mysql> truncate table trends_uint;          Query OK, 0 rows affected (0.01 sec)mysql> optimize table trends_uint;+--------------------+----------+----------+-------------------------------------------------------------------+| Table              | Op       | Msg_type | Msg_text                                                          |+--------------------+----------+----------+-------------------------------------------------------------------+| zabbix.trends_uint | optimize | note     | Table does not support optimize, doing recreate + analyze instead || zabbix.trends_uint | optimize | status   | OK                                                                |+--------------------+----------+----------+-------------------------------------------------------------------+2 rows in set (0.01 sec)mysql> 
运行分区脚本
[root@zabbix-mysql01 ~]# sh partitiontables_zabbix.sh mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210320mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210320mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210320mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210320mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210320mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210321mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210321mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210321mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210321mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210321mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210322mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210322mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210322mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210322mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210322mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210323mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210323mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210323mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210323mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210323mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210324mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210324mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210324mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210324mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210324mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210325mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210325mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210325mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210325mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210325mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210326mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210326mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210326mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210326mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210326mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history      create partitions p20210327mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_log  create partitions p20210327mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_str  create partitions p20210327mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_text create partitions p20210327mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table history_uint create partitions p20210327mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202103mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202103mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202104mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202104mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202105mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202105mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202106mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202106mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202107mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202107mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends       create partitions p202108mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.table trends_uint  create partitions p202108mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.mysql: [Warning] Using a password on the command line interface can be insecure.
配置定时任务
the crontab remove old partitions every day    每天的定时任务,是由linux的crontab去实现的,需确保Linux服务器的crond启动成功。否则会引起新分区无法自动创建的问题   shell# crontab -e1 0 * * * /usr/sbin/partitiontables_zabbix.shShell# chmod 700 /usr/sbin/partitiontables_zabbix.sh

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net