Two slave servers in mysql are not properly shut down, and the instance cannot be started.
Two slave servers in mysql are not properly shut down, and the instance cannot be started.
For master-slave configuration and startup online, I can see the cases and explanations in this article. here I have encountered a few difficult problems, that is, two slave servers cannot be started normally and the instances cannot be started, the reason is that some people did not close the mysql service when they shut down the server at night. when the server was shut down, it could not be started the next day! The problem has been transferred to me. check the error log carefully and you can see it. The following is the error message;
[Root @ CloneSlave01 data] # tail-100 CloneSlave01.err
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.
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.
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.
121211 10:03:27 InnoDB: Unable to open the first data file
InnoDB: Error in opening./ibdata1
121211 10:03:27 InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'resource temporarily unavailable '.
InnoDB: Some operating system error numbers are described
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
121211 10:03:27 InnoDB: cocould not open or create data files.
121211 10:03:27 InnoDB: If you tried to add new data files, and it failed here,
121211 10:03:27 InnoDB: you shocould now edit innodb_data_file_path in my. cnf back
121211 10:03:27 InnoDB: to what it was, and remove the new ibdata files InnoDB created
121211 10:03:27 InnoDB: in this failed attempt. InnoDB only wrote those files full
121211 10:03:27 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
121211 10:03:27 InnoDB: remove old data files which contain your precious data!
121211 10:03:27 [ERROR] Plugin 'innodb' init function returned error.
121211 10:03:27 [ERROR] Plugin 'innodb' registry as a storage engine failed.
121211 10:03:27 [ERROR] Unknown/unsupported storage engine: innodb
121211 10:03:27 [ERROR] Aborting
121211 10:03:27 [Note]/usr/local/mysql/bin/mysqld: Shutdown complete
121211 10:03:27 mysqld_safe mysqld from pid file/usr/local/mysql/data/CloneSlave01.pid ended
For the above problems, you need to remove the ibdata, ib_logfile0, and ib_logfile1 files to start them normally.
121211 10:17:37 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file./ibdata1 did not exist:
InnoDB: a new database to be created!
121211 10:17:37 InnoDB: Setting file./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
121211 10:17:37 InnoDB: Log file./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
121211 10:17:38 InnoDB: Log file./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment (s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
121211 10:17:38 InnoDB: Waiting for the background threads to start
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.
121211 10:17:39 InnoDB: 1.1.7 started; log sequence number 0
121211 10:17:39 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
121211 10:17:39 [ERROR] Do you already have another mysqld server running on port: 3306?
121211 10:17:39 [ERROR] Aborting
121211 10:17:39 InnoDB: Starting shutdown...
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
During the restart, it can be seen that a port occupies 3306 and thus cannot be started. as this is irrelevant to the test, no port change is made. check the following;
[Root @ CloneSlave01 data] # netstat-tpln | grep 3306
Tcp 0 0: 3306: * LISTEN 3237/mysqld
[Root @ CloneSlave01 data] # kill 3237
[Root @ CloneSlave01 data] # netstat-tpln | grep 3306
[Root @ CloneSlave01 data] # service mysqld restart
MySQL server PID file cocould not be found! [FAILED]
Starting MySQL... [OK]
[Root @ CloneSlave01 data] # service mysqld restart
Shutting down MySQL. [OK]
Starting MySQL... [OK]
[Root @ CloneSlave01 data] #
We recommend that you use port 3306 to restart the instance. The operation methods and steps of the other instance are similar to those described above, so I will not post them again, of course, after the startup, you need to test related data integrity and other issues!
Conclusion: when we shut down the server, we must know which services the server has. we need to close the server in advance to ensure the security and reliability of our data.
BitsCN.com