Locations of visitors to this page
Showing posts with label administration. Show all posts
Showing posts with label administration. Show all posts

Tuesday, August 16, 2011

MySQL General Query Log

MySQL General Query Log


==参考文档==
The General Query Log: http://dev.mysql.com/doc/refman/5.1/en/query-log.html
Selecting General Query and Slow Query Log Output Destinations: http://dev.mysql.com/doc/refman/5.1/en/log-destinations.html
mysql-5.1.52.tar.gz mysql-5.1.52.tar.gz


==系统变量==
MySQL 5.1.29+
* general_log 普通查询日志开关
* general_log_file 普通查询日志文件名
* log_output 日志输出方式
* sql_log_off 会话级普通查询日志开关


==代码分析==

* 日志相关操作的代码文件是:sql/log.cc和sql/log.h

* 记录日志函数只有两个:general_log_write和general_log_print
** 两者区别主要是输入的参数不一样,general_log_print是可变参数的,general_log_write参数数量是固定的

* 函数内判断操作是否需要记录日志。判断依据是:
  if (*general_log_handler_list && (what_to_log & (1L << (uint) command)))

what_to_log变量在sql/mysqld.cc初始化为二进制的15个1(COM_TIME等于15)
what_to_log= ~ (1L << (uint) COM_TIME);

因此判断条件(what_to_log & (1L << (uint) command))总是真的,默认所有操作都被记录。好像没有手工设置what_to_log的地方?

* MySQL其它程序调general_log_write或general_log_print函数写日志,比如当建立连接、退出、查询等操作时。经查看代码,有以下地方记录日志:
** sql/sql_connect.cc
*** check_user(connect和change user都调用此函数)
**** ER_NOT_SUPPORTED_AUTH_MODE和ER_SERVER_IS_IN_SECURE_AUTH_MODE,ER_ACCESS_DENIED_ERROR记录日志:general_log_print COM_CONNECT
**** 认证通过后也记录日志:general_log_print command(COM_CONNECT或COM_CHANGE_USER)
** sql/sql_parse.cc
*** COM_INIT_DB
**** use命令执行成功后记录日志 general_log_write
*** COM_QUERY general_log_write
*** COM_FIELD_LIST general_log_print
*** COM_QUIT general_log_print
*** COM_CREATE_DB general_log_print
*** COM_DROP_DB general_log_write
*** COM_BINLOG_DUMP general_log_print
*** COM_REFRESH general_log_print
*** COM_SHUTDOWN general_log_print
*** COM_STATISTICS general_log_print
*** COM_PROCESS_INFO general_log_print
*** COM_DEBUG general_log_print
** sql/sql_prepare.cc
*** mysqld_stmt_reset general_log_print (COM_STMT_RESET)
*** mysqld_stmt_close general_log_print (COM_STMT_CLOSE)
*** mysql_stmt_get_longdata general_log_print (COM_STMT_SEND_LONG_DATA)
*** Prepared_statement::prepare
**** 存储过程内语句不记录日志 general_log_write COM_STMT_PREPARE
*** Prepared_statement::execute
**** 存储过程内语句不记录日志 general_log_write COM_STMT_EXECUTE
** sql/sp_head.cc
*** sp_instr_stmt::execute
**** general_log_write COM_QUERY
** sql/sql_show.cc
*** mysqld_show_create_db
*** 当权限不够时记录日志 general_log_print COM_INIT_DB
** sql/log_event.cc
*** Query_log_event::do_apply_event
**** If the query was not ignored, it is printed to the general log general_log_write COM_QUERY
*** Xid_log_event::do_apply_event
**** For a slave Xid_log_event is COMMIT general_log_print COM_QUERY
** sql/slave.cc
*** connect_to_master
**** slave重连接master时记录日志 general_log_print COM_CONNECT_OUT
** sql/sql_db.cc
*** mysql_change_db
**** ER_DBACCESS_DENIED_ERROR无权限访问数据库 general_log_print COM_INIT_DB

* 这两个函数内分别调用了LOGGER::general_log_write和LOGGER::general_log_print方法
* LOGGER::general_log_print又调用了LOGGER::general_log_write
* LOGGER::general_log_write根据log_output变量设置的日志输出方式,可能有多个,再调用当前日志句柄中的log_general方法

* Log_to_csv_event_handler::log_general

...


==格式==

===表===
# 当前时间
# 用户名和主机名
## 格式是:priv_user[user] @ host[ip]
# 线程标识
# 命令类型
# 查询语句

===文件===
# 当前时间
# 线程标识
# 命令类型
# 查询语句


==DML操作==
不支持DML操作

===delete===
不能delete日志表
mysql> delete from mysql.general_log;
ERROR 1556 (HY000): You can't use locks with log tables.


避免报错,可rename表名后再操作
SET @old_log_state = @@global.general_log;
SET GLOBAL general_log = 'OFF';
rename table general_log to general_log_tmp;
delete from general_log_tmp;
rename table general_log_tmp to general_log;
SET GLOBAL general_log = @old_log_state;


====相关代码====
sql/lock.cc
int mysql_lock_tables_check(THD *thd, TABLE **tables, uint count, uint flags)
...
      if ((t->reginfo.lock_type >= TL_READ_NO_INSERT)
          || (thd->lex->sql_command == SQLCOM_LOCK_TABLES))
      {
        my_error(ER_CANT_LOCK_LOG_TABLE, MYF(0));
        DBUG_RETURN(1);
      }
...



==DDL操作==
一些DDL操作不被支持

===drop===
不支持在线drop操作
mysql> drop table mysql.general_log;
ERROR 1580 (HY000): You cannot 'DROP' a log table if logging is enabled


====相关代码====
sql/sql_table.cc
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
...
  /* Disable drop of enabled log tables, must be done before name locking */
  for (table= tables; table; table= table->next_local)
  {
    if (check_if_log_table(table->db_length, table->db,
                           table->table_name_length, table->table_name, 1))
    {
      my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP");
      pthread_mutex_unlock(&LOCK_open);
      DBUG_RETURN(1);
    }
  }
...


===truncate===
支持在线truncate


==存储引擎==
默认用CSV存储引擎。只支持CSV或MyISAM
mysql> set global general_log=0;
Query OK, 0 rows affected (0.00 sec)

mysql> alter table mysql.general_log engine=innodb;
ERROR 1579 (HY000): This storage engine cannot be used for log tables"


修改为Innodb存储引擎:
SET @old_log_state = @@global.general_log;
SET GLOBAL general_log = 'OFF';
use mysql
drop table if exists general_log_new;
create table general_log_new like general_log;
alter table general_log_new engine=innodb;
rename table general_log to general_log_old, general_log_new to general_log;
show create table general_log\G
SET GLOBAL general_log = @old_log_state;


====相关代码====
sql/sql_table.cc
bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
  /*
    Check if we attempt to alter mysql.slow_log or
    mysql.general_log table and return an error if
    it is the case.
    TODO: this design is obsolete and will be removed.
  */
  if (table_list && table_list->db && table_list->table_name)
  {
    int table_kind= 0;

    table_kind= check_if_log_table(table_list->db_length, table_list->db,
                                   table_list->table_name_length,
                                   table_list->table_name, 0);

    if (table_kind)
    {
      /* Disable alter of enabled log tables */
      if (logger.is_log_table_enabled(table_kind))
      {
        my_error(ER_BAD_LOG_STATEMENT, MYF(0), "ALTER");
        DBUG_RETURN(TRUE);
      }

      /* Disable alter of log tables to unsupported engine */
      if ((create_info->used_fields & HA_CREATE_USED_ENGINE) &&
          (!create_info->db_type || /* unknown engine */
           !(create_info->db_type->flags & HTON_SUPPORT_LOG_TABLES)))
      {
        my_error(ER_UNSUPORTED_LOG_ENGINE, MYF(0));
        DBUG_RETURN(TRUE);
      }

#ifdef WITH_PARTITION_STORAGE_ENGINE
      if (alter_info->flags & ALTER_PARTITION)
      {
        my_error(ER_WRONG_USAGE, MYF(0), "PARTITION", "log table");
        DBUG_RETURN(TRUE);
      }
#endif
    }
  }
...


HTON_SUPPORT_LOG_TABLES 表示该存储引擎是否支持日志表
$ grep -r HTON_SUPPORT_LOG_TABLES *
sql/sql_table.cc:           !(create_info->db_type->flags & HTON_SUPPORT_LOG_TABLES)))
sql/handler.h:#define HTON_SUPPORT_LOG_TABLES      (1 << 7) //Engine supports log tables
storage/myisam/ha_myisam.cc:  myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
storage/csv/ha_tina.cc:  tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES |




-fin-

Monday, February 21, 2011

Using dNFS clonedb for testing - 使用dNFS搭建测试数据库

Using dNFS clonedb for testing
使用dNFS搭建测试数据库


1. 配置dNFS

1.1. 挂载NFS
编辑/etc/fstab,如:
192.168.1.1:/dbak/xxods /home/oracle/xxodsnew    nfs     rw,bg,hard,intr,nolock,tcp,rsize=32768,wsize=32768,nocto,retry=480  0       0

1.2. 启用nfsodm库
将原odm库改名,并建为nfsodm库的符号连接,如:
ln -s libnfsodm11.so libodm11.so
重启数据库,告警日志显示"Oracle instance running with ODM",说明dNFS已启用
...
  pga_aggregate_target     = 1G
  dg_broker_start          = FALSE
  diagnostic_dest          = "/opt/oracle"
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0
Fri Dec 31 18:13:43 2010
...

1.3. 设置oradism可执行程序的属性
设置oradism可执行程序的属性setuid,执行
root.sh -silent
oradism可执行程序的属性变为:
-rwsr-x--- 1 root   oinstall     68432 Sep  4 22:21 oradism

如不设置,告警日志中将可能会报错"Direct NFS: please check that oradism is setuid",如:
...
space available in the underlying filesystem or ASM diskgroup.
Fri Dec 31 18:19:19 2010
alter database backup controlfile to '/home/oracle/xxodsnew/control_bak.ctl'
Direct NFS: please check that oradism is setuid
Fri Dec 31 18:20:19 2010
Direct NFS: please check that oradism is setuid
Fri Dec 31 18:21:19 2010
Direct NFS: please check that oradism is setuid
Fri Dec 31 18:22:19 2010
Direct NFS: please check that oradism is setuid
Fri Dec 31 18:23:20 2010
Completed: alter database backup controlfile to '/home/oracle/xxodsnew/control_bak.ctl'
Fri Dec 31 18:23:51 2010
Starting background process SMCO
Fri Dec 31 18:23:51 2010
SMCO started with pid=28, OS id=18071
...

1.4. 检查视图
v$dnfs_servers: dnfs服务器
v$dnfs_channels: dnfs网络路径
v$dnfs_files: dnfs文件
v$dnfs_stats: dnfs状态

如:
SQL> SQL> select * from v$dnfs_servers;

        ID
----------
SVRNAME
--------------------------------------------------------------------------------
DIRNAME
--------------------------------------------------------------------------------
   MNTPORT    NFSPORT      WTMAX      RTMAX
---------- ---------- ---------- ----------
         1
192.168.1.1
/dbak/xxods
       721       2049          0          0


外部链接:
Direct NFS: FAQ [ID 954425.1]
Step by Step - Configure Direct NFS Client (DNFS) on Linux [ID 762374.1]
3.2.3 Deciding to Use Direct NFS for Data Files

Mount Options for Oracle files when used with NAS devices [ID 359515.1]




2. 在dnfs上搭建测试库

使用了dnfs写时拷贝技术(copy-on-write),测试库只写入修改的数据块,从而减少了其占用空间。

主要步骤如下:
2.1. 生产机导出nfs目录,试机挂载nfs目录
2.2. 创建生产库数据文件备份,用rman image复制,操作系统复制,或存储快照。数据文件备份存放在nfs目录上。
2.2. 生产库控制文件建跟踪备份
2.4. 测试库修改控制文件,将数据文件路径改为nfs备份目录。修改参数文件一些相应参数
2.5. nomount方式启动测试库,建控制文件
2.6. 执行dbms_dnfs.clonedb_renamefile存储过程,将数据文件备份改名到测试目录下。实际上没有真的改名,备份是只读的,不会有任何改动
2.8. 恢复并打开测试数据库


外部链接:
Oracle Database 11g Direct NFS Clonedb Feature – Part I.
Oracle Database 11g Direct NFS Clonedb Feature – Part I (and a half).
Direct NFS (DNFS) Clonedb in Oracle Database 11g Release 2 (Patchset 11.2.0.2)
Clone your dNFS Production Database for Testing [ID 1210656.1]

NOTE 1210656.1 from MOS:

Clone your dNFS Production Database for Testing [ID 1210656.1]

--------------------------------------------------------------------------------

Modified 17-FEB-2011 Type ANNOUNCEMENT Status PUBLISHED

In this Document
What is being announced?
What do you need to do?



--------------------------------------------------------------------------------



Applies to:
Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.1 - Release: 11.1 to 11.2
Information in this document applies to any platform.
Oracle RDBMS
dNFS
What is being announced?
Cloning a production database is an often needed procedure in customer environments to develop and test new application patches. When new OS releases, Storage software, Application version has to be installed in a production environment, it calls for a thorough testing using the production data. Today this is achieved by making a copy of the production datafiles in a test environment. In addition to the test environment, copies of the production database also made in development environment where application developers are creating their new applications and testing them. All of these require huge amount of storage space to be allocated and managed.

Database cloning process involves copying the entire production database files into the new environment where the development or testing takes place. In addition when customers have multiple test environments, the files need to be copied into each of these test environments. dNFS provides a new feature called clonedb which allows test databases to be cloned instantaneously. dNFS clonedb feature allows customers to set up their test database environment without really copying the production files into the new database environment. The files in the test database are created based on copy-on-write technology, so that only the blocks that are updated in the test database are ever written to the disk. This type of thin-provisioning reduces the amount of storage required for testing and development purposes. In addition to the reduced storage requirement, since the datafiles in the new test environment are not copied, setting up a test database is very quick and instantaneous.

Database cloning in a dNFS environment can be made from a rman full backup/image copy of all the relevant datafiles or from a storage snapshot. The database backup will be used as the backing store for the datafiles in the test database environment. Customers often take or required to take a full backup of their database and these files can be used to create the dnfs clonedb. By making the backup piece as the backing store the production data files are not touched by the test instances and the test instances don't compete for the same resources that the production database is using.
What do you need to do?
Following the few simple steps described below, one can clone a production database in a matter of few minutes. For the below example let us assume that your production database PROD1 is located at ORACLE_HOME=/u01/prod1/oracle. The rman backup of this production database is taken at RMAN_BACKUP_DIR=/u02/oracle/backup/prod1. The user is trying to clone a test database1 at ORACLE_HOME=/u03/test1/oracle and test database2 at ORACLE_HOME=/u03/test2/oracle


1.On your production database take a full rman hot/cold backup. If it is a hot backup make sure your production database is in archivelog mode and all the necessary archivelogs are saved and accessible to the new test database environment.
?To take a hot backup first put the database in hot backup mode.
alter database begin backup;
<Do a rman image copy/OS copy/Storage snapshot for each datafile>
alter database end backup;
?You can also run "backup as copy database format" rman command and get a copy of all your datafiles
Recovery Manager: Release 11.2.0.2.0 - Production on Wed Aug 18 10:25:35 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN-06568: connected to target database: PROD1 (DBID=1985124264, not open)
RMAN-06008: connected to recovery catalog database
RMAN> backup as copy database format '/u02/oracle/backup/prod1/%U' ;
RMAN-03090: Starting backup at AUG 18 2010 10:25:37
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: SID=110 device type=DISK
RMAN-08580: channel ORA_DISK_1: starting datafile copy
RMAN-08522: input datafile file number=00001 name=/u01/prod1/oracle/dbs/tbs_01.f
RMAN-08586: output file name=/u02/oracle/backup/prod1/data_D-PROD1_I-1985124264_TS-SYSTEM_FNO-1_01lll1d6 tag=TAG20100818T102541 RECID=1 STAMP=727352775
RMAN-08581: channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35

