121206 11:14:09 InnoDB: If you tried to add new data files, and it failed here,
121206 11:14:09 InnoDB: you should now edit innodb_data_file_path in my.cnf back
121206 11:14:09 InnoDB: to what it was, and remove the new ibdata files InnoDB created
121206 11:14:09 InnoDB: in this failed attempt. InnoDB only wrote those files full of
121206 11:14:09 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
121206 11:14:09 InnoDB: remove old data files which contain your precious data!
121206 11:14:09 [ERROR] Plugin 'InnoDB' init function returned error.
121206 11:14:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121206 11:14:09 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
121206 11:14:09 [ERROR] Do you already have another mysqld server running on port: 3306 ?
121206 11:14:09 [ERROR] Aborting
121206 11:14:09 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
121206 11:14:09 mysqld_safe mysqld from pid file /usr/local/mysql/data/slave01.pid ended
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same
InnoDB data or log files.
[root@slave01 data]#
出现这类错误的原因,看iNNOB提醒,已经指出其他的线程启动已经在运行无法再次创建相关的读文件进程的权限,也就是说,现有的ibddata文件已经有人读取了,无法再次启动!我们通过以下命令来查找是否如提醒中所言;
如以下红色的所示:
[root@slave01 tmp]# service mysqld restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL....................................................................................................The server quit without updating PID file (/usr/local/mysql/data/slave01.pid). [FAILED]
[root@slave01 tmp]# ps aux |grep mysq*
root 2948 0.0 0.2 4632 1240 ? S 11:11 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/slave01.pid
mysql 3223 0.0 6.4 330116 33060 ? Sl 11:11 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/slave01.err --pid-file=/usr/local/mysql/data/slave01.pid --socket=/tmp/mysql.sock --port=3306
root 5373 0.0 0.1 4008 672 pts/1 R+ 11:20 0:00 grep mysq*
[root@slave01 tmp]# kill 2948
[root@slave01 tmp]# kill 3223
我们kill掉相关进程,再次多次启动完全OK,没有再次报错。
[root@slave01 tmp]# kill 2948
[root@slave01 tmp]# kill 3223
[root@slave01 tmp]# service mysqld restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.. [ OK ]
[root@slave01 tmp]# service mysqld restart
Shutting down MySQL. [ OK ]
Starting MySQL.. [ OK ]
[root@slave01 tmp]#
我们再次看错误日志的启动情况,可以我们这次启动已经分配到相关的主进程,好io进程,我们的主从复制情况也可以在日志中得以看到。哈哈
121206 11:25:20 mysqld_safe mysqld from pid file /usr/local/mysql/data/slave01.pid ended
121206 11:25:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
121206 11:25:21 InnoDB: The InnoDB memory heap is disabled
121206 11:25:21 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
121206 11:25:21 InnoDB: Compressed tables use zlib 1.2.3
121206 11:25:21 InnoDB: Initializing buffer pool, size = 16.0M
121206 11:25:21 InnoDB: Completed initialization of buffer pool
121206 11:25:21 InnoDB: highest supported file format is Barracuda.
121206 11:25:21 InnoDB: Waiting for the background threads to start
121206 11:25:22 InnoDB: 1.1.7 started; log sequence number 1595675
121206 11:25:22 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=slave01-relay-bin' to avoid this problem.
121206 11:25:22 [Note] Event Scheduler: Loaded 0 events
121206 11:25:22 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.13-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
121206 11:25:22 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000021' at position 107, relay log './slave01-relay-bin.000023' position: 253
121206 11:25:22 [Note] Slave I/O thread: connected to master 'backup@192.168.0.40:3306',replication started in log 'mysql-bin.000021' at position 107
[root@slave01 data]
总结:遇到相关错误要多看相关的错误日志提醒的说明,多理解其意图思路。