In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how openstack fixes the mysql problem, the content of the article is carefully selected and edited by the author, openstack is how to repair the mysql problem has a certain pertinence, for everyone's reference significance is still relatively great, the following with the author to understand the next topic content.
A colleague's openstack single-node CVM cannot work properly due to unknown reasons.
Remotely guide colleagues to check for faults.
[root@localhost ~] # nova-manage service list
An error occurred: SQL connection failed. There seems to be no connection to the database, it seems that there may be something wrong with the service or the database.
Guide colleagues to test openstack services and databases:
[root@sxun init.d] # / etc/init.d/openstack-keystone statuskeystone (pid 12593) is running... [root@sxun init.d] # / etc/init.d/openstack-nova-api statusopenstack-nova-api (pid 7446) is running... [root@sxun init.d] # / etc/init.d/openstack-nova-compute statusopenstack-nova-compute (pid 11728) is running... [root@sxun init.d] # / etc/init.d/openstack -nova-conductor statusopenstack-nova-conductor (pid 7704) is running... [root@sxun init.d] # / etc/init.d/mysqld status
Mysql is stoppd [root@sxun init.d] # / etc/init.d/mysqld startstarting mysqld: [FAILED]
The same is true of restart, which seems to be a problem with the mysqld service not being started. Why didn't you start it? find the log of mysqld to view:
Tail-100 / var/lib/mysql/sxun.err
The error log reports roughly the following errors:
170420 15:00:20 InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.
.
Because the picture is not complete, quote the following URL text http://blog.chinaunix.net/uid-27038861-id-3667209.html?bsh_bid=310758849, also in accordance with its method, without thinking about the operation to try
# the following references #
130508 16:30:53 mysqld_safe Starting mysqlddaemon with databases from / data/mysql130508 16:30:54 [Warning] The syntax'--log-slow-queries' is deprecated and will be removed in a future release.Please use'--slow-query-log'/'--slow-query-log-file' instead.130508 16:30:54 InnoDB: The InnoDB memoryheap is disabled130508 16:30:54 InnoDB: Mutexes andrw_locks use GCC atomic builtins130508 16:30:54 InnoDB: Compressed tablesuse zlib 1.2.3130508 16:30:54 InnoDB: Initializing bufferpool Size = 500.0M130508 16:30:54 InnoDB: Completedinitialization of buffer pool130508 16:30:54 InnoDB: highest supportedfile format is Barracuda.InnoDB: Log scan progressed past thecheckpoint lsn 27219795678130508 16:30:54 InnoDB: Database was not shut down normallyinnovative DB: Starting crash recovery.InnoDB: Reading tablespace information fromthe .ibd files...InnoDB: Restoring possible half-writtendata pages fromthe doublewriteInnoDB: buffer...InnoDB: Doing recovery: scanned up to logsequence number 27219928522
# reference, omitted in the middle #
Solution:
Delete
Ibdata*
Ib_logfile*
All the logs.
The database can be started after restart, because the database is not shut down normally. All will result in data loss. The backup work should be done well.
# above quote #
[root@sxun mysql] # lltotal 225356drwx-2 mysql mysql 4096 Feb 15 16:06 cinderdrwx- 2 mysql mysql 4096 Oct 1 2016 glance-rw-rw---- 1 mysql mysql 220200960 Apr 20 18:08 ibdata1-rw-rw---- 1 mysql mysql 5242880 Apr 20 18:08 ib_logfile0-rw-rw---- 1 mysql mysql 5242880 Apr 20 18:08 ib_logfile1drwx- 2 mysql mysql 4096 Oct 1 2016 keystonedrwx- -2 mysql mysql 4096 Oct 1 2016 mysqlsrwxrwxrwx 1 mysql mysql 0 Feb 16 14:52 mysql.sockdrwx- 2 mysql mysql 4096 Oct 1 2016 novadrwx- 2 mysql mysql 4096 Oct 1 2016 ovs_neutron-rw-r- 1 mysql root 38548 Feb 16 14:52 sxun.errdrwx- 2 mysql mysql 4096 Oct 1 2016 test
Do not dare to delete the production environment, first move to other places for backup.
[root@sxun init.d] # mv ibdata* / root/ [root@sxun init.d] # mv ib_logfile* / root/ [root@sxun init.d] # / etc/init.d/mysqld startstarting mysqld: [OK]
The database of the CVM has been started and a new ib* file has been generated. Test the keystone and nova services, but:
[root@sxun instances] # nova-manage service listCRITICAL nova [req-97fd8f67-8a06-4ab7-b421-01d36bc6ad02 None None] (ProgrammingError) (1146, "Table 'nova.services' doesn't exist")' SELECT services.created_at ASservices_created_at, services.updated_at ASservices_ updated_at,services.deleted_at ASservices_deleted _ at,services.deleted ASservices_deleted, services.id ASservices_ id, services.host ASservices_ host, services.`binary` ASservices_ binary, services.topic ASservices_ topic Services.report_count ASservices_ report_count, services.disabled ASservices_disabled, services.disabled_reason ASservices_disabled _ reason\ nFROMservices\ nWHERE services.deleted =% s'(0,) [root@sxun instances] # keystone user-listAuthorization Failed: An unexpected errorprevented the server from fulfilling your request. (ProgrammingError) (1146, "Table 'keystone.domain' doesn't exist")' SELECT domain.id ASdomain_id, domain.name ASdomain_ name, domain.enabled ASdomain_ enabled,domain.extra ASdomain_ extra\ nFROM domain\ nWHERE domain.id =% s'('default',) (HTTP 500)
Mysqld is up, but because the ib* file has been replaced, the data is different. Various services such as nova have gone wrong. Try reboot to restart the CVM, but it still doesn't work. Ib* has to be restored, but mysqld cannot be started again.
Direct plagiarism is not enough, the key is to find a way:
InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.
The problem is this error, the database shuts down abnormally, and then there is a recovery operation after the database is restarted, and it will hang up if it can't be restored.
Subsequent solutions:
1. Restore the ib* file
2. Add a shutdown # innodb_force_recover = 6 that does not force data recovery in the configuration file.
3. Start the database, and mysqldump will export the database.
4. Delete the database file, and re-import the mysql database after mysql startup.
The knife used by my colleague, the specific operation is as follows:
[root@sxun01 mysql (keystone_admin)] # mysqldump-uroot-all-database > > my_mysql.dump-- Warning: Skipping the data of tablemysql.event. Specify the-- events option explicitly. [root@sxun01 mysql (keystone_admin)] # / etc/init.d/mysqld stopStopping mysqld: [OK] [root@sxun01 mysql (keystone_admin)] # rm-rfibdata1 ib_logfile0 ib_ logfile1 [root @ sxun01 mysql (keystone_admin)] # vi/etc/ my.cnf [client] port = 3306socket = / var/lib/mysql/ mysql.sock [mysqld _ safe] socket = / var/ Lib/mysql/ mysql.socks [client] port = 3306socket = / var/lib/mysql/ mysql.socks [mysqld _ safe] socket = / var/lib/mysql/mysql.socknice = 0 [mysqld] user = mysqlpid-file = / var/run/mysqld/mysqld.pidsocket = / var/lib/mysql/mysql.sockport = 3306basedir = / usrdatadir = / var/lib/mysqltmpdir = / tmpskip-external-locking # socks = 6bind-address = 0.0.0.0 Key_buffer = 16Mmax_allowed_packet = 16Mthread_stack = 192Kthread_cache_size = 8myisam-recover = BACKUPquery_cache_limit = 1Mquery_cache_size = 16Mlog_error = / var/log/mysqld.logexpire_logs_days = 10max_binlog_size = 100m default-storage-engine = InnoDB [mysqldump] quickquote-names "/ etc/my.cnf" 43L 811C written [root@sxun01 mysql (keystone_admin)] # mkdirdatabase_ bak [root @ sxun01 mysql (keystone_admin)] # mvcinder/ glance/ keystone/ nova/ ovs_neutron/ database_bak/ [root @ sxun01 mysql (keystone_admin)] # lldatabase_bak/total 20drwx-2 mysql mysql 4096 Oct 25 15 Oct 08cinderdrwx-2 mysql mysql 4096 Oct 25 15lance 08glancedrwx-2 mysql mysql 4096 Oct 25 15mkdirdatabase_ 08keystonedrwx-2 mysql mysql 4096 Oct 25 15 lltotal 29648drwxr-xr-x 08novadrwx-2 mysql mysql 4096 Oct 25 15purr 08ovsrwon [root @ sxun01 mysql (keystone_admin)] # lltotal 29648drwxr-xr-x 2 root root 4096 Apr 20 15:15 aaadrwxr-xr-x 2 root root 4096 Apr 20 15:33 bbbdrwxr-xr-x 7 root root 4096 Apr 20 15:47 database_bak-rw-r--r-- 1 root root 29610746 Apr 20 15:45 my_mysql.dumpdrwx- 2 mysql mysql 4096 Oct 25 15:05 mysql-rw-r- 1 mysql root 82317 Apr 20 15:46 sxun01.err-rw-r- 1 mysql root 637765 Apr 20 15:35 sxun01.err--drwx- 2 mysql mysql 4096 Oct 25 15:05 test [root@sxun01 mysql (keystone_admin)] # [root@sxun01 mysql (keystone_admin)] # [root@sxun01 mysql (keystone_admin)] # / etc/init.d/mysqld restartStopping mysqld: [OK] Starting mysqld: [OK] [root@sxun01 mysql (keystone_admin)] # mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 22Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or itsaffiliates. Other names may be trademarksof their respectiveowners. Type 'help;' or'\ h' for help. Type'\ c 'toclear the current input statement. Mysql > quitBye [root@sxun01 mysql (keystone_admin)] # mysql-uroot
< my_mysql.dump[root@sxun01 mysql(keystone_admin)]#[root@sxun01 mysql(keystone_admin)]#[root@sxun01 mysql(keystone_admin)]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 93Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or itsaffiliates. Other names may be trademarksof their respectiveowners. Type 'help;' or '\h' for help. Type '\c' toclear the current input statement. mysql>Use nova; Reading table information for completion oftable and column namesYou can turn off this feature to get aquicker startup with-A Database changed mysql > select * from instances Mysql > quitBye [root@sxun01 mysql (keystone_admin)] # nova-manage service listBinary Host Zone Status State Updated_Atnova-consoleauth sxun01 internal enabled XXX 2017-04-20 05:31:48nova-scheduler sxun01 internal enabled XXX 2017- 04-20 05:31:54nova-conductor sxun01 internal enabled: -) 2017-04-20 07:49:07nova-cert sxun01 internal enabled XXX 2017-04-20 05:31:55nova-compute sxun01 nova enabled XXX 2017- 04-20 05:31:53 [root@sxun01 mysql (keystone_admin)] # reboot [root@sxun01 mysql (keystone_admin)] # Broadcast message from root@sxun01 (/ dev/pts/0) at 15:49. The system is going down for reboot NovostLast login: Thu Apr 20 15:28:26 2017 [root@sxun01 ~] # nova-manage service listBinary Host Zone Status State Updated_Atnova-consoleauth sxun01 internal enabled: -) 2017-04-20 07:53:28nova-scheduler sxun01 Internal enabled: -) 2017-04-20 07:53:28nova-conductor sxun01 internal enabled: -) 2017-04-20 07:53:28nova-cert sxun01 internal enabled: -) 2017-04-20 07:53:28nova-compute sxun01 Nova enabled: -) 2017-04-20 07:53:24
After reading the above about how openstack fixes mysql problems, many readers must have some understanding. If you need more industry knowledge and information, you can continue to follow our industry information column.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.