The above command creates a backup of all your datafiles in the location
"/u02/oracle/backup/prod1/"
2.Generate backup control file script from your production database by connecting with sysdba privileges and executing 'alter database backup controlfile to trace'. This will generate a trace file in your user_dump_dest directory which contains the create control file command.
3.Generate the testdb_create.sql using the script in the trace file.
SET ECHO ON
SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100
STARTUP NOMOUNT PFILE='/u03/test1/oracle/dbs/testdb1.ora'
CREATE CONTROLFILE REUSE SET DATABASE "testdb1" RESETLOGS ARCHIVELOG
MAXLOGFILES 32 MAXLOGMEMBERS 2 MAXINSTANCES 1
MAXLOGHISTORY 908 LOGFILE
GROUP 1 '/u03/test1/oracle/dbs/t_1alog.f' SIZE 100M BLOCKSIZE 512,
GROUP 2 '/u03/test1/oracle/dbs/t_2alog.f' SIZE 100M BLOCKSIZE 512
DATAFILE
' /u02/oracle/backup/prod1/data_D-PROD1_I-1985124264_TS-SYSTEM_FNO-1_01lll1d6',...CHARACTER SET WE8DEC? ;

make sure you change the name of the database to the test db name and the log directories are pointing to the new testdb environment and use the image copy of the datafiles.
4.Copy spfile from your production db to the testdb environment and change the relevant parameters. In your testdb environment run the testdb_create.sql to create testdb control file. Execute dbms_dnfs.clonedb_renamefile(backup_file_name, new_data_filename) on each datafile in your test database.

SQL> declare
2 begin
3 dbms_dnfs.clonedb_renamefile('/u02/oracle/backup/prod1/data_D-LV1_I-1985124264_TS-SYSTEM_FNO-1_01lll1d6' , 'test1_tbs_01.f');
4 end;
5.PL/SQL procedure successfully completed.
Do this for each datafile in your testdb environment.
6.If you created your test clone from a hotbackup do a recover database recover database using backup controlfile until cancel;
The above command will ask for the archivelogs for the period when the backup was taken and input those file names.
SQL> recover database using backup controlfile until cancel ;
7.Open the database and start running your tests

SQL> alter database open resetlogs ;

At this point your testdb will be available for use and you will be able to read and write to the database. The testdb datafiles will not have allocated any storage for the datafiles. As you start running your test work load, inserts on the datafiles will allocate space on demand.

The above same procedure can be repeated for multiple test database instances using the same backup files. If you have a storage level snapshot taken on the datafile, the rman backup file names can be replaced with the storage snapshot names.

Since all the testdb clones are using the rman backup or the storage snapshot as the backend storage, availability of these files is critical for testdb to run. If the backup files become unavailable, you will see errors in the testdb database.

When it is time to destroy the testdb environment, all files in the test environment can be deleted without any impact on the production or backup environment. As this clonedb feature uses the backup piece as the backing storage, there is no pressure on the I/O subsystem that is servicing the production database. DBA's don't have to hunt for storage equivalent to the size of production database to set up a testdb environment. The testdb storage space usage grows at the speed at which the data is modified.

Work-in-progress - A perl script to automate the above steps is in progress. Using this script one will be able to clone a database by issuing a single command after setting few environment variables.



3. dnfs性能测试


外部链接:
New DNFS Performance Results
Monitoring Direct NFS with Oracle 11g and Solaris… pealing back the layers of the onion.
Direct NFS vs Kernel NFS bake-off with Oracle 11g and Solaris… and the winner is
Kernel NFS fights back… Oracle throughput matches Direct NFS with latest Solaris improvements




-fin-

Monday, October 26, 2009

monitoring io statistics by process

monitoring io statistics by process
监控进程的IO统计信息


1. I/O accounting
Linux内核2.6.20增加了IO审计功能, 要使用这个功能需要首先在编译内核时打开TASK_DELAY_ACCT和TASK_IO_ACCOUNTING参数
RedHat Linux在内核2.6.18-144之后也加入了该功能, 并在RHEL5.4版本(kernel 2.6.18-164)中发布, 可以直接使用

一些基于IO审计的监控工具:
1)IOtop
Iotop is a Python program with a top like UI used to show of behalf of which process is the I / O going on. It requires Python ≥ 2.5 and a Linux kernel ≥ 2.6.20 with the TASK_DELAY_ACCT and TASK_IO_ACCOUNTING options enabled. It requires Python ≥ 2.5 and ≥ Linux kernel 2.6.20 with the TASK_DELAY_ACCT and TASK_IO_ACCOUNTING options enabled.

2)pidstat(SYSSTAT工具之一)
Report I/O statistics (kernels 2.6.20 and later only)

3)Dstat: Versatile resource statistics tool
0.6.7 版本后支持显示topio,topbio

4)htop - an interactive process viewer for Linux
显示RBYTES,WBYTES,IO_RATE等列

5)collectl - Process I/O Stats
2.4.0版本之后支持显示io统计信息, 见Process I/O Stats

外部链接
Red Hat backported I/O accounting to RHEL5
Red Hat Enterprise Linux 5.4 - Release Notes


2. block_dump
设置内核参数block_dump为非零值, 内核将报告所有磁盘读写操作和脏块刷新的信息

下载iodump脚本, 用于分析处理内核报告
wget http://maatkit.googlecode.com/svn/trunk/util/iodump

打开block_dump
echo 1 > /proc/sys/vm/block_dump

通过iodump分析dmesg输出的内核报告
while true; do sleep 1; dmesg -c; done | perl iodump

运行一会儿, 按Ctrl-c停止输出, 得到类似下面的结果
# while true; do sleep 1; dmesg -c; done | perl iodump
# Caught SIGINT.
TASK                   PID      TOTAL       READ      WRITE      DIRTY DEVICES
kjournald              478       1294          0       1294          0 sda2
pdflush              21422        857          0        857          0 sda5, sdb6
kjournald             1752        365          0        365          0 sda5
kjournald             1758        174          0        174          0 sdb6
kjournald             1756         52          0         52          0 sdb5
syslogd              26752         28          0         28          0 sdb6
firefox              12811         27         27          0          0 sdb5
perl                  3003         25         25          0          0 sda2
process_perfdat       3026         12         12          0          0 sda5
bash                 14749          3          3          0          0 sda2
firefox              12654          3          3          0          0 sdb5
bash                  3004          2          2          0          0 sda2
bash                  3017          1          1          0          0 sda2
squid                25555          1          1          0          0 sda2
check_nrpe            3001          1          1          0          0 sda2


最后关闭block_dump
echo 0 > /proc/sys/vm/block_dump

外部链接:
block_dump
How to find per-process I/O statistics on Linux
Monitoring filesystem activity under Linux with block_dump
How can I record what process or kernel activity is using the disk in GNU/Linux?
How to identify what processes are generating IO Wait load.



3. blktrace
支持block trace的内核版本:
– Patch for Linux 2.6.14rc3
(or later, up to 2.6.17)
– Linux 2.6.17 (or later) – built in

安装
yum -y install blktrace

挂载debugfs文件系统
mount -t debugfs debugfs /sys/kernel/debug

运行blktrace
blktrace -d /dev/sda2 -o - | blkparse -i - -s

运行一段时间后, CTRL-C退出, 显示统计信息:
...
...
...
  8,2    0     1576     0.618648628   478  U   N [kjournald] 1
  8,2    0     1577     0.618669180     0  C   W 375869 + 128 [0]
  8,2    0     1578     0.618763920   478  Q   W 376045 + 8 [kjournald]
  8,2    0     1579     0.618765468   478  G   W 376045 + 8 [kjournald]
  8,2    0     1580     0.618766125   478  P   N [kjournald]
  8,2    0     1581     0.618766440   478  I   W 376045 + 8 [kjournald]
  8,2    0     1582     0.618767278   478  U   N [kjournald] 1
  8,2    0     1583     0.618768643   478  D   W 376045 + 8 [kjournald]
  8,2    0     1584     0.618824993     0  C   W 376045 + 8 [0]
blktrace (5609)
 Reads Queued:           0,        0KiB  Writes Queued:           0,        0KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:        2,        8KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:        2,       12KiB
 Read Merges:            0,        0KiB  Write Merges:            0,        0KiB
 IO unplugs:             0               Timer unplugs:           0
 Allocation wait:        0               Allocation wait:         0
 Dispatch wait:          0               Dispatch wait:           0
 Completion wait:        0               Completion wait:         0
kjournald (478)
 Reads Queued:           0,        0KiB  Writes Queued:         330,    1,320KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:       42,    1,320KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:        4,       76KiB
 Read Merges:            0,        0KiB  Write Merges:          288,    1,152KiB
 IO unplugs:            12               Timer unplugs:           0
 Allocation wait:        0               Allocation wait:         0
 Dispatch wait:          0               Dispatch wait:           0
 Completion wait:        0               Completion wait:         0
nagios (5574)
 Reads Queued:           0,        0KiB  Writes Queued:           0,        0KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:        0,        0KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:        1,       16KiB
 Read Merges:            0,        0KiB  Write Merges:            0,        0KiB
 IO unplugs:             0               Timer unplugs:           0
 Allocation wait:        0               Allocation wait:         0
 Dispatch wait:          0               Dispatch wait:           0
 Completion wait:        0               Completion wait:         0
pdflush (776)
 Reads Queued:           0,        0KiB  Writes Queued:         126,      504KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:       33,      132KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:       33,      136KiB
 Read Merges:            0,        0KiB  Write Merges:            1,        4KiB
 IO unplugs:             0               Timer unplugs:           0
 Allocation wait:        0               Allocation wait:         0
 Dispatch wait:          0               Dispatch wait:           0
 Completion wait:        0               Completion wait:         0
swapper (0)
 Reads Queued:           0,        0KiB  Writes Queued:           0,        0KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:      131,      536KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:      233,    2,404KiB
 Read Merges:            0,        0KiB  Write Merges:            0,        0KiB
 IO unplugs:             0               Timer unplugs:           0
 Allocation wait:        0               Allocation wait:         0
 Dispatch wait:          0               Dispatch wait:           0
 Completion wait:        0               Completion wait:         0

CPU0 (8,2):
 Reads Queued:           0,        0KiB  Writes Queued:         456,    1,824KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:      208,    1,996KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:      273,    2,644KiB
 Read Merges:            0,        0KiB  Write Merges:          289,    1,156KiB
 Read depth:             0               Write depth:            20
 IO unplugs:            11               Timer unplugs:           0
CPU2 (8,2):
 Reads Queued:           0,        0KiB  Writes Queued:           0,        0KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:        0,        0KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:        0,        0KiB
 Read Merges:            0,        0KiB  Write Merges:            0,        0KiB
 Read depth:             0               Write depth:            20
 IO unplugs:             1               Timer unplugs:           0

Total (8,2):
 Reads Queued:           0,        0KiB  Writes Queued:         456,    1,824KiB
 Read Dispatches:        0,        0KiB  Write Dispatches:      208,    1,996KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:        0,        0KiB  Writes Completed:      273,    2,644KiB
 Read Merges:            0,        0KiB  Write Merges:          289,    1,156KiB
 IO unplugs:            12               Timer unplugs:           0

Throughput (R/W): 0KiB/s / 4,278KiB/s
Events (8,2): 1,585 entries
Skips: 0 forward (0 -   0.0%)

最后卸载debug文件系统
umount /sys/kernel/debug

外部链接:
Block I/O Layer Tracing: blktrace
blktrace User Guide
Tracing I/O usage on Linux


4. atop
对内核源码打补丁, 能够支持显示每个进程的IO


5. systemtap
例子见http://bpineau.livejournal.com/


6. DTrace
Solaris专用
iotop脚本见Top Ten DTrace (D) Scripts
iotop - display top disk I/O events by process.


7. 其它
pio and topio: for solaris,hp-ux,windows
Psio + other disk I/O by process tools: for solaris only



-fin-

Wednesday, September 23, 2009

introducing maatkit - parallel dump

introducing maatkit - parallel dump
maatkit介绍 - 并行导出

Maatkit是一组为MySQL提供的命令行工具集, 是由Percona公司开发的开源软件
该公司同时还开发了XtraDB存储引擎, XtraBackup热备工具, MySQL增强补丁版本Percona

包括:
  • mk-archiver 将表数据清除或归档到另外的表或文件
  • mk-audit 分析MySQL的配置,概要,操作, 生成报表
  • mk-checksum-filter mk-table-checksum的过滤器
  • mk-deadlock-logger 记录InnoDB的死锁信息
  • mk-duplicate-key-checker 查找重复或冗余的外键和索引
  • mk-fifo-split 将一个文件拆分为多个部分, 输出到FIFO管道(有用吗?)
  • mk-find 按指定规则查找表名, 然后执行操作
  • mk-heartbeat 监视数据库之间复制的延迟
  • mk-log-player 拆分并重演慢速查询日志
  • mk-parallel-dump 多线程导出
  • mk-parallel-restore 多线程导入
  • mk-profile-compact 压缩mk-query-profiler输出
  • mk-query-digest 分析日志
  • mk-query-profiler 查询性能分析工具
  • mk-show-grants 显示用户权限
  • mk-slave-delay 实现备库与主库之间一定的延时
  • mk-slave-find 查找/显示出备库的树型层次结构
  • mk-slave-move 在层次结构中移动备库(什么玩意?)
  • mk-slave-prefetch 在备库上运行SELECT查询语句, 使数据预读取到内存中
  • mk-slave-restart 监测备库发生的错误并重启
  • mk-table-checksum 快速检测两个表的数据是否相同. 可以用来检测备库和主库的数据一致性
  • mk-table-sync 发现并修复不同服务器上的两个表之间的数据差异
  • mk-upgrade 比较2个数据库中语句的运行结果
  • mk-visual-explain 以树形显示执行计划



1. 安装
http://maatkit.googlecode.com/处下载RPM包进行安装
yum -y install perl-TermReadKey.x86_64
rpm -Uvh http://maatkit.googlecode.com/files/maatkit-4623-1.noarch.rpm

依赖以下安装包
# rpm -q --requires maatkit
/usr/bin/env
perl(DBD::mysql) >= 1.0
perl(DBI)
perl(DBI) >= 1.13
perl(Data::Dumper)
perl(Digest::MD5)
perl(English)
perl(Exporter)
perl(File::Basename)
perl(File::Find)
perl(File::Spec)
perl(File::Temp)
perl(Getopt::Long)
perl(IO::File)
perl(List::Util)
perl(POSIX)
perl(Socket)
perl(Term::ReadKey) >= 2.10
perl(Time::HiRes)
perl(Time::Local)
perl(constant)
perl(sigtrap)
perl(strict)
perl(warnings)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1


2. 并行导出mk-parallel-dump和导入mk-parallel-restore
使用方法见:
mk-parallel-dump - Dump sets of MySQL tables in parallel.
mk-parallel-restore - Load files into MySQL in parallel.

1) 生成测试表
生成一个3百万行记录的测试表
mysql --socket=/var/lib/mysql/data_3306/mysql.sock

set autocommit=0;
drop database if exists dbtest;
create database dbtest;
use dbtest;
drop table if exists t1;
create table t1 (
  id int(9) not null auto_increment,
  name varchar(20) not null,
  age int(3) not null,
  notes varchar(100),
  primary key (id),
  index ind_t1_name (name)
);
truncate table t1;
insert into t1 (name, age, notes)
select conv(floor(rand() * 99999999999999), 10, 36), floor(1+rand()*(100-1)), md5(rand())
  from information_schema.COLUMNS a
       , information_schema.COLUMNS b
       , information_schema.COLUMNS c
 limit 3000000;
commit;
大小300多M
mysql> insert into t1 (name, age, notes)
    -> select conv(floor(rand() * 99999999999999), 10, 36), floor(1+rand()*(100-1)), md5(rand())
    ->   from information_schema.COLUMNS a
    ->        , information_schema.COLUMNS b
    ->        , information_schema.COLUMNS c
    ->  limit 3000000;
Query OK, 3000000 rows affected (3 min 30.61 sec)
Records: 3000000  Duplicates: 0  Warnings: 0

mysql> commit;
Query OK, 0 rows affected (0.07 sec)
mysql> show table status like 't1';
+------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------+
| Name | Engine | Version | Row_format | Rows    | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment              |
+------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------+
| t1   | InnoDB |      10 | Compact    | 3000249 |             76 |   228294656 |               0 |     86654976 |         0 |        6000000 | 2009-09-23 05:26:34 | NULL        | NULL       | utf8_general_ci |     NULL |                | InnoDB free: 4096 kB |
+------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------+
1 row in set (0.08 sec)

mysql> system ls -l /var/lib/mysql/data_3306/dbtest
total 319820
-rw-rw---- 1 mysql mysql        61 Sep 23 04:17 db.opt
-rw-rw---- 1 mysql mysql      8646 Sep 23 05:26 t1.frm
-rw-rw---- 1 mysql mysql 327155712 Sep 23 05:30 t1.ibd
mysql>

2) mk-parallel-dump和mysqldump分别导出该表作比较
mysqldump导出表
# mkdir -p $HOME/backup
# cd $HOME/backup && rm -rf *
# time mysqldump --socket=/var/lib/mysql/data_3306/mysql.sock --opt dbtest t1 >dbback-dbtest-t1.sql

real    0m11.316s
user    0m2.348s
sys     0m0.472s
# ls -l dbback-dbtest-t1.sql
-rw-r--r-- 1 root root 179090589 Sep 23 05:31 dbback-dbtest-t1.sql

mk-parallel-dump导出表, 导出文件放在目录$HOME/backup/pdump1下, 不压缩, 不记录binlog的位置
# time mk-parallel-dump --socket=/var/lib/mysql/data_3306/mysql.sock --base-dir=$HOME/backup/pdump1 --no-gzip --nobin-log-position --tables="dbtest.t1"
     default:              1 tables,     1 chunks,     1 successes,  0 failures,  11.40 wall-clock time,  11.31 dump time

real    0m11.608s
user    0m2.176s
sys     0m0.556s
# find pdump1 -ls
7162198    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:33 pdump1
7162199    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:33 pdump1/default
7162200    4 drwxr-xr-x   2 root     root         4096 Sep 23 05:33 pdump1/default/dbtest
7162201 175076 -rw-r--r--   1 root     root     179096039 Sep 23 05:33 pdump1/default/dbtest/t1.000000.sql

mk-parallel-dump导出表, 增加每一百万条(近似值)导出一个文件
# time mk-parallel-dump --socket=/var/lib/mysql/data_3306/mysql.sock --base-dir=$HOME/backup/pdump2 --no-gzip --nobin-log-position --tables="dbtest.t1" --chunk-size=1000000
     default:              1 tables,     4 chunks,     4 successes,  0 failures,  10.36 wall-clock time,  15.92 dump time

real    0m10.509s
user    0m2.580s
sys     0m0.560s
# find pdump2 -ls
7162202    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:33 pdump2
7162203    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:33 pdump2/default
7162204    4 drwxr-xr-x   2 root     root         4096 Sep 23 05:33 pdump2/default/dbtest
7162205    4 -rw-r--r--   1 root     root          101 Sep 23 05:33 pdump2/default/dbtest/t1.chunks
7162208 58544 -rw-r--r--   1 root     root     59879876 Sep 23 05:33 pdump2/default/dbtest/t1.000001.sql
7162206   16 -rw-r--r--   1 root     root        16365 Sep 23 05:33 pdump2/default/dbtest/t1.000003.sql
7162209 58000 -rw-r--r--   1 root     root     59324125 Sep 23 05:33 pdump2/default/dbtest/t1.000000.sql
7162207 58544 -rw-r--r--   1 root     root     59880064 Sep 23 05:33 pdump2/default/dbtest/t1.000002.sql
# cat pdump2/default/dbtest/t1.chunks
`id` < 1999835
`id` >= 1999835 AND `id` < 3999669
`id` >= 3999669 AND `id` < 5999503
`id` >= 5999503
.chunks文件记录了分块规则

mk-parallel-dump导出表, 增加启动4个线程同时导出(不指定则默认为2个线程)
# time mk-parallel-dump --socket=/var/lib/mysql/data_3306/mysql.sock --base-dir=$HOME/backup/pdump3 --no-gzip --nobin-log-position --tables="dbtest.t1" --chunk-size=1000000 --threads=4
     default:              1 tables,     4 chunks,     4 successes,  0 failures,   9.37 wall-clock time,  25.29 dump time

real    0m9.529s
user    0m2.572s
sys     0m0.516s
# find pdump3 -ls
7359077    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:34 pdump3
7359078    4 drwxr-xr-x   3 root     root         4096 Sep 23 05:34 pdump3/default
7359079    4 drwxr-xr-x   2 root     root         4096 Sep 23 05:34 pdump3/default/dbtest
7359080    4 -rw-r--r--   1 root     root          101 Sep 23 05:34 pdump3/default/dbtest/t1.chunks
7359084 58544 -rw-r--r--   1 root     root     59879876 Sep 23 05:34 pdump3/default/dbtest/t1.000001.sql
7359081   16 -rw-r--r--   1 root     root        16365 Sep 23 05:34 pdump3/default/dbtest/t1.000003.sql
7359083 58000 -rw-r--r--   1 root     root     59324125 Sep 23 05:34 pdump3/default/dbtest/t1.000000.sql
7359082 58544 -rw-r--r--   1 root     root     59880064 Sep 23 05:34 pdump3/default/dbtest/t1.000002.sql

导出速度差不多, 无显著差异, 因为这是个单CPU的系统, 只导出一个表, 分块和多线程可能还会带来额外的开销.
如果是多核多CPU系统导出多个表, mk-parallel-dump应该会更快些.

3) 比较mk-parallel-dump和mysqldump导入
mysql导入
# time mysql --socket=/var/lib/mysql/data_3306/mysql.sock dbtest <dbback-dbtest-t1.sql

real    3m16.760s
user    0m1.672s
sys     0m0.156s

mk-parallel-restore导入
# time mk-parallel-restore --socket=/var/lib/mysql/data_3306/mysql.sock $HOME/backup/pdump1
    1 tables,     1 files,     1 successes,  0 failures, 199.75 wall-clock time, 199.75 load time

real    3m19.910s
user    0m0.232s
sys     0m0.136s

mk-parallel-restore导入多个文件
# mysql --socket=/var/lib/mysql/data_3306/mysql.sock -e "drop table dbtest.t1;"
# time mk-parallel-restore --socket=/var/lib/mysql/data_3306/mysql.sock $HOME/backup/pdump2
    1 tables,     4 files,     1 successes,  0 failures, 196.55 wall-clock time, 196.54 load time

real    3m16.653s
user    0m0.268s
sys     0m0.148s

mk-parallel-restore导入多个文件, 启4个线程
# mysql --socket=/var/lib/mysql/data_3306/mysql.sock -e "drop table dbtest.t1;"
# time mk-parallel-restore --socket=/var/lib/mysql/data_3306/mysql.sock $HOME/backup/pdump3 --threads=4
    1 tables,     4 files,     1 successes,  0 failures, 194.19 wall-clock time, 194.19 load time

real    3m14.606s
user    0m0.204s
sys     0m0.164s

速度也都差不多


总体感觉很一般啊, 以后再试试其它工具. 关于数据库复制, 日志/语句分析等工具可能还比较有用.



外部链接:
Tools for MySQL - Maatkit makes MySQL - easier to manage.
maatkit - A toolkit that provides advanced functionality for MySQL
mysql-parallel-dump test


-fin-

Thursday, September 3, 2009

no login prompt in vm console

no login prompt in vm console
虚拟机终端没有登录提示

用xm console命令登录Xen创建的虚拟机, 屏幕上只显示启动时的信息, 没有登录提示, 按多次回车也有没反应, 如下:
Mounting other filesystems:  [  OK  ]
Starting sshd: [  OK  ]
Starting crond: [  OK  ]
Starting anacron: [  OK  ]
Starting atd: [  OK  ]
Starting Avahi daemon... [  OK  ]
Starting HAL daemon: [  OK  ]
Starting puppet: [  OK  ]
Starting smartd: [  OK  ]
INIT: version 2.86 reloading

按文档Console handling指示
需要在/etc/inittab增加一行xvc0, 并注释其它tty配置
co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav
#1:2345:respawn:/sbin/mingetty tty1
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6

在/etc/securetty增加一行
xvc0

修改完/etc/inittab后运行
init q
使之生效

再次连接虚拟机终端, 出现登录界面
# xm console 14
INIT: Sending processes the TERM signal

CentOS release 5.3 (Final)
Kernel 2.6.18-128.7.1.el5xen on an x86_64

vm02.zone101.bj4.company.com login:
CentOS release 5.3 (Final)
Kernel 2.6.18-128.7.1.el5xen on an x86_64

vm02.zone101.bj4.company.com login:

至于为何没有自动添加参数, 原因不明, 有可能是BUG
Bug 463855 - No login prompt after headless serial console installation with virtualization
Bug 448429 - xm console requires DomU getty modification to point to xvc0


-fin-

Wednesday, September 2, 2009

multitail

multitail

multitail是一个小工具, 于tail和watch命令相比, 它的好处是可以用来同时查看多个文件或命令的输出, 还可以将多个文件或命令输出到一个窗口显示, 定义配色方案彩色显示, 按模式匹配关键字过滤或高亮显示.
最新版本是2008-05-19发布的v5.2.2
从源码编译安装或从rpmforge上rpm包直接安装

使用方法:
multitail file1 file2 ...

比如:
multitail /var/log/messages /var/log/httpd/access_log
multitail-simple-090902

复杂一点的, 缓冲10000行, 窗口分割为2列, 反显ERR|dhcpd|twitter字符, 同时显示2个日志文件, 运行iostat命令, 每隔5秒运行ls命令
multitail -M 10000 -s 2 -EC "ERR|dhcpd|twitter" \
/var/log/messages \
/u01/blurlog/mysql/bqa2/cloud1/db01/logs/general.log \
-l "iostat 3" \
-R 5 -l "ls -l /var/log/messages"
multitail-advanced-090902

在后台观察发现其实调用的就是一些tail命令
# ps -ef|grep 3454
root      3454 32310  0 10:45 pts/6    00:00:00 multitail -M 10000 -s 2 -EC ERR|dhcpd|twitter /var/log/messages /u01/blurlog/mysql/bqa2/cloud1/db01/logs/general.log -l iostat 3 -R 5 -l ls -l /var/log/messages
root      3455  3454  0 10:45 pts/6    00:00:00 tail --follow=name -n 62 /var/log/messages
root      3456  3454  0 10:45 pts/6    00:00:00 tail --follow=name -n 62 /u01/blurlog/mysql/bqa2/cloud1/db01/logs/general.log
root      3457  3454  0 10:45 pts/6    00:00:00 iostat 3
root      7440  3454  0 10:50 pts/6    00:00:00 multitail -M 10000 -s 2 -EC ERR|dhcpd|twitter /var/log/messages /u01/blurlog/mysql/bqa2/cloud1/db01/logs/general.log -l iostat 3 -R 5 -l ls -l /var/log/messages
root      7442  2641  0 10:50 pts/65   00:00:00 grep 3454
这个软件不是很稳定, 经常异常退出. 异常退出后, 必须手工杀掉后台的tail命令


外部链接:
MultiTail
用 multitail 查看许多文件 - 对话 UNIX: 适用于任何 UNIX 系统的 10 个出色的工具
Multitail
使用MultiTail同时监控多个文件


-fin-

Thursday, August 27, 2009

how to find ip address of network interface

how to find ip address assigned to network interface
如何取得网卡分配的IP地址

运行脚本:
/sbin/ifconfig -a|awk '
{
  if ( $0 ~ /^[^ ]/ ) {
    ifname=$1
    do {
      getline
      if ( $0 ~ /inet addr/ ) {
        ifaddr=substr($2, index($2, ":")+1)
      }
    } while ( $0 ~ /^[ ]/ )
    print ifname, ifaddr
    ifname=""
    ifaddr=""
  }
}
'
bond0 192.168.11.18
eth0
eth1
lo 127.0.0.1
sit0
tun0 172.16.220.94
列出系统中所有网卡对应的IPv4地址


-fin-

Thursday, August 13, 2009

Slow queries issue

Troubleshooting case study: Slow queries issue


提问1
Focus on the queries of this form:
### 423 Queries 
### Total time: 13459, Average time: 31.8179669030733
### Taking 13  to 74  seconds to complete
### Rows analyzed 0 - 38
use db1;
SELECT *     FROM t_u_sch     WHERE s_time <= XXX     ORDER BY s_time ASC     LIMIT XXX     FOR UPDATE;

use db1;
SELECT *     FROM t_u_sch     WHERE s_time <= 1234567890     ORDER BY s_time ASC     LIMIT 38     FOR UPDATE;


These are scheduler related queries in the DB1 for FB, Twitter, MySpace, etc. We’re selecting a bunch of accounts to schedule work items for. So we select then update the last scheduled sync time column. We also insert new accts in these tables.


回答1
it's still hard to tell the root cause at the moment. but we found index of t_u_sch is fragmented,

mysql> show table status like
    -> 't_u_sch';
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| Name              | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment                                                                          |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| t_u_sch           | InnoDB |      10 | Compact    | 1140 |            172 |      196608 |               0 |    336592896 |         0 |           NULL | 2009-06-29 23:59:29 | NULL        | NULL       | utf8_general_ci |     NULL |                | InnoDB free: 3072 kB; (`b_a_id      `) REFER `db1/t_u     `(`b_a_id      `) ON D |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
1 row in set (0.13 sec)

as you can see index length is abnormally larger than the data length, it may be caused by frequently deletion and insertion on table. when an index becomes fragmented, index scan query will take longer time. to defrag it and free up spaces, you can use "optimize table ..." or "alter table ... engine=innodb"

mysql> alter table t_u_sch ENGINE=INNODB;
Query OK, 763 rows affected (0.25 sec)
Records: 763  Duplicates: 0  Warnings: 0

mysql> show table status like 't_u_sch';
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| Name              | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment                                                                          |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| t_u_sch           | InnoDB |      10 | Compact    |  871 |            131 |      114688 |               0 |        49152 |         0 |           NULL | 2009-08-06 10:46:00 | NULL        | NULL       | utf8_general_ci |     NULL |                | InnoDB free: 0 kB; (`b_a_id      `) REFER `db1/t_u     `(`b_a_id      `) ON DELE |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)


other *_u_sch* tables also need to be defragmented by this way.

thanks.

发现有些InnoDB表的索引很大, 而且随着时间推移不断的增大, 与实际数据量很不相符, 实际只有1000条左右的记录.
对这个表的操作主要是大量的UPDATE, 怀疑索引因此产生了碎片或平衡树的结构"失衡"了(Oracle数据库中也有这种情况)
但不能确定, 也不知道如何在测试系统上重现此错误(测试时发现如果不提交, UPDATE操作确实会导致索引一直变大, 但提交后, 发现过一段时间MySQL会自动收缩索引, 可以看到index_length变小)
临时的解决方法是, 定期优化表(optimize table ...), 达到重建索引, 释放空间的目的



提问2

We are continuing to get slow queries and used "SHOW TABLE STATUS' to see if there is index fragmentation. For some tables, I am finding that 'Index_length' is zero even though there are indexes on the table. This is happening on db.some.where.com.

For example:
# Time: 090806 21:48:12
# User@Host: user1[user1] @ a1.some.where.com [12.34.56.78]
# Query_time: 7  Lock_time: 0  Rows_sent: 6  Rows_examined: 6
use db1;
SELECT * FROM t_s_ch      WHERE b_a_id = '123456ABC' AND           s_a >= 28924     ORDER BY s_a ASC     LIMIT 2147483647;

mysql> show table status like 't_s_ch';
+-------------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| Name              | Engine | Version | Row_format | Rows    | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment                                                                          |
+-------------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
| t_s_ch            | InnoDB |      10 | Compact    | 9462693 |            164 |  1559756800 |               0 |            0 |         0 |           NULL | 2009-04-24 17:21:19 | NULL        | NULL       | utf8_general_ci |     NULL |                | InnoDB free: 45056 kB; (`b_a_id      `) REFER `db1/f_u     `(`b_a_id      `) ON  | 
+-------------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------------------------------------------------------------------+
1 row in set (0.70 sec)

Is there a reason why 'Index_length' would be zero? I am checking Google and I haven't found a reason so far. Does this table not have an index anymore?


回答2

I think it's an expected behavior. In InnoDB, every table must have a clustered index, data records are stored as leaf nodes of this index, which means clustered index is the data records, it is counted as data_length not index_length. In your case, the primacy key is the clustered index, and no other indexes exist, so index_length is zero.

InnDB表都必须有一个聚集索引(clustered index), 记录数据存储在这个聚集索引中, 类似于Oracle的索引组织表(index-organized table).
如果表上定义了主键, 则使用主键作为聚集索引
否则选择第一个非空的唯一索引作为聚集索引
如果都没有, 则内部创建一个隐藏的rowid单调递增列, 基于该列创建隐藏的聚集索引
(参考13.6.10.1. Clustered and Secondary Indexes)

所以聚集索引也就是记录数据, 算作data_length,而不是index_length


回答3

1.
from mysqladmin status output and slow query log, it seems there are some slow queries using full table scans

so we suggest:
1)add an index on customer_tab(custid,deptid)

2)extend the index in con_gr_tab/con_tab/con_id_tab/con_tab2 from (cust_id) to (cust_id,sn)

3)for following select statement, it is better to use "=" for comparision rather than "like"
SELECT d.deptid, d.customid, d.sn, d.version, d.email, d.dmi, d.area, d.provider, d.manufacturer, d.nation, d.number FROM custominfo d WHERE d.deptid LIKE '1234567890' LIMIT 100;

4)change dept_id in db_a_tab/db_base_tab/db_queue_tab/db_b_tab from varchar(80) to bigint(20)

5)decrease the size of cust_id in customs_tab from varchar(512) to varchar(80)


2.
in dbs, general/slow query logs are growing huge,
[db1.some.where.com]
-rw-rw---- 1 mysql mysql           0 Aug 11 15:56 /mysql_logs/error.log
-rw-rw---- 1 mysql mysql 41254683176 Aug 12 06:41 /mysql_logs/general.log
-rw-rw---- 1 mysql mysql  2117239370 Aug 12 06:41 /mysql_logs/slow-queries.log
[db2.some.where.com]
-rw-rw---- 1 mysql mysql           0 Aug 11 15:56 /mysql_logs/error.log
-rw-rw---- 1 mysql mysql 32935022398 Aug 12 06:41 /mysql_logs/general.log
-rw-rw---- 1 mysql mysql   458081312 Aug 12 06:41 /mysql_logs/slow-queries.log
[db3.some.where.com]
-rw-rw---- 1 mysql mysql           0 Aug 11 15:56 /mysql_logs/error.log
-rw-rw---- 1 mysql mysql 30089483757 Aug 12 06:41 /mysql_logs/general.log
-rw-rw---- 1 mysql mysql  1156294323 Aug 12 06:41 /mysql_logs/slow-queries.log
[db4.some.where.com]
-rw-rw---- 1 mysql mysql           0 Aug 11 15:56 /mysql_logs/error.log
-rw-rw---- 1 mysql mysql 29886541601 Aug 12 06:41 /mysql_logs/general.log
-rw-rw---- 1 mysql mysql  1871892345 Aug 12 06:41 /mysql_logs/slow-queries.log

these logs need to be cleaned up, logrotate can do this, for example:
# cat /etc/logrotate.d/mysql
/mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log {
  daily
  create 0660 mysql mysql
  notifempty
  #size 100M
  missingok
  nocompress
  rotate 120
  sharedscripts
  postrotate
    /usr/bin/mysqladmin flush-logs
  endscript
}
 
# logrotate -f /etc/logrotate.d/mysql

it is also recommended to turn on general query log only when needed, since it is probably an impact on performance. to disable it, a restart of mysql server is required.
if using mysql 5.1, it can be disabled/enabled dynamically without restarting mysql.


3. for better innodb performance, increase innodb_buffer_pool_size, for example to 6g. in general, it can be set up to 80% of phsical memory size.


1.使用命令"mysqladmin extented-status -r -i60", 查看指定时间间隔内的数据库状态值的变化情况
Select_scan,Sort_scan说明存在全表扫描
通过查看慢速查询日志(slow query log), 能够发现运行时间超过指定时长的SQL语句
2.Linux自带Logrotate工具实现Mysql查询日志的归档
3.InnoDB缓冲池最好设大些, 比如通常可以设置为物理内存的80%



-fin-

Tuesday, August 11, 2009

Rotating MySQL log files

Rotating MySQL log files
轮换MySQL日志文件

用Logrotate维护MySQL日志


通常打开MySQL的普通查询日志(general query log)和慢速查询日志(slow query log), 以便查找(可能)出现的问题
在繁忙的系统中, 日志文件增长很快, 对大文件查询起来不方便, 写日志文件本身也会影响磁盘性能

MySQL 5.0中普通/慢速查询日志参数是个静态的参数,只能通过重启MySQL服务生效
MySQL 5.1版本后普通/慢速查询日志参数是动态的, 能够动态的启用或关闭. 可以平时关闭普通查询日志, 当需要时再打开

当日志文件增长过大时需要截断(truncate), 使用命令"> logfile"
此命令清空文件全部内容,而不删除文件
# ls -l install.log.bak
-rw-r--r-- 1 root root 17244 Jun  1 09:29 install.log.bak
# >install.log.bak
# ls -l install.log.bak
-rw-r--r-- 1 root root 0 Aug 11 06:45 install.log.bak
#

截断日志文件后以前的内容就没有了, 所以这并非是一个理想的方案, 需要的是对日志进行归档, 保留旧的日志, 产生新的日志文件
方法见MySQL参考手册:
shell> mv host_name.log host_name-old.log
shell> mysqladmin flush-logs
shell> cp host_name-old.log backup-directory
shell> rm host_name-old.log
  • 日志文件改名, 这不会使MySQL服务终止, 所以不影响在线业务
  • 运行flush-logs命令, 刷新日志文件(包括关闭/重新打开查询日志文件)
  • 备份旧的日志文件
  • 删除旧的日志文件

使用linux系统中logrotate自动工作, 配置文件如下:
cat >/etc/logrotate.d/mysql <<'EOF'
/mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log {
  daily
  create 0660 mysql mysql
  notifempty
  #size 100M
  missingok
  nocompress
  rotate 120
  sharedscripts
  postrotate
    if test -x /usr/bin/mysqladmin && \
       /usr/bin/mysqladmin ping &>/dev/null
    then
       /usr/bin/mysqladmin flush-logs
    fi
  endscript
}
EOF
daily: 每天归档一次
create 0660 mysql mysql: 归档后创建新文件
notifempty: 文件为空时不做处理
#size 100M: 文件大小超过100M也归档
missingok: 文件不存在时不报错
nocompress: 不压缩归档文件
rotate 120: 保留120个归档文件
sharedscripts: 共享的脚本,意味着对所有文件只运行一次
postrotate: 轮换后要运行的脚本

试运行一下
/usr/sbin/logrotate -vf /etc/logrotate.d/mysql
查看结果
[root@db01 /mysql/logs]# ll
total 1675432
-rw-rw---- 1 mysql mysql        472 Aug 11  2009 error.log
-rw-rw---- 1 mysql mysql        472 Aug 11 15:03 error.log.1
-rw-rw---- 1 mysql mysql        472 Aug 11 14:57 error.log.2
-rw-rw---- 1 mysql mysql          0 Aug 11 15:03 error.log-old
-rw-rw---- 1 mysql mysql        687 Aug 11  2009 general.log
-rw-rw---- 1 mysql mysql       1082 Aug 11 15:03 general.log.1
-rw-rw---- 1 mysql mysql      37115 Aug 11 15:01 general.log.2
-rw-rw---- 1 mysql mysql 1693930999 Aug 11 11:06 general.log.3
-rw-rw---- 1 mysql mysql        354 Aug 11  2009 slow-queries.log
-rw-rw---- 1 mysql mysql        354 Aug 11 15:03 slow-queries.log.1
-rw-rw---- 1 mysql mysql   18263218 Aug 11 14:57 slow-queries.log.2
[root@db01 /mysql/logs]# /usr/sbin/logrotate -v /etc/logrotate.d/mysql
reading config file /etc/logrotate.d/mysql
reading config info for /mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log

Handling 1 logs

rotating pattern: /mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log  after 1 days (120 rotations)
empty log files are not rotated, old logs are removed
considering log /mysql/logs/error.log
  log does not need rotating
considering log /mysql/logs/general.log
  log does not need rotating
considering log /mysql/logs/slow-queries.log
  log does not need rotating
not running postrotate script, since no logs were rotated
[root@db01.cloud2.bqa3.blurdev.com /mysql/logs]# /usr/sbin/logrotate -vf /etc/logrotate.d/mysql
reading config file /etc/logrotate.d/mysql
reading config info for /mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log

Handling 1 logs

rotating pattern: /mysql/logs/error.log /mysql/logs/general.log /mysql/logs/slow-queries.log  forced from command line (120 rotations)
empty log files are not rotated, old logs are removed
considering log /mysql/logs/error.log
  log needs rotating
considering log /mysql/logs/general.log
  log needs rotating
considering log /mysql/logs/slow-queries.log
  log needs rotating
rotating log /mysql/logs/error.log, log->rotateCount is 120
renaming /mysql/logs/error.log.120 to /mysql/logs/error.log.121 (rotatecount 120, logstart 1, i 120),
old log /mysql/logs/error.log.120 does not exist
renaming /mysql/logs/error.log.119 to /mysql/logs/error.log.120 (rotatecount 120, logstart 1, i 119),
old log /mysql/logs/error.log.119 does not exist
renaming /mysql/logs/error.log.118 to /mysql/logs/error.log.119 (rotatecount 120, logstart 1, i 118),
old log /mysql/logs/error.log.118 does not exist
renaming /mysql/logs/error.log.117 to /mysql/logs/error.log.118 (rotatecount 120, logstart 1, i 117),
old log /mysql/logs/error.log.117 does not exist
renaming /mysql/logs/error.log.116 to /mysql/logs/error.log.117 (rotatecount 120, logstart 1, i 116),
old log /mysql/logs/error.log.116 does not exist
renaming /mysql/logs/error.log.115 to /mysql/logs/error.log.116 (rotatecount 120, logstart 1, i 115),
old log /mysql/logs/error.log.115 does not exist
renaming /mysql/logs/error.log.114 to /mysql/logs/error.log.115 (rotatecount 120, logstart 1, i 114),
old log /mysql/logs/error.log.114 does not exist
renaming /mysql/logs/error.log.113 to /mysql/logs/error.log.114 (rotatecount 120, logstart 1, i 113),
old log /mysql/logs/error.log.113 does not exist
renaming /mysql/logs/error.log.112 to /mysql/logs/error.log.113 (rotatecount 120, logstart 1, i 112),
old log /mysql/logs/error.log.112 does not exist
renaming /mysql/logs/error.log.111 to /mysql/logs/error.log.112 (rotatecount 120, logstart 1, i 111),
old log /mysql/logs/error.log.111 does not exist
renaming /mysql/logs/error.log.110 to /mysql/logs/error.log.111 (rotatecount 120, logstart 1, i 110),
old log /mysql/logs/error.log.110 does not exist
renaming /mysql/logs/error.log.109 to /mysql/logs/error.log.110 (rotatecount 120, logstart 1, i 109),
old log /mysql/logs/error.log.109 does not exist
renaming /mysql/logs/error.log.108 to /mysql/logs/error.log.109 (rotatecount 120, logstart 1, i 108),
old log /mysql/logs/error.log.108 does not exist
renaming /mysql/logs/error.log.107 to /mysql/logs/error.log.108 (rotatecount 120, logstart 1, i 107),
old log /mysql/logs/error.log.107 does not exist
renaming /mysql/logs/error.log.106 to /mysql/logs/error.log.107 (rotatecount 120, logstart 1, i 106),
old log /mysql/logs/error.log.106 does not exist
renaming /mysql/logs/error.log.105 to /mysql/logs/error.log.106 (rotatecount 120, logstart 1, i 105),
old log /mysql/logs/error.log.105 does not exist
renaming /mysql/logs/error.log.104 to /mysql/logs/error.log.105 (rotatecount 120, logstart 1, i 104),
old log /mysql/logs/error.log.104 does not exist
renaming /mysql/logs/error.log.103 to /mysql/logs/error.log.104 (rotatecount 120, logstart 1, i 103),
old log /mysql/logs/error.log.103 does not exist
renaming /mysql/logs/error.log.102 to /mysql/logs/error.log.103 (rotatecount 120, logstart 1, i 102),
old log /mysql/logs/error.log.102 does not exist
renaming /mysql/logs/error.log.101 to /mysql/logs/error.log.102 (rotatecount 120, logstart 1, i 101),
old log /mysql/logs/error.log.101 does not exist
renaming /mysql/logs/error.log.100 to /mysql/logs/error.log.101 (rotatecount 120, logstart 1, i 100),
old log /mysql/logs/error.log.100 does not exist
renaming /mysql/logs/error.log.99 to /mysql/logs/error.log.100 (rotatecount 120, logstart 1, i 99),
old log /mysql/logs/error.log.99 does not exist
renaming /mysql/logs/error.log.98 to /mysql/logs/error.log.99 (rotatecount 120, logstart 1, i 98),
old log /mysql/logs/error.log.98 does not exist
renaming /mysql/logs/error.log.97 to /mysql/logs/error.log.98 (rotatecount 120, logstart 1, i 97),
old log /mysql/logs/error.log.97 does not exist
renaming /mysql/logs/error.log.96 to /mysql/logs/error.log.97 (rotatecount 120, logstart 1, i 96),
old log /mysql/logs/error.log.96 does not exist
renaming /mysql/logs/error.log.95 to /mysql/logs/error.log.96 (rotatecount 120, logstart 1, i 95),
old log /mysql/logs/error.log.95 does not exist
renaming /mysql/logs/error.log.94 to /mysql/logs/error.log.95 (rotatecount 120, logstart 1, i 94),
old log /mysql/logs/error.log.94 does not exist
renaming /mysql/logs/error.log.93 to /mysql/logs/error.log.94 (rotatecount 120, logstart 1, i 93),
old log /mysql/logs/error.log.93 does not exist
renaming /mysql/logs/error.log.92 to /mysql/logs/error.log.93 (rotatecount 120, logstart 1, i 92),
old log /mysql/logs/error.log.92 does not exist
renaming /mysql/logs/error.log.91 to /mysql/logs/error.log.92 (rotatecount 120, logstart 1, i 91),
old log /mysql/logs/error.log.91 does not exist
renaming /mysql/logs/error.log.90 to /mysql/logs/error.log.91 (rotatecount 120, logstart 1, i 90),
old log /mysql/logs/error.log.90 does not exist
renaming /mysql/logs/error.log.89 to /mysql/logs/error.log.90 (rotatecount 120, logstart 1, i 89),
old log /mysql/logs/error.log.89 does not exist
renaming /mysql/logs/error.log.88 to /mysql/logs/error.log.89 (rotatecount 120, logstart 1, i 88),
old log /mysql/logs/error.log.88 does not exist
renaming /mysql/logs/error.log.87 to /mysql/logs/error.log.88 (rotatecount 120, logstart 1, i 87),
old log /mysql/logs/error.log.87 does not exist
renaming /mysql/logs/error.log.86 to /mysql/logs/error.log.87 (rotatecount 120, logstart 1, i 86),
old log /mysql/logs/error.log.86 does not exist
renaming /mysql/logs/error.log.85 to /mysql/logs/error.log.86 (rotatecount 120, logstart 1, i 85),
old log /mysql/logs/error.log.85 does not exist
renaming /mysql/logs/error.log.84 to /mysql/logs/error.log.85 (rotatecount 120, logstart 1, i 84),
old log /mysql/logs/error.log.84 does not exist
renaming /mysql/logs/error.log.83 to /mysql/logs/error.log.84 (rotatecount 120, logstart 1, i 83),
old log /mysql/logs/error.log.83 does not exist
renaming /mysql/logs/error.log.82 to /mysql/logs/error.log.83 (rotatecount 120, logstart 1, i 82),
old log /mysql/logs/error.log.82 does not exist
renaming /mysql/logs/error.log.81 to /mysql/logs/error.log.82 (rotatecount 120, logstart 1, i 81),
old log /mysql/logs/error.log.81 does not exist
renaming /mysql/logs/error.log.80 to /mysql/logs/error.log.81 (rotatecount 120, logstart 1, i 80),
old log /mysql/logs/error.log.80 does not exist
renaming /mysql/logs/error.log.79 to /mysql/logs/error.log.80 (rotatecount 120, logstart 1, i 79),
old log /mysql/logs/error.log.79 does not exist
renaming /mysql/logs/error.log.78 to /mysql/logs/error.log.79 (rotatecount 120, logstart 1, i 78),
old log /mysql/logs/error.log.78 does not exist
renaming /mysql/logs/error.log.77 to /mysql/logs/error.log.78 (rotatecount 120, logstart 1, i 77),
old log /mysql/logs/error.log.77 does not exist
renaming /mysql/logs/error.log.76 to /mysql/logs/error.log.77 (rotatecount 120, logstart 1, i 76),
old log /mysql/logs/error.log.76 does not exist
renaming /mysql/logs/error.log.75 to /mysql/logs/error.log.76 (rotatecount 120, logstart 1, i 75),
old log /mysql/logs/error.log.75 does not exist
renaming /mysql/logs/error.log.74 to /mysql/logs/error.log.75 (rotatecount 120, logstart 1, i 74),
old log /mysql/logs/error.log.74 does not exist
renaming /mysql/logs/error.log.73 to /mysql/logs/error.log.74 (rotatecount 120, logstart 1, i 73),
old log /mysql/logs/error.log.73 does not exist
renaming /mysql/logs/error.log.72 to /mysql/logs/error.log.73 (rotatecount 120, logstart 1, i 72),
old log /mysql/logs/error.log.72 does not exist
renaming /mysql/logs/error.log.71 to /mysql/logs/error.log.72 (rotatecount 120, logstart 1, i 71),
old log /mysql/logs/error.log.71 does not exist
renaming /mysql/logs/error.log.70 to /mysql/logs/error.log.71 (rotatecount 120, logstart 1, i 70),
old log /mysql/logs/error.log.70 does not exist
renaming /mysql/logs/error.log.69 to /mysql/logs/error.log.70 (rotatecount 120, logstart 1, i 69),
old log /mysql/logs/error.log.69 does not exist
renaming /mysql/logs/error.log.68 to /mysql/logs/error.log.69 (rotatecount 120, logstart 1, i 68),
old log /mysql/logs/error.log.68 does not exist
renaming /mysql/logs/error.log.67 to /mysql/logs/error.log.68 (rotatecount 120, logstart 1, i 67),
old log /mysql/logs/error.log.67 does not exist
renaming /mysql/logs/error.log.66 to /mysql/logs/error.log.67 (rotatecount 120, logstart 1, i 66),
old log /mysql/logs/error.log.66 does not exist
renaming /mysql/logs/error.log.65 to /mysql/logs/error.log.66 (rotatecount 120, logstart 1, i 65),
old log /mysql/logs/error.log.65 does not exist
renaming /mysql/logs/error.log.64 to /mysql/logs/error.log.65 (rotatecount 120, logstart 1, i 64),
old log /mysql/logs/error.log.64 does not exist
renaming /mysql/logs/error.log.63 to /mysql/logs/error.log.64 (rotatecount 120, logstart 1, i 63),
old log /mysql/logs/error.log.63 does not exist
renaming /mysql/logs/error.log.62 to /mysql/logs/error.log.63 (rotatecount 120, logstart 1, i 62),
old log /mysql/logs/error.log.62 does not exist
renaming /mysql/logs/error.log.61 to /mysql/logs/error.log.62 (rotatecount 120, logstart 1, i 61),
old log /mysql/logs/error.log.61 does not exist
renaming /mysql/logs/error.log.60 to /mysql/logs/error.log.61 (rotatecount 120, logstart 1, i 60),
old log /mysql/logs/error.log.60 does not exist
renaming /mysql/logs/error.log.59 to /mysql/logs/error.log.60 (rotatecount 120, logstart 1, i 59),
old log /mysql/logs/error.log.59 does not exist
renaming /mysql/logs/error.log.58 to /mysql/logs/error.log.59 (rotatecount 120, logstart 1, i 58),
old log /mysql/logs/error.log.58 does not exist
renaming /mysql/logs/error.log.57 to /mysql/logs/error.log.58 (rotatecount 120, logstart 1, i 57),
old log /mysql/logs/error.log.57 does not exist
renaming /mysql/logs/error.log.56 to /mysql/logs/error.log.57 (rotatecount 120, logstart 1, i 56),
old log /mysql/logs/error.log.56 does not exist
renaming /mysql/logs/error.log.55 to /mysql/logs/error.log.56 (rotatecount 120, logstart 1, i 55),
old log /mysql/logs/error.log.55 does not exist
renaming /mysql/logs/error.log.54 to /mysql/logs/error.log.55 (rotatecount 120, logstart 1, i 54),
old log /mysql/logs/error.log.54 does not exist
renaming /mysql/logs/error.log.53 to /mysql/logs/error.log.54 (rotatecount 120, logstart 1, i 53),
old log /mysql/logs/error.log.53 does not exist
renaming /mysql/logs/error.log.52 to /mysql/logs/error.log.53 (rotatecount 120, logstart 1, i 52),
old log /mysql/logs/error.log.52 does not exist
renaming /mysql/logs/error.log.51 to /mysql/logs/error.log.52 (rotatecount 120, logstart 1, i 51),
old log /mysql/logs/error.log.51 does not exist
renaming /mysql/logs/error.log.50 to /mysql/logs/error.log.51 (rotatecount 120, logstart 1, i 50),
old log /mysql/logs/error.log.50 does not exist
renaming /mysql/logs/error.log.49 to /mysql/logs/error.log.50 (rotatecount 120, logstart 1, i 49),
old log /mysql/logs/error.log.49 does not exist
renaming /mysql/logs/error.log.48 to /mysql/logs/error.log.49 (rotatecount 120, logstart 1, i 48),
old log /mysql/logs/error.log.48 does not exist
renaming /mysql/logs/error.log.47 to /mysql/logs/error.log.48 (rotatecount 120, logstart 1, i 47),
old log /mysql/logs/error.log.47 does not exist
renaming /mysql/logs/error.log.46 to /mysql/logs/error.log.47 (rotatecount 120, logstart 1, i 46),
old log /mysql/logs/error.log.46 does not exist
renaming /mysql/logs/error.log.45 to /mysql/logs/error.log.46 (rotatecount 120, logstart 1, i 45),
old log /mysql/logs/error.log.45 does not exist
renaming /mysql/logs/error.log.44 to /mysql/logs/error.log.45 (rotatecount 120, logstart 1, i 44),
old log /mysql/logs/error.log.44 does not exist
renaming /mysql/logs/error.log.43 to /mysql/logs/error.log.44 (rotatecount 120, logstart 1, i 43),
old log /mysql/logs/error.log.43 does not exist
renaming /mysql/logs/error.log.42 to /mysql/logs/error.log.43 (rotatecount 120, logstart 1, i 42),
old log /mysql/logs/error.log.42 does not exist
renaming /mysql/logs/error.log.41 to /mysql/logs/error.log.42 (rotatecount 120, logstart 1, i 41),
old log /mysql/logs/error.log.41 does not exist
renaming /mysql/logs/error.log.40 to /mysql/logs/error.log.41 (rotatecount 120, logstart 1, i 40),
old log /mysql/logs/error.log.40 does not exist
renaming /mysql/logs/error.log.39 to /mysql/logs/error.log.40 (rotatecount 120, logstart 1, i 39),
old log /mysql/logs/error.log.39 does not exist
renaming /mysql/logs/error.log.38 to /mysql/logs/error.log.39 (rotatecount 120, logstart 1, i 38),
old log /mysql/logs/error.log.38 does not exist
renaming /mysql/logs/error.log.37 to /mysql/logs/error.log.38 (rotatecount 120, logstart 1, i 37),
old log /mysql/logs/error.log.37 does not exist
renaming /mysql/logs/error.log.36 to /mysql/logs/error.log.37 (rotatecount 120, logstart 1, i 36),
old log /mysql/logs/error.log.36 does not exist
renaming /mysql/logs/error.log.35 to /mysql/logs/error.log.36 (rotatecount 120, logstart 1, i 35),
old log /mysql/logs/error.log.35 does not exist
renaming /mysql/logs/error.log.34 to /mysql/logs/error.log.35 (rotatecount 120, logstart 1, i 34),
old log /mysql/logs/error.log.34 does not exist
renaming /mysql/logs/error.log.33 to /mysql/logs/error.log.34 (rotatecount 120, logstart 1, i 33),
old log /mysql/logs/error.log.33 does not exist
renaming /mysql/logs/error.log.32 to /mysql/logs/error.log.33 (rotatecount 120, logstart 1, i 32),
old log /mysql/logs/error.log.32 does not exist
renaming /mysql/logs/error.log.31 to /mysql/logs/error.log.32 (rotatecount 120, logstart 1, i 31),
old log /mysql/logs/error.log.31 does not exist
renaming /mysql/logs/error.log.30 to /mysql/logs/error.log.31 (rotatecount 120, logstart 1, i 30),
old log /mysql/logs/error.log.30 does not exist
renaming /mysql/logs/error.log.29 to /mysql/logs/error.log.30 (rotatecount 120, logstart 1, i 29),
old log /mysql/logs/error.log.29 does not exist
renaming /mysql/logs/error.log.28 to /mysql/logs/error.log.29 (rotatecount 120, logstart 1, i 28),
old log /mysql/logs/error.log.28 does not exist
renaming /mysql/logs/error.log.27 to /mysql/logs/error.log.28 (rotatecount 120, logstart 1, i 27),
old log /mysql/logs/error.log.27 does not exist
renaming /mysql/logs/error.log.26 to /mysql/logs/error.log.27 (rotatecount 120, logstart 1, i 26),
old log /mysql/logs/error.log.26 does not exist
renaming /mysql/logs/error.log.25 to /mysql/logs/error.log.26 (rotatecount 120, logstart 1, i 25),
old log /mysql/logs/error.log.25 does not exist
renaming /mysql/logs/error.log.24 to /mysql/logs/error.log.25 (rotatecount 120, logstart 1, i 24),
old log /mysql/logs/error.log.24 does not exist
renaming /mysql/logs/error.log.23 to /mysql/logs/error.log.24 (rotatecount 120, logstart 1, i 23),
old log /mysql/logs/error.log.23 does not exist
renaming /mysql/logs/error.log.22 to /mysql/logs/error.log.23 (rotatecount 120, logstart 1, i 22),
old log /mysql/logs/error.log.22 does not exist
renaming /mysql/logs/error.log.21 to /mysql/logs/error.log.22 (rotatecount 120, logstart 1, i 21),
old log /mysql/logs/error.log.21 does not exist
renaming /mysql/logs/error.log.20 to /mysql/logs/error.log.21 (rotatecount 120, logstart 1, i 20),
old log /mysql/logs/error.log.20 does not exist
renaming /mysql/logs/error.log.19 to /mysql/logs/error.log.20 (rotatecount 120, logstart 1, i 19),
old log /mysql/logs/error.log.19 does not exist
renaming /mysql/logs/error.log.18 to /mysql/logs/error.log.19 (rotatecount 120, logstart 1, i 18),
old log /mysql/logs/error.log.18 does not exist
renaming /mysql/logs/error.log.17 to /mysql/logs/error.log.18 (rotatecount 120, logstart 1, i 17),
old log /mysql/logs/error.log.17 does not exist
renaming /mysql/logs/error.log.16 to /mysql/logs/error.log.17 (rotatecount 120, logstart 1, i 16),
old log /mysql/logs/error.log.16 does not exist
renaming /mysql/logs/error.log.15 to /mysql/logs/error.log.16 (rotatecount 120, logstart 1, i 15),
old log /mysql/logs/error.log.15 does not exist
renaming /mysql/logs/error.log.14 to /mysql/logs/error.log.15 (rotatecount 120, logstart 1, i 14),
old log /mysql/logs/error.log.14 does not exist
renaming /mysql/logs/error.log.13 to /mysql/logs/error.log.14 (rotatecount 120, logstart 1, i 13),
old log /mysql/logs/error.log.13 does not exist
renaming /mysql/logs/error.log.12 to /mysql/logs/error.log.13 (rotatecount 120, logstart 1, i 12),
old log /mysql/logs/error.log.12 does not exist
renaming /mysql/logs/error.log.11 to /mysql/logs/error.log.12 (rotatecount 120, logstart 1, i 11),
old log /mysql/logs/error.log.11 does not exist
renaming /mysql/logs/error.log.10 to /mysql/logs/error.log.11 (rotatecount 120, logstart 1, i 10),
old log /mysql/logs/error.log.10 does not exist
renaming /mysql/logs/error.log.9 to /mysql/logs/error.log.10 (rotatecount 120, logstart 1, i 9),
old log /mysql/logs/error.log.9 does not exist
renaming /mysql/logs/error.log.8 to /mysql/logs/error.log.9 (rotatecount 120, logstart 1, i 8),
old log /mysql/logs/error.log.8 does not exist
renaming /mysql/logs/error.log.7 to /mysql/logs/error.log.8 (rotatecount 120, logstart 1, i 7),
old log /mysql/logs/error.log.7 does not exist
renaming /mysql/logs/error.log.6 to /mysql/logs/error.log.7 (rotatecount 120, logstart 1, i 6),
old log /mysql/logs/error.log.6 does not exist
renaming /mysql/logs/error.log.5 to /mysql/logs/error.log.6 (rotatecount 120, logstart 1, i 5),
old log /mysql/logs/error.log.5 does not exist
renaming /mysql/logs/error.log.4 to /mysql/logs/error.log.5 (rotatecount 120, logstart 1, i 4),
old log /mysql/logs/error.log.4 does not exist
renaming /mysql/logs/error.log.3 to /mysql/logs/error.log.4 (rotatecount 120, logstart 1, i 3),
old log /mysql/logs/error.log.3 does not exist
renaming /mysql/logs/error.log.2 to /mysql/logs/error.log.3 (rotatecount 120, logstart 1, i 2),
renaming /mysql/logs/error.log.1 to /mysql/logs/error.log.2 (rotatecount 120, logstart 1, i 1),
renaming /mysql/logs/error.log.0 to /mysql/logs/error.log.1 (rotatecount 120, logstart 1, i 0),
old log /mysql/logs/error.log.0 does not exist
log /mysql/logs/error.log.121 doesn't exist -- won't try to dispose of it
rotating log /mysql/logs/general.log, log->rotateCount is 120
renaming /mysql/logs/general.log.120 to /mysql/logs/general.log.121 (rotatecount 120, logstart 1, i 120),
old log /mysql/logs/general.log.120 does not exist
renaming /mysql/logs/general.log.119 to /mysql/logs/general.log.120 (rotatecount 120, logstart 1, i 119),
old log /mysql/logs/general.log.119 does not exist
renaming /mysql/logs/general.log.118 to /mysql/logs/general.log.119 (rotatecount 120, logstart 1, i 118),
old log /mysql/logs/general.log.118 does not exist
renaming /mysql/logs/general.log.117 to /mysql/logs/general.log.118 (rotatecount 120, logstart 1, i 117),
old log /mysql/logs/general.log.117 does not exist
renaming /mysql/logs/general.log.116 to /mysql/logs/general.log.117 (rotatecount 120, logstart 1, i 116),
old log /mysql/logs/general.log.116 does not exist
renaming /mysql/logs/general.log.115 to /mysql/logs/general.log.116 (rotatecount 120, logstart 1, i 115),
old log /mysql/logs/general.log.115 does not exist
renaming /mysql/logs/general.log.114 to /mysql/logs/general.log.115 (rotatecount 120, logstart 1, i 114),
old log /mysql/logs/general.log.114 does not exist
renaming /mysql/logs/general.log.113 to /mysql/logs/general.log.114 (rotatecount 120, logstart 1, i 113),
old log /mysql/logs/general.log.113 does not exist
renaming /mysql/logs/general.log.112 to /mysql/logs/general.log.113 (rotatecount 120, logstart 1, i 112),
old log /mysql/logs/general.log.112 does not exist
renaming /mysql/logs/general.log.111 to /mysql/logs/general.log.112 (rotatecount 120, logstart 1, i 111),
old log /mysql/logs/general.log.111 does not exist
renaming /mysql/logs/general.log.110 to /mysql/logs/general.log.111 (rotatecount 120, logstart 1, i 110),
old log /mysql/logs/general.log.110 does not exist
renaming /mysql/logs/general.log.109 to /mysql/logs/general.log.110 (rotatecount 120, logstart 1, i 109),
old log /mysql/logs/general.log.109 does not exist
renaming /mysql/logs/general.log.108 to /mysql/logs/general.log.109 (rotatecount 120, logstart 1, i 108),
old log /mysql/logs/general.log.108 does not exist
renaming /mysql/logs/general.log.107 to /mysql/logs/general.log.108 (rotatecount 120, logstart 1, i 107),
old log /mysql/logs/general.log.107 does not exist
renaming /mysql/logs/general.log.106 to /mysql/logs/general.log.107 (rotatecount 120, logstart 1, i 106),
old log /mysql/logs/general.log.106 does not exist
renaming /mysql/logs/general.log.105 to /mysql/logs/general.log.106 (rotatecount 120, logstart 1, i 105),
old log /mysql/logs/general.log.105 does not exist
renaming /mysql/logs/general.log.104 to /mysql/logs/general.log.105 (rotatecount 120, logstart 1, i 104),
old log /mysql/logs/general.log.104 does not exist
renaming /mysql/logs/general.log.103 to /mysql/logs/general.log.104 (rotatecount 120, logstart 1, i 103),
old log /mysql/logs/general.log.103 does not exist
renaming /mysql/logs/general.log.102 to /mysql/logs/general.log.103 (rotatecount 120, logstart 1, i 102),
old log /mysql/logs/general.log.102 does not exist
renaming /mysql/logs/general.log.101 to /mysql/logs/general.log.102 (rotatecount 120, logstart 1, i 101),
old log /mysql/logs/general.log.101 does not exist
renaming /mysql/logs/general.log.100 to /mysql/logs/general.log.101 (rotatecount 120, logstart 1, i 100),
old log /mysql/logs/general.log.100 does not exist
renaming /mysql/logs/general.log.99 to /mysql/logs/general.log.100 (rotatecount 120, logstart 1, i 99),
old log /mysql/logs/general.log.99 does not exist
renaming /mysql/logs/general.log.98 to /mysql/logs/general.log.99 (rotatecount 120, logstart 1, i 98),
old log /mysql/logs/general.log.98 does not exist
renaming /mysql/logs/general.log.97 to /mysql/logs/general.log.98 (rotatecount 120, logstart 1, i 97),
old log /mysql/logs/general.log.97 does not exist
renaming /mysql/logs/general.log.96 to /mysql/logs/general.log.97 (rotatecount 120, logstart 1, i 96),
old log /mysql/logs/general.log.96 does not exist
renaming /mysql/logs/general.log.95 to /mysql/logs/general.log.96 (rotatecount 120, logstart 1, i 95),
old log /mysql/logs/general.log.95 does not exist
renaming /mysql/logs/general.log.94 to /mysql/logs/general.log.95 (rotatecount 120, logstart 1, i 94),
old log /mysql/logs/general.log.94 does not exist
renaming /mysql/logs/general.log.93 to /mysql/logs/general.log.94 (rotatecount 120, logstart 1, i 93),
old log /mysql/logs/general.log.93 does not exist
renaming /mysql/logs/general.log.92 to /mysql/logs/general.log.93 (rotatecount 120, logstart 1, i 92),
old log /mysql/logs/general.log.92 does not exist
renaming /mysql/logs/general.log.91 to /mysql/logs/general.log.92 (rotatecount 120, logstart 1, i 91),
old log /mysql/logs/general.log.91 does not exist
renaming /mysql/logs/general.log.90 to /mysql/logs/general.log.91 (rotatecount 120, logstart 1, i 90),
old log /mysql/logs/general.log.90 does not exist
renaming /mysql/logs/general.log.89 to /mysql/logs/general.log.90 (rotatecount 120, logstart 1, i 89),
old log /mysql/logs/general.log.89 does not exist
renaming /mysql/logs/general.log.88 to /mysql/logs/general.log.89 (rotatecount 120, logstart 1, i 88),
old log /mysql/logs/general.log.88 does not exist
renaming /mysql/logs/general.log.87 to /mysql/logs/general.log.88 (rotatecount 120, logstart 1, i 87),
old log /mysql/logs/general.log.87 does not exist
renaming /mysql/logs/general.log.86 to /mysql/logs/general.log.87 (rotatecount 120, logstart 1, i 86),
old log /mysql/logs/general.log.86 does not exist
renaming /mysql/logs/general.log.85 to /mysql/logs/general.log.86 (rotatecount 120, logstart 1, i 85),
old log /mysql/logs/general.log.85 does not exist
renaming /mysql/logs/general.log.84 to /mysql/logs/general.log.85 (rotatecount 120, logstart 1, i 84),
old log /mysql/logs/general.log.84 does not exist
renaming /mysql/logs/general.log.83 to /mysql/logs/general.log.84 (rotatecount 120, logstart 1, i 83),
old log /mysql/logs/general.log.83 does not exist
renaming /mysql/logs/general.log.82 to /mysql/logs/general.log.83 (rotatecount 120, logstart 1, i 82),
old log /mysql/logs/general.log.82 does not exist
renaming /mysql/logs/general.log.81 to /mysql/logs/general.log.82 (rotatecount 120, logstart 1, i 81),
old log /mysql/logs/general.log.81 does not exist
renaming /mysql/logs/general.log.80 to /mysql/logs/general.log.81 (rotatecount 120, logstart 1, i 80),
old log /mysql/logs/general.log.80 does not exist
renaming /mysql/logs/general.log.79 to /mysql/logs/general.log.80 (rotatecount 120, logstart 1, i 79),
old log /mysql/logs/general.log.79 does not exist
renaming /mysql/logs/general.log.78 to /mysql/logs/general.log.79 (rotatecount 120, logstart 1, i 78),
old log /mysql/logs/general.log.78 does not exist
renaming /mysql/logs/general.log.77 to /mysql/logs/general.log.78 (rotatecount 120, logstart 1, i 77),
old log /mysql/logs/general.log.77 does not exist
renaming /mysql/logs/general.log.76 to /mysql/logs/general.log.77 (rotatecount 120, logstart 1, i 76),
old log /mysql/logs/general.log.76 does not exist
renaming /mysql/logs/general.log.75 to /mysql/logs/general.log.76 (rotatecount 120, logstart 1, i 75),
old log /mysql/logs/general.log.75 does not exist
renaming /mysql/logs/general.log.74 to /mysql/logs/general.log.75 (rotatecount 120, logstart 1, i 74),
old log /mysql/logs/general.log.74 does not exist
renaming /mysql/logs/general.log.73 to /mysql/logs/general.log.74 (rotatecount 120, logstart 1, i 73),
old log /mysql/logs/general.log.73 does not exist
renaming /mysql/logs/general.log.72 to /mysql/logs/general.log.73 (rotatecount 120, logstart 1, i 72),
old log /mysql/logs/general.log.72 does not exist
renaming /mysql/logs/general.log.71 to /mysql/logs/general.log.72 (rotatecount 120, logstart 1, i 71),
old log /mysql/logs/general.log.71 does not exist
renaming /mysql/logs/general.log.70 to /mysql/logs/general.log.71 (rotatecount 120, logstart 1, i 70),
old log /mysql/logs/general.log.70 does not exist
renaming /mysql/logs/general.log.69 to /mysql/logs/general.log.70 (rotatecount 120, logstart 1, i 69),
old log /mysql/logs/general.log.69 does not exist
renaming /mysql/logs/general.log.68 to /mysql/logs/general.log.69 (rotatecount 120, logstart 1, i 68),
old log /mysql/logs/general.log.68 does not exist
renaming /mysql/logs/general.log.67 to /mysql/logs/general.log.68 (rotatecount 120, logstart 1, i 67),
old log /mysql/logs/general.log.67 does not exist
renaming /mysql/logs/general.log.66 to /mysql/logs/general.log.67 (rotatecount 120, logstart 1, i 66),
old log /mysql/logs/general.log.66 does not exist
renaming /mysql/logs/general.log.65 to /mysql/logs/general.log.66 (rotatecount 120, logstart 1, i 65),
old log /mysql/logs/general.log.65 does not exist
renaming /mysql/logs/general.log.64 to /mysql/logs/general.log.65 (rotatecount 120, logstart 1, i 64),
old log /mysql/logs/general.log.64 does not exist
renaming /mysql/logs/general.log.63 to /mysql/logs/general.log.64 (rotatecount 120, logstart 1, i 63),
old log /mysql/logs/general.log.63 does not exist
renaming /mysql/logs/general.log.62 to /mysql/logs/general.log.63 (rotatecount 120, logstart 1, i 62),
old log /mysql/logs/general.log.62 does not exist
renaming /mysql/logs/general.log.61 to /mysql/logs/general.log.62 (rotatecount 120, logstart 1, i 61),
old log /mysql/logs/general.log.61 does not exist
renaming /mysql/logs/general.log.60 to /mysql/logs/general.log.61 (rotatecount 120, logstart 1, i 60),
old log /mysql/logs/general.log.60 does not exist
renaming /mysql/logs/general.log.59 to /mysql/logs/general.log.60 (rotatecount 120, logstart 1, i 59),
old log /mysql/logs/general.log.59 does not exist
renaming /mysql/logs/general.log.58 to /mysql/logs/general.log.59 (rotatecount 120, logstart 1, i 58),
old log /mysql/logs/general.log.58 does not exist
renaming /mysql/logs/general.log.57 to /mysql/logs/general.log.58 (rotatecount 120, logstart 1, i 57),
old log /mysql/logs/general.log.57 does not exist
renaming /mysql/logs/general.log.56 to /mysql/logs/general.log.57 (rotatecount 120, logstart 1, i 56),
old log /mysql/logs/general.log.56 does not exist
renaming /mysql/logs/general.log.55 to /mysql/logs/general.log.56 (rotatecount 120, logstart 1, i 55),
old log /mysql/logs/general.log.55 does not exist
renaming /mysql/logs/general.log.54 to /mysql/logs/general.log.55 (rotatecount 120, logstart 1, i 54),
old log /mysql/logs/general.log.54 does not exist
renaming /mysql/logs/general.log.53 to /mysql/logs/general.log.54 (rotatecount 120, logstart 1, i 53),
old log /mysql/logs/general.log.53 does not exist
renaming /mysql/logs/general.log.52 to /mysql/logs/general.log.53 (rotatecount 120, logstart 1, i 52),
old log /mysql/logs/general.log.52 does not exist
renaming /mysql/logs/general.log.51 to /mysql/logs/general.log.52 (rotatecount 120, logstart 1, i 51),
old log /mysql/logs/general.log.51 does not exist
renaming /mysql/logs/general.log.50 to /mysql/logs/general.log.51 (rotatecount 120, logstart 1, i 50),
old log /mysql/logs/general.log.50 does not exist
renaming /mysql/logs/general.log.49 to /mysql/logs/general.log.50 (rotatecount 120, logstart 1, i 49),
old log /mysql/logs/general.log.49 does not exist
renaming /mysql/logs/general.log.48 to /mysql/logs/general.log.49 (rotatecount 120, logstart 1, i 48),
old log /mysql/logs/general.log.48 does not exist
renaming /mysql/logs/general.log.47 to /mysql/logs/general.log.48 (rotatecount 120, logstart 1, i 47),
old log /mysql/logs/general.log.47 does not exist
renaming /mysql/logs/general.log.46 to /mysql/logs/general.log.47 (rotatecount 120, logstart 1, i 46),
old log /mysql/logs/general.log.46 does not exist
renaming /mysql/logs/general.log.45 to /mysql/logs/general.log.46 (rotatecount 120, logstart 1, i 45),
old log /mysql/logs/general.log.45 does not exist
renaming /mysql/logs/general.log.44 to /mysql/logs/general.log.45 (rotatecount 120, logstart 1, i 44),
old log /mysql/logs/general.log.44 does not exist
renaming /mysql/logs/general.log.43 to /mysql/logs/general.log.44 (rotatecount 120, logstart 1, i 43),
old log /mysql/logs/general.log.43 does not exist
renaming /mysql/logs/general.log.42 to /mysql/logs/general.log.43 (rotatecount 120, logstart 1, i 42),
old log /mysql/logs/general.log.42 does not exist
renaming /mysql/logs/general.log.41 to /mysql/logs/general.log.42 (rotatecount 120, logstart 1, i 41),
old log /mysql/logs/general.log.41 does not exist
renaming /mysql/logs/general.log.40 to /mysql/logs/general.log.41 (rotatecount 120, logstart 1, i 40),
old log /mysql/logs/general.log.40 does not exist
renaming /mysql/logs/general.log.39 to /mysql/logs/general.log.40 (rotatecount 120, logstart 1, i 39),
old log /mysql/logs/general.log.39 does not exist
renaming /mysql/logs/general.log.38 to /mysql/logs/general.log.39 (rotatecount 120, logstart 1, i 38),
old log /mysql/logs/general.log.38 does not exist
renaming /mysql/logs/general.log.37 to /mysql/logs/general.log.38 (rotatecount 120, logstart 1, i 37),
old log /mysql/logs/general.log.37 does not exist
renaming /mysql/logs/general.log.36 to /mysql/logs/general.log.37 (rotatecount 120, logstart 1, i 36),
old log /mysql/logs/general.log.36 does not exist
renaming /mysql/logs/general.log.35 to /mysql/logs/general.log.36 (rotatecount 120, logstart 1, i 35),
old log /mysql/logs/general.log.35 does not exist
renaming /mysql/logs/general.log.34 to /mysql/logs/general.log.35 (rotatecount 120, logstart 1, i 34),
old log /mysql/logs/general.log.34 does not exist
renaming /mysql/logs/general.log.33 to /mysql/logs/general.log.34 (rotatecount 120, logstart 1, i 33),
old log /mysql/logs/general.log.33 does not exist
renaming /mysql/logs/general.log.32 to /mysql/logs/general.log.33 (rotatecount 120, logstart 1, i 32),
old log /mysql/logs/general.log.32 does not exist
renaming /mysql/logs/general.log.31 to /mysql/logs/general.log.32 (rotatecount 120, logstart 1, i 31),
old log /mysql/logs/general.log.31 does not exist
renaming /mysql/logs/general.log.30 to /mysql/logs/general.log.31 (rotatecount 120, logstart 1, i 30),
old log /mysql/logs/general.log.30 does not exist
renaming /mysql/logs/general.log.29 to /mysql/logs/general.log.30 (rotatecount 120, logstart 1, i 29),
old log /mysql/logs/general.log.29 does not exist
renaming /mysql/logs/general.log.28 to /mysql/logs/general.log.29 (rotatecount 120, logstart 1, i 28),
old log /mysql/logs/general.log.28 does not exist
renaming /mysql/logs/general.log.27 to /mysql/logs/general.log.28 (rotatecount 120, logstart 1, i 27),
old log /mysql/logs/general.log.27 does not exist
renaming /mysql/logs/general.log.26 to /mysql/logs/general.log.27 (rotatecount 120, logstart 1, i 26),
old log /mysql/logs/general.log.26 does not exist
renaming /mysql/logs/general.log.25 to /mysql/logs/general.log.26 (rotatecount 120, logstart 1, i 25),
old log /mysql/logs/general.log.25 does not exist
renaming /mysql/logs/general.log.24 to /mysql/logs/general.log.25 (rotatecount 120, logstart 1, i 24),
old log /mysql/logs/general.log.24 does not exist
renaming /mysql/logs/general.log.23 to /mysql/logs/general.log.24 (rotatecount 120, logstart 1, i 23),
old log /mysql/logs/general.log.23 does not exist
renaming /mysql/logs/general.log.22 to /mysql/logs/general.log.23 (rotatecount 120, logstart 1, i 22),
old log /mysql/logs/general.log.22 does not exist
renaming /mysql/logs/general.log.21 to /mysql/logs/general.log.22 (rotatecount 120, logstart 1, i 21),
old log /mysql/logs/general.log.21 does not exist
renaming /mysql/logs/general.log.20 to /mysql/logs/general.log.21 (rotatecount 120, logstart 1, i 20),
old log /mysql/logs/general.log.20 does not exist
renaming /mysql/logs/general.log.19 to /mysql/logs/general.log.20 (rotatecount 120, logstart 1, i 19),
old log /mysql/logs/general.log.19 does not exist
renaming /mysql/logs/general.log.18 to /mysql/logs/general.log.19 (rotatecount 120, logstart 1, i 18),
old log /mysql/logs/general.log.18 does not exist
renaming /mysql/logs/general.log.17 to /mysql/logs/general.log.18 (rotatecount 120, logstart 1, i 17),
old log /mysql/logs/general.log.17 does not exist
renaming /mysql/logs/general.log.16 to /mysql/logs/general.log.17 (rotatecount 120, logstart 1, i 16),
old log /mysql/logs/general.log.16 does not exist
renaming /mysql/logs/general.log.15 to /mysql/logs/general.log.16 (rotatecount 120, logstart 1, i 15),
old log /mysql/logs/general.log.15 does not exist
renaming /mysql/logs/general.log.14 to /mysql/logs/general.log.15 (rotatecount 120, logstart 1, i 14),
old log /mysql/logs/general.log.14 does not exist
renaming /mysql/logs/general.log.13 to /mysql/logs/general.log.14 (rotatecount 120, logstart 1, i 13),
old log /mysql/logs/general.log.13 does not exist
renaming /mysql/logs/general.log.12 to /mysql/logs/general.log.13 (rotatecount 120, logstart 1, i 12),
old log /mysql/logs/general.log.12 does not exist
renaming /mysql/logs/general.log.11 to /mysql/logs/general.log.12 (rotatecount 120, logstart 1, i 11),
old log /mysql/logs/general.log.11 does not exist
renaming /mysql/logs/general.log.10 to /mysql/logs/general.log.11 (rotatecount 120, logstart 1, i 10),
old log /mysql/logs/general.log.10 does not exist
renaming /mysql/logs/general.log.9 to /mysql/logs/general.log.10 (rotatecount 120, logstart 1, i 9),
old log /mysql/logs/general.log.9 does not exist
renaming /mysql/logs/general.log.8 to /mysql/logs/general.log.9 (rotatecount 120, logstart 1, i 8),
old log /mysql/logs/general.log.8 does not exist
renaming /mysql/logs/general.log.7 to /mysql/logs/general.log.8 (rotatecount 120, logstart 1, i 7),
old log /mysql/logs/general.log.7 does not exist
renaming /mysql/logs/general.log.6 to /mysql/logs/general.log.7 (rotatecount 120, logstart 1, i 6),
old log /mysql/logs/general.log.6 does not exist
renaming /mysql/logs/general.log.5 to /mysql/logs/general.log.6 (rotatecount 120, logstart 1, i 5),
old log /mysql/logs/general.log.5 does not exist
renaming /mysql/logs/general.log.4 to /mysql/logs/general.log.5 (rotatecount 120, logstart 1, i 4),
old log /mysql/logs/general.log.4 does not exist
renaming /mysql/logs/general.log.3 to /mysql/logs/general.log.4 (rotatecount 120, logstart 1, i 3),
renaming /mysql/logs/general.log.2 to /mysql/logs/general.log.3 (rotatecount 120, logstart 1, i 2),
renaming /mysql/logs/general.log.1 to /mysql/logs/general.log.2 (rotatecount 120, logstart 1, i 1),
renaming /mysql/logs/general.log.0 to /mysql/logs/general.log.1 (rotatecount 120, logstart 1, i 0),
old log /mysql/logs/general.log.0 does not exist
log /mysql/logs/general.log.121 doesn't exist -- won't try to dispose of it
rotating log /mysql/logs/slow-queries.log, log->rotateCount is 120
renaming /mysql/logs/slow-queries.log.120 to /mysql/logs/slow-queries.log.121 (rotatecount 120, logstart 1, i 120),
old log /mysql/logs/slow-queries.log.120 does not exist
renaming /mysql/logs/slow-queries.log.119 to /mysql/logs/slow-queries.log.120 (rotatecount 120, logstart 1, i 119),
old log /mysql/logs/slow-queries.log.119 does not exist
renaming /mysql/logs/slow-queries.log.118 to /mysql/logs/slow-queries.log.119 (rotatecount 120, logstart 1, i 118),
old log /mysql/logs/slow-queries.log.118 does not exist
renaming /mysql/logs/slow-queries.log.117 to /mysql/logs/slow-queries.log.118 (rotatecount 120, logstart 1, i 117),
old log /mysql/logs/slow-queries.log.117 does not exist
renaming /mysql/logs/slow-queries.log.116 to /mysql/logs/slow-queries.log.117 (rotatecount 120, logstart 1, i 116),
old log /mysql/logs/slow-queries.log.116 does not exist
renaming /mysql/logs/slow-queries.log.115 to /mysql/logs/slow-queries.log.116 (rotatecount 120, logstart 1, i 115),
old log /mysql/logs/slow-queries.log.115 does not exist
renaming /mysql/logs/slow-queries.log.114 to /mysql/logs/slow-queries.log.115 (rotatecount 120, logstart 1, i 114),
old log /mysql/logs/slow-queries.log.114 does not exist
renaming /mysql/logs/slow-queries.log.113 to /mysql/logs/slow-queries.log.114 (rotatecount 120, logstart 1, i 113),
old log /mysql/logs/slow-queries.log.113 does not exist
renaming /mysql/logs/slow-queries.log.112 to /mysql/logs/slow-queries.log.113 (rotatecount 120, logstart 1, i 112),
old log /mysql/logs/slow-queries.log.112 does not exist
renaming /mysql/logs/slow-queries.log.111 to /mysql/logs/slow-queries.log.112 (rotatecount 120, logstart 1, i 111),
old log /mysql/logs/slow-queries.log.111 does not exist
renaming /mysql/logs/slow-queries.log.110 to /mysql/logs/slow-queries.log.111 (rotatecount 120, logstart 1, i 110),
old log /mysql/logs/slow-queries.log.110 does not exist
renaming /mysql/logs/slow-queries.log.109 to /mysql/logs/slow-queries.log.110 (rotatecount 120, logstart 1, i 109),
old log /mysql/logs/slow-queries.log.109 does not exist
renaming /mysql/logs/slow-queries.log.108 to /mysql/logs/slow-queries.log.109 (rotatecount 120, logstart 1, i 108),
old log /mysql/logs/slow-queries.log.108 does not exist
renaming /mysql/logs/slow-queries.log.107 to /mysql/logs/slow-queries.log.108 (rotatecount 120, logstart 1, i 107),
old log /mysql/logs/slow-queries.log.107 does not exist
renaming /mysql/logs/slow-queries.log.106 to /mysql/logs/slow-queries.log.107 (rotatecount 120, logstart 1, i 106),
old log /mysql/logs/slow-queries.log.106 does not exist
renaming /mysql/logs/slow-queries.log.105 to /mysql/logs/slow-queries.log.106 (rotatecount 120, logstart 1, i 105),
old log /mysql/logs/slow-queries.log.105 does not exist
renaming /mysql/logs/slow-queries.log.104 to /mysql/logs/slow-queries.log.105 (rotatecount 120, logstart 1, i 104),
old log /mysql/logs/slow-queries.log.104 does not exist
renaming /mysql/logs/slow-queries.log.103 to /mysql/logs/slow-queries.log.104 (rotatecount 120, logstart 1, i 103),
old log /mysql/logs/slow-queries.log.103 does not exist
renaming /mysql/logs/slow-queries.log.102 to /mysql/logs/slow-queries.log.103 (rotatecount 120, logstart 1, i 102),
old log /mysql/logs/slow-queries.log.102 does not exist
renaming /mysql/logs/slow-queries.log.101 to /mysql/logs/slow-queries.log.102 (rotatecount 120, logstart 1, i 101),
old log /mysql/logs/slow-queries.log.101 does not exist
renaming /mysql/logs/slow-queries.log.100 to /mysql/logs/slow-queries.log.101 (rotatecount 120, logstart 1, i 100),
old log /mysql/logs/slow-queries.log.100 does not exist
renaming /mysql/logs/slow-queries.log.99 to /mysql/logs/slow-queries.log.100 (rotatecount 120, logstart 1, i 99),
old log /mysql/logs/slow-queries.log.99 does not exist
renaming /mysql/logs/slow-queries.log.98 to /mysql/logs/slow-queries.log.99 (rotatecount 120, logstart 1, i 98),
old log /mysql/logs/slow-queries.log.98 does not exist
renaming /mysql/logs/slow-queries.log.97 to /mysql/logs/slow-queries.log.98 (rotatecount 120, logstart 1, i 97),
old log /mysql/logs/slow-queries.log.97 does not exist
renaming /mysql/logs/slow-queries.log.96 to /mysql/logs/slow-queries.log.97 (rotatecount 120, logstart 1, i 96),
old log /mysql/logs/slow-queries.log.96 does not exist
renaming /mysql/logs/slow-queries.log.95 to /mysql/logs/slow-queries.log.96 (rotatecount 120, logstart 1, i 95),
old log /mysql/logs/slow-queries.log.95 does not exist
renaming /mysql/logs/slow-queries.log.94 to /mysql/logs/slow-queries.log.95 (rotatecount 120, logstart 1, i 94),
old log /mysql/logs/slow-queries.log.94 does not exist
renaming /mysql/logs/slow-queries.log.93 to /mysql/logs/slow-queries.log.94 (rotatecount 120, logstart 1, i 93),
old log /mysql/logs/slow-queries.log.93 does not exist
renaming /mysql/logs/slow-queries.log.92 to /mysql/logs/slow-queries.log.93 (rotatecount 120, logstart 1, i 92),
old log /mysql/logs/slow-queries.log.92 does not exist
renaming /mysql/logs/slow-queries.log.91 to /mysql/logs/slow-queries.log.92 (rotatecount 120, logstart 1, i 91),
old log /mysql/logs/slow-queries.log.91 does not exist
renaming /mysql/logs/slow-queries.log.90 to /mysql/logs/slow-queries.log.91 (rotatecount 120, logstart 1, i 90),
old log /mysql/logs/slow-queries.log.90 does not exist
renaming /mysql/logs/slow-queries.log.89 to /mysql/logs/slow-queries.log.90 (rotatecount 120, logstart 1, i 89),
old log /mysql/logs/slow-queries.log.89 does not exist
renaming /mysql/logs/slow-queries.log.88 to /mysql/logs/slow-queries.log.89 (rotatecount 120, logstart 1, i 88),
old log /mysql/logs/slow-queries.log.88 does not exist
renaming /mysql/logs/slow-queries.log.87 to /mysql/logs/slow-queries.log.88 (rotatecount 120, logstart 1, i 87),
old log /mysql/logs/slow-queries.log.87 does not exist
renaming /mysql/logs/slow-queries.log.86 to /mysql/logs/slow-queries.log.87 (rotatecount 120, logstart 1, i 86),
old log /mysql/logs/slow-queries.log.86 does not exist
renaming /mysql/logs/slow-queries.log.85 to /mysql/logs/slow-queries.log.86 (rotatecount 120, logstart 1, i 85),
old log /mysql/logs/slow-queries.log.85 does not exist
renaming /mysql/logs/slow-queries.log.84 to /mysql/logs/slow-queries.log.85 (rotatecount 120, logstart 1, i 84),
old log /mysql/logs/slow-queries.log.84 does not exist
renaming /mysql/logs/slow-queries.log.83 to /mysql/logs/slow-queries.log.84 (rotatecount 120, logstart 1, i 83),
old log /mysql/logs/slow-queries.log.83 does not exist
renaming /mysql/logs/slow-queries.log.82 to /mysql/logs/slow-queries.log.83 (rotatecount 120, logstart 1, i 82),
old log /mysql/logs/slow-queries.log.82 does not exist
renaming /mysql/logs/slow-queries.log.81 to /mysql/logs/slow-queries.log.82 (rotatecount 120, logstart 1, i 81),
old log /mysql/logs/slow-queries.log.81 does not exist
renaming /mysql/logs/slow-queries.log.80 to /mysql/logs/slow-queries.log.81 (rotatecount 120, logstart 1, i 80),
old log /mysql/logs/slow-queries.log.80 does not exist
renaming /mysql/logs/slow-queries.log.79 to /mysql/logs/slow-queries.log.80 (rotatecount 120, logstart 1, i 79),
old log /mysql/logs/slow-queries.log.79 does not exist
renaming /mysql/logs/slow-queries.log.78 to /mysql/logs/slow-queries.log.79 (rotatecount 120, logstart 1, i 78),
old log /mysql/logs/slow-queries.log.78 does not exist
renaming /mysql/logs/slow-queries.log.77 to /mysql/logs/slow-queries.log.78 (rotatecount 120, logstart 1, i 77),
old log /mysql/logs/slow-queries.log.77 does not exist
renaming /mysql/logs/slow-queries.log.76 to /mysql/logs/slow-queries.log.77 (rotatecount 120, logstart 1, i 76),
old log /mysql/logs/slow-queries.log.76 does not exist
renaming /mysql/logs/slow-queries.log.75 to /mysql/logs/slow-queries.log.76 (rotatecount 120, logstart 1, i 75),
old log /mysql/logs/slow-queries.log.75 does not exist
renaming /mysql/logs/slow-queries.log.74 to /mysql/logs/slow-queries.log.75 (rotatecount 120, logstart 1, i 74),
old log /mysql/logs/slow-queries.log.74 does not exist
renaming /mysql/logs/slow-queries.log.73 to /mysql/logs/slow-queries.log.74 (rotatecount 120, logstart 1, i 73),
old log /mysql/logs/slow-queries.log.73 does not exist
renaming /mysql/logs/slow-queries.log.72 to /mysql/logs/slow-queries.log.73 (rotatecount 120, logstart 1, i 72),
old log /mysql/logs/slow-queries.log.72 does not exist
renaming /mysql/logs/slow-queries.log.71 to /mysql/logs/slow-queries.log.72 (rotatecount 120, logstart 1, i 71),
old log /mysql/logs/slow-queries.log.71 does not exist
renaming /mysql/logs/slow-queries.log.70 to /mysql/logs/slow-queries.log.71 (rotatecount 120, logstart 1, i 70),
old log /mysql/logs/slow-queries.log.70 does not exist
renaming /mysql/logs/slow-queries.log.69 to /mysql/logs/slow-queries.log.70 (rotatecount 120, logstart 1, i 69),
old log /mysql/logs/slow-queries.log.69 does not exist
renaming /mysql/logs/slow-queries.log.68 to /mysql/logs/slow-queries.log.69 (rotatecount 120, logstart 1, i 68),
old log /mysql/logs/slow-queries.log.68 does not exist
renaming /mysql/logs/slow-queries.log.67 to /mysql/logs/slow-queries.log.68 (rotatecount 120, logstart 1, i 67),
old log /mysql/logs/slow-queries.log.67 does not exist
renaming /mysql/logs/slow-queries.log.66 to /mysql/logs/slow-queries.log.67 (rotatecount 120, logstart 1, i 66),
old log /mysql/logs/slow-queries.log.66 does not exist
renaming /mysql/logs/slow-queries.log.65 to /mysql/logs/slow-queries.log.66 (rotatecount 120, logstart 1, i 65),
old log /mysql/logs/slow-queries.log.65 does not exist
renaming /mysql/logs/slow-queries.log.64 to /mysql/logs/slow-queries.log.65 (rotatecount 120, logstart 1, i 64),
old log /mysql/logs/slow-queries.log.64 does not exist
renaming /mysql/logs/slow-queries.log.63 to /mysql/logs/slow-queries.log.64 (rotatecount 120, logstart 1, i 63),
old log /mysql/logs/slow-queries.log.63 does not exist
renaming /mysql/logs/slow-queries.log.62 to /mysql/logs/slow-queries.log.63 (rotatecount 120, logstart 1, i 62),
old log /mysql/logs/slow-queries.log.62 does not exist
renaming /mysql/logs/slow-queries.log.61 to /mysql/logs/slow-queries.log.62 (rotatecount 120, logstart 1, i 61),
old log /mysql/logs/slow-queries.log.61 does not exist
renaming /mysql/logs/slow-queries.log.60 to /mysql/logs/slow-queries.log.61 (rotatecount 120, logstart 1, i 60),
old log /mysql/logs/slow-queries.log.60 does not exist
renaming /mysql/logs/slow-queries.log.59 to /mysql/logs/slow-queries.log.60 (rotatecount 120, logstart 1, i 59),
old log /mysql/logs/slow-queries.log.59 does not exist
renaming /mysql/logs/slow-queries.log.58 to /mysql/logs/slow-queries.log.59 (rotatecount 120, logstart 1, i 58),
old log /mysql/logs/slow-queries.log.58 does not exist
renaming /mysql/logs/slow-queries.log.57 to /mysql/logs/slow-queries.log.58 (rotatecount 120, logstart 1, i 57),
old log /mysql/logs/slow-queries.log.57 does not exist
renaming /mysql/logs/slow-queries.log.56 to /mysql/logs/slow-queries.log.57 (rotatecount 120, logstart 1, i 56),
old log /mysql/logs/slow-queries.log.56 does not exist
renaming /mysql/logs/slow-queries.log.55 to /mysql/logs/slow-queries.log.56 (rotatecount 120, logstart 1, i 55),
old log /mysql/logs/slow-queries.log.55 does not exist
renaming /mysql/logs/slow-queries.log.54 to /mysql/logs/slow-queries.log.55 (rotatecount 120, logstart 1, i 54),
old log /mysql/logs/slow-queries.log.54 does not exist
renaming /mysql/logs/slow-queries.log.53 to /mysql/logs/slow-queries.log.54 (rotatecount 120, logstart 1, i 53),
old log /mysql/logs/slow-queries.log.53 does not exist
renaming /mysql/logs/slow-queries.log.52 to /mysql/logs/slow-queries.log.53 (rotatecount 120, logstart 1, i 52),
old log /mysql/logs/slow-queries.log.52 does not exist
renaming /mysql/logs/slow-queries.log.51 to /mysql/logs/slow-queries.log.52 (rotatecount 120, logstart 1, i 51),
old log /mysql/logs/slow-queries.log.51 does not exist
renaming /mysql/logs/slow-queries.log.50 to /mysql/logs/slow-queries.log.51 (rotatecount 120, logstart 1, i 50),
old log /mysql/logs/slow-queries.log.50 does not exist
renaming /mysql/logs/slow-queries.log.49 to /mysql/logs/slow-queries.log.50 (rotatecount 120, logstart 1, i 49),
old log /mysql/logs/slow-queries.log.49 does not exist
renaming /mysql/logs/slow-queries.log.48 to /mysql/logs/slow-queries.log.49 (rotatecount 120, logstart 1, i 48),
old log /mysql/logs/slow-queries.log.48 does not exist
renaming /mysql/logs/slow-queries.log.47 to /mysql/logs/slow-queries.log.48 (rotatecount 120, logstart 1, i 47),
old log /mysql/logs/slow-queries.log.47 does not exist
renaming /mysql/logs/slow-queries.log.46 to /mysql/logs/slow-queries.log.47 (rotatecount 120, logstart 1, i 46),
old log /mysql/logs/slow-queries.log.46 does not exist
renaming /mysql/logs/slow-queries.log.45 to /mysql/logs/slow-queries.log.46 (rotatecount 120, logstart 1, i 45),
old log /mysql/logs/slow-queries.log.45 does not exist
renaming /mysql/logs/slow-queries.log.44 to /mysql/logs/slow-queries.log.45 (rotatecount 120, logstart 1, i 44),
old log /mysql/logs/slow-queries.log.44 does not exist
renaming /mysql/logs/slow-queries.log.43 to /mysql/logs/slow-queries.log.44 (rotatecount 120, logstart 1, i 43),
old log /mysql/logs/slow-queries.log.43 does not exist
renaming /mysql/logs/slow-queries.log.42 to /mysql/logs/slow-queries.log.43 (rotatecount 120, logstart 1, i 42),
old log /mysql/logs/slow-queries.log.42 does not exist
renaming /mysql/logs/slow-queries.log.41 to /mysql/logs/slow-queries.log.42 (rotatecount 120, logstart 1, i 41),
old log /mysql/logs/slow-queries.log.41 does not exist
renaming /mysql/logs/slow-queries.log.40 to /mysql/logs/slow-queries.log.41 (rotatecount 120, logstart 1, i 40),
old log /mysql/logs/slow-queries.log.40 does not exist
renaming /mysql/logs/slow-queries.log.39 to /mysql/logs/slow-queries.log.40 (rotatecount 120, logstart 1, i 39),
old log /mysql/logs/slow-queries.log.39 does not exist
renaming /mysql/logs/slow-queries.log.38 to /mysql/logs/slow-queries.log.39 (rotatecount 120, logstart 1, i 38),
old log /mysql/logs/slow-queries.log.38 does not exist
renaming /mysql/logs/slow-queries.log.37 to /mysql/logs/slow-queries.log.38 (rotatecount 120, logstart 1, i 37),
old log /mysql/logs/slow-queries.log.37 does not exist
renaming /mysql/logs/slow-queries.log.36 to /mysql/logs/slow-queries.log.37 (rotatecount 120, logstart 1, i 36),
old log /mysql/logs/slow-queries.log.36 does not exist
renaming /mysql/logs/slow-queries.log.35 to /mysql/logs/slow-queries.log.36 (rotatecount 120, logstart 1, i 35),
old log /mysql/logs/slow-queries.log.35 does not exist
renaming /mysql/logs/slow-queries.log.34 to /mysql/logs/slow-queries.log.35 (rotatecount 120, logstart 1, i 34),
old log /mysql/logs/slow-queries.log.34 does not exist
renaming /mysql/logs/slow-queries.log.33 to /mysql/logs/slow-queries.log.34 (rotatecount 120, logstart 1, i 33),
old log /mysql/logs/slow-queries.log.33 does not exist
renaming /mysql/logs/slow-queries.log.32 to /mysql/logs/slow-queries.log.33 (rotatecount 120, logstart 1, i 32),
old log /mysql/logs/slow-queries.log.32 does not exist
renaming /mysql/logs/slow-queries.log.31 to /mysql/logs/slow-queries.log.32 (rotatecount 120, logstart 1, i 31),
old log /mysql/logs/slow-queries.log.31 does not exist
renaming /mysql/logs/slow-queries.log.30 to /mysql/logs/slow-queries.log.31 (rotatecount 120, logstart 1, i 30),
old log /mysql/logs/slow-queries.log.30 does not exist
renaming /mysql/logs/slow-queries.log.29 to /mysql/logs/slow-queries.log.30 (rotatecount 120, logstart 1, i 29),
old log /mysql/logs/slow-queries.log.29 does not exist
renaming /mysql/logs/slow-queries.log.28 to /mysql/logs/slow-queries.log.29 (rotatecount 120, logstart 1, i 28),
old log /mysql/logs/slow-queries.log.28 does not exist
renaming /mysql/logs/slow-queries.log.27 to /mysql/logs/slow-queries.log.28 (rotatecount 120, logstart 1, i 27),
old log /mysql/logs/slow-queries.log.27 does not exist
renaming /mysql/logs/slow-queries.log.26 to /mysql/logs/slow-queries.log.27 (rotatecount 120, logstart 1, i 26),
old log /mysql/logs/slow-queries.log.26 does not exist
renaming /mysql/logs/slow-queries.log.25 to /mysql/logs/slow-queries.log.26 (rotatecount 120, logstart 1, i 25),
old log /mysql/logs/slow-queries.log.25 does not exist
renaming /mysql/logs/slow-queries.log.24 to /mysql/logs/slow-queries.log.25 (rotatecount 120, logstart 1, i 24),
old log /mysql/logs/slow-queries.log.24 does not exist
renaming /mysql/logs/slow-queries.log.23 to /mysql/logs/slow-queries.log.24 (rotatecount 120, logstart 1, i 23),
old log /mysql/logs/slow-queries.log.23 does not exist
renaming /mysql/logs/slow-queries.log.22 to /mysql/logs/slow-queries.log.23 (rotatecount 120, logstart 1, i 22),
old log /mysql/logs/slow-queries.log.22 does not exist
renaming /mysql/logs/slow-queries.log.21 to /mysql/logs/slow-queries.log.22 (rotatecount 120, logstart 1, i 21),
old log /mysql/logs/slow-queries.log.21 does not exist
renaming /mysql/logs/slow-queries.log.20 to /mysql/logs/slow-queries.log.21 (rotatecount 120, logstart 1, i 20),
old log /mysql/logs/slow-queries.log.20 does not exist
renaming /mysql/logs/slow-queries.log.19 to /mysql/logs/slow-queries.log.20 (rotatecount 120, logstart 1, i 19),
old log /mysql/logs/slow-queries.log.19 does not exist
renaming /mysql/logs/slow-queries.log.18 to /mysql/logs/slow-queries.log.19 (rotatecount 120, logstart 1, i 18),
old log /mysql/logs/slow-queries.log.18 does not exist
renaming /mysql/logs/slow-queries.log.17 to /mysql/logs/slow-queries.log.18 (rotatecount 120, logstart 1, i 17),
old log /mysql/logs/slow-queries.log.17 does not exist
renaming /mysql/logs/slow-queries.log.16 to /mysql/logs/slow-queries.log.17 (rotatecount 120, logstart 1, i 16),
old log /mysql/logs/slow-queries.log.16 does not exist
renaming /mysql/logs/slow-queries.log.15 to /mysql/logs/slow-queries.log.16 (rotatecount 120, logstart 1, i 15),
old log /mysql/logs/slow-queries.log.15 does not exist
renaming /mysql/logs/slow-queries.log.14 to /mysql/logs/slow-queries.log.15 (rotatecount 120, logstart 1, i 14),
old log /mysql/logs/slow-queries.log.14 does not exist
renaming /mysql/logs/slow-queries.log.13 to /mysql/logs/slow-queries.log.14 (rotatecount 120, logstart 1, i 13),
old log /mysql/logs/slow-queries.log.13 does not exist
renaming /mysql/logs/slow-queries.log.12 to /mysql/logs/slow-queries.log.13 (rotatecount 120, logstart 1, i 12),
old log /mysql/logs/slow-queries.log.12 does not exist
renaming /mysql/logs/slow-queries.log.11 to /mysql/logs/slow-queries.log.12 (rotatecount 120, logstart 1, i 11),
old log /mysql/logs/slow-queries.log.11 does not exist
renaming /mysql/logs/slow-queries.log.10 to /mysql/logs/slow-queries.log.11 (rotatecount 120, logstart 1, i 10),
old log /mysql/logs/slow-queries.log.10 does not exist
renaming /mysql/logs/slow-queries.log.9 to /mysql/logs/slow-queries.log.10 (rotatecount 120, logstart 1, i 9),
old log /mysql/logs/slow-queries.log.9 does not exist
renaming /mysql/logs/slow-queries.log.8 to /mysql/logs/slow-queries.log.9 (rotatecount 120, logstart 1, i 8),
old log /mysql/logs/slow-queries.log.8 does not exist
renaming /mysql/logs/slow-queries.log.7 to /mysql/logs/slow-queries.log.8 (rotatecount 120, logstart 1, i 7),
old log /mysql/logs/slow-queries.log.7 does not exist
renaming /mysql/logs/slow-queries.log.6 to /mysql/logs/slow-queries.log.7 (rotatecount 120, logstart 1, i 6),
old log /mysql/logs/slow-queries.log.6 does not exist
renaming /mysql/logs/slow-queries.log.5 to /mysql/logs/slow-queries.log.6 (rotatecount 120, logstart 1, i 5),
old log /mysql/logs/slow-queries.log.5 does not exist
renaming /mysql/logs/slow-queries.log.4 to /mysql/logs/slow-queries.log.5 (rotatecount 120, logstart 1, i 4),
old log /mysql/logs/slow-queries.log.4 does not exist
renaming /mysql/logs/slow-queries.log.3 to /mysql/logs/slow-queries.log.4 (rotatecount 120, logstart 1, i 3),
old log /mysql/logs/slow-queries.log.3 does not exist
renaming /mysql/logs/slow-queries.log.2 to /mysql/logs/slow-queries.log.3 (rotatecount 120, logstart 1, i 2),
renaming /mysql/logs/slow-queries.log.1 to /mysql/logs/slow-queries.log.2 (rotatecount 120, logstart 1, i 1),
renaming /mysql/logs/slow-queries.log.0 to /mysql/logs/slow-queries.log.1 (rotatecount 120, logstart 1, i 0),
old log /mysql/logs/slow-queries.log.0 does not exist
log /mysql/logs/slow-queries.log.121 doesn't exist -- won't try to dispose of it
renaming /mysql/logs/error.log to /mysql/logs/error.log.1
creating new log mode = 0660 uid = 27 gid = 27
renaming /mysql/logs/general.log to /mysql/logs/general.log.1
creating new log mode = 0660 uid = 27 gid = 27
renaming /mysql/logs/slow-queries.log to /mysql/logs/slow-queries.log.1
creating new log mode = 0660 uid = 27 gid = 27
running postrotate script
[root@db01 /mysql/logs]# ll
total 1675440
-rw-rw---- 1 mysql mysql          0 Aug 11  2009 error.log
-rw-rw---- 1 mysql mysql        472 Aug 11  2009 error.log.1
-rw-rw---- 1 mysql mysql        472 Aug 11 15:03 error.log.2
-rw-rw---- 1 mysql mysql        472 Aug 11 14:57 error.log.3
-rw-rw---- 1 mysql mysql          0 Aug 11  2009 error.log-old
-rw-rw---- 1 mysql mysql        213 Aug 11  2009 general.log
-rw-rw---- 1 mysql mysql        827 Aug 11  2009 general.log.1
-rw-rw---- 1 mysql mysql       1082 Aug 11 15:03 general.log.2
-rw-rw---- 1 mysql mysql      37115 Aug 11 15:01 general.log.3
-rw-rw---- 1 mysql mysql 1693930999 Aug 11 11:06 general.log.4
-rw-rw---- 1 mysql mysql        177 Aug 11  2009 slow-queries.log
-rw-rw---- 1 mysql mysql        354 Aug 11  2009 slow-queries.log.1
-rw-rw---- 1 mysql mysql        354 Aug 11 15:03 slow-queries.log.2
-rw-rw---- 1 mysql mysql   18263218 Aug 11 14:57 slow-queries.log.3
[root@db01 /mysql/logs]#

外部链接:
Rotating General Query & Slow Logs
Be careful rotating MySQL logs
Rotating logs - MySQL Administrator's Bible By Sheeri K. Cabral, Keith Murphy

5.2.6. Server Log Maintenance
5.2.3. The General Query Log

Truncating MySQL Log Files
How to logrotate mysq slow log files?
[rhelv5-list] where is mysql-log-rotate in RH EL 4/5 ?

参考MySQL某发行版本的配置文件
# This logname can be set in /etc/my.cnf
# by setting the variable "err-log"
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
# err-log=/var/lib/mysql/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret>
# user= root
#
# where "<secret>" is the password.
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !

/var/lib/mysql/mysqld.log {
        # create 600 mysql mysql
        notifempty
        daily
        rotate 3
        missingok
        compress
    postrotate
        # just if mysqld is really running
        if test -x /usr/bin/mysqladmin && \
           /usr/bin/mysqladmin ping &>/dev/null
        then
           /usr/bin/mysqladmin flush-logs
        fi
    endscript
}


-fin-

Website Analytics

Followers