- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的基于 MySQL Community
版本的数据库存在严重问题,该数据库崩溃并且在调整数据库分区大小后无法启动备份。该数据库位于 RHEL7.2 Linux lvm
分区上,由于一些存储问题,该分区必须减少。
在调整大小期间,出现了 inode 问题,导致数据库文件和文件夹被移动到丢失+找到的位置,我们恢复了文件并将它们移动到正确的位置。重新启动 mysql 服务会导致以下错误:
2017-06-12T09:38:12.510405Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-12T09:38:12.510568Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2017-06-12T09:38:12.510628Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.13) starting as process 40601 ...
2017-06-12T09:38:12.515354Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-06-12T09:38:12.515396Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-12T09:38:12.515404Z 0 [Note] InnoDB: Uses event mutexes
2017-06-12T09:38:12.515413Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-06-12T09:38:12.515421Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-06-12T09:38:12.515428Z 0 [Note] InnoDB: Using Linux native AIO
2017-06-12T09:38:12.515779Z 0 [Note] InnoDB: Number of pools: 1
2017-06-12T09:38:12.515943Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-06-12T09:38:12.518004Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-06-12T09:38:12.527531Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-06-12T09:38:12.529516Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-06-12T09:38:12.541493Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-06-12T09:38:12.542896Z 0 [Note] InnoDB: The log sequence number 8204 in the system tablespace does not match the log sequence number 435564720566 in the ib_logfiles!
2017-06-12T09:38:12.542919Z 0 [Note] InnoDB: Database was not shutdown normally!
2017-06-12T09:38:12.542926Z 0 [Note] InnoDB: Starting crash recovery.
2017-06-12 10:38:12 0x7f4e11608740 InnoDB: Assertion failure in thread 139973275715392 in file fut0lst.ic line 85
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
09:38:12 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68189 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xef0cfb]
/usr/sbin/mysqld(handle_fatal_signal+0x461)[0x7af361]
/lib64/libpthread.so.0(+0xf100)[0x7f4e111ef100]
/lib64/libc.so.6(gsignal+0x37)[0x7f4e0fbe25f7]
/lib64/libc.so.6(abort+0x148)[0x7f4e0fbe3ce8]
/usr/sbin/mysqld[0x77f71c]
/usr/sbin/mysqld(_Z22trx_undo_free_preparedP5trx_t+0x0)[0x77f4d4]
/usr/sbin/mysqld(_Z19trx_undo_lists_initP10trx_rseg_t+0xdcc)[0x10bcacc]
/usr/sbin/mysqld[0x10a11ec]
/usr/sbin/mysqld[0x10a39bc]
/usr/sbin/mysqld(_Z24trx_sys_init_at_db_startv+0x1883)[0x10aaa43]
/usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x4830)[0x10721a0]
/usr/sbin/mysqld[0xf39451]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7fa2b1]
/usr/sbin/mysqld[0xce3925]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x610)[0xcea830]
/usr/sbin/mysqld[0x7a82bd]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x842)[0x7a97e2]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f4e0fbceb15]
/usr/sbin/mysqld[0x79f5e5]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
还有:
2017-06-12T09:38:12.542919Z 0 [Note] InnoDB: Database was not shutdown normally!
2017-06-12T09:38:12.542926Z 0 [Note] InnoDB: Starting crash recovery.
2017-06-12 10:38:12 0x7f4e11608740 InnoDB: Assertion failure in thread 139973275715392 in file fut0lst.ic line 85
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
我尝试了多种innodb_force_recovery模式,直到我使用innodb_force_recovery = 6,mysqld才启动。当mysqld启动时,由于多个错误,我无法备份数据库,如下所示:
2017-06-12T11:10:52.217568Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`plugin` in the cache. Attempting to load the tablespace with space id 2
2017-06-12T11:10:52.277914Z 0 [ERROR] Function 'validate_password' already exists
2017-06-12T11:10:52.277954Z 0 [Warning] Couldn't load plugin named 'validate_password' with soname 'validate_password.so'.
2017-06-12T11:10:52.284445Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`gtid_executed` in the cache. Attempting to load the tablespace with space id 18
2017-06-12T11:10:52.293339Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2017-06-12T11:10:52.310829Z 0 [Warning] CA certificate ca.pem is self signed.
2017-06-12T11:10:52.313911Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-06-12T11:10:52.314120Z 0 [Note] IPv6 is available.
2017-06-12T11:10:52.314139Z 0 [Note] - '::' resolves to '::';
2017-06-12T11:10:52.314179Z 0 [Note] Server socket created on IP: '::'.
2017-06-12T11:10:52.433825Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`server_cost` in the cache. Attempting to load the tablespace with space id 19
2017-06-12T11:10:52.449122Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`engine_cost` in the cache. Attempting to load the tablespace with space id 20
2017-06-12T11:10:52.476635Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`time_zone_leap_second` in the cache. Attempting to load the tablespace with space id 12
2017-06-12T11:10:52.477431Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`time_zone_name` in the cache. Attempting to load the tablespace with space id 8
2017-06-12T11:10:52.490830Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`time_zone` in the cache. Attempting to load the tablespace with space id 9
2017-06-12T11:10:52.507804Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`time_zone_transition_type` in the cache. Attempting to load the tablespace with space id 11
2017-06-12T11:10:52.508725Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`time_zone_transition` in the cache. Attempting to load the tablespace with space id 10
2017-06-12T11:10:52.513876Z 0 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`servers` in the cache. Attempting to load the tablespace with space id 3
2017-06-12T11:10:52.563565Z 0 [Note] Event Scheduler: Loaded 0 events
2017-06-12T11:10:52.563876Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.13' socket: '/dataspace/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
当我尝试转储数据库文件时,我看到了这个:
mysqldump -uroot -pXXXXX --skip-lock-tables --skip-extended-insert --hex-blob office > office_dump.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error 2013: Lost connection to `MySQL` server during query when dumping table `audit_log` at row: 334202
请问我该怎么做才能恢复数据并使数据库重新联机?
如有任何帮助,我们将不胜感激。
最佳答案
我做了什么让 MySQL 再次运行:
skip-grant-tables
允许我以 root 身份登录 mysql,无需密码。innodb_force_recovery
/etc/my.cnf 中的模式,直到允许 mysqld 启动。 (就我而言,它是 innodb_force_recovery = 5
)。尝试转储所有数据库但失败:
mysqldump -uroot -pXXXXX --skip-lock-tables --skip-extended-insert --hex-blob databasename > databasename_dump.sql
审核日志
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping tableat row: 334202
我得到了一些 Percona 支持,他们建议我循环遍历 $MYSQL_HOME 中每个数据库目录中的 *.frm 文件,并为每个文件创建单独的 mysqldump 命令。 (在此之前不知道 frm 文件代表数据库内的各个数据库表)。他们还建议我 sleep
在每个命令之后避免 Lost connection
问题。我写了一个这样的脚本: for table in $(ls -1 *.frm); do table_name=$(echo $table | cut -d '.' -f 1); echo mysqldump --host=127.0.0.1 --user=root --skip-lock-tables databasename ${table_name} \> database.${table_name}.sql; echo sleep 5 >> commands.txt; done
它生成了我可以用来转储每个数据库表的所有 mysqldump 命令。
我循环访问了创建的commands.txt 文件以转储所有仍然可以工作的表。( sh -x commands.txt
)
我启动了一个新的 mysql 实例,创建了丢失的数据库,并将转储的所有 .mysql 文件导入到新数据库中。 for each in $(ls -1 $MYSQL_HOME/recoveries/*); do mysql -uroot -pXXXX databasename < $each; sleep 5; done
确保数据库正在运行并修复了与缺失表相关的其他问题(mysqlfrm --diagnostic
在类似服务器上有所帮助)
一切完成后,服务器重新上线,尽管几个月的关键数据丢失了。
关于MySQL 5.7 社区版调整磁盘分区大小后崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44498129/
如何使用 Facebook API 查找 Facebook 网址是社区网址或个人资料网址 例如 http://www.facebook.com/adelphi.panthers http://www.
我正在寻找 Erlang 问答平台/社区进行讨论和澄清。我现在使用 StackOverflow 和 erlangforums.com。两个社区都很棒。有没有其他的问答平台? 我检查了以下维护 Erla
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 4 年前。 Improve this qu
我可以使用下面的代码来生成和绘制社区: wc <- walktrap.community(subgraph) modularity(wc) membership(wc) layout <-la
我对 Chef 有点陌生,并且已经完成了教程,但我开始认为我不是错的人: 我正在尝试在 CentOS 7.2 上安装 Java。它无法安装(显然) - 但将 tarball 提取到正确的位置,但添加了
我做了很多 XSLT 编程。我也做 Java、PL/SQL、JavaScript 和其他一些。我可以通过网络轻松找到 Java 和 JavaScript 程序员社区。 PL/SQL 稍微难一点,但介于
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this qu
我想了解带有实际信息的 python 资源 - 新闻、文章、论坛(英语/美国 - 讲)。我现在学习了python(我已经有很好的c/c++知识),我需要的不仅仅是官方文档/教程。我想了解Python编
我需要了解 Postgresql。我正在尝试分支一个依赖于 Oracle 的应用程序框架来使用 Postgresql。我可以通过网络轻松找到 Java 和 JavaScript 程序员社区。 Orac
我正在使用 AgGrid 社区版本和 React。我试图在标题中的每一列上显示一个复选框。选择时应突出显示所选列下的单元格。此外,我需要记录所选列的更改。 我的columnDefs是基于后端数据构建的
有点好奇实际上有多少人使用 C++/CLI?那么有多少人在使用它呢?人们是否只在托管环境下寻找程序员的特定工作?围绕 c++/cli 的社区有多大?从我目前看到的情况来看,有不少语法变化,作为 C++
我在 Odoov9 社区模块上有一个选择字段 但是,每次我点击它,选择一个记录时,它都会抛出这个错误: Error: No conversion for undefined http://localh
我在cashflow_report模型上有这个方法: class cashflow_report(models.Model): _name = 'cashflow.report' _d
我正在尝试通过模块将一个表中的字段添加到另一个表中。 具体来说,尝试从 product.product 继承一个字段,即 price 字段,将其添加到 stock.move 模型中。 所以,我在我正在
我继承了 res.partner 模型,现在,我想将 vat 字段设置为 required 和 unique . 我知道如何正常执行此操作,例如在新模型上,但我希望原始字段具有这些属性。 我怎样才能实
我需要做什么才能让 Idea 在未打开的文件中发现错误? 两个示例场景可以更好地了解我的想法: 使用现有源添加新模块。模块已加载,后台扫描任务已完成,所有文件看起来都很好。直到打开。 Idea 会将文
我注意到 Stack Overflow 上有一些类似的问题,但它们要么不是我想要做的,要么是过时的答案。 我是 Google Plus 社区的所有者,我希望将该社区嵌入我们的网站,类似于将 Twitt
所以我将我的 Steamworks SDK 导入到我的虚幻引擎项目中。它构建并运行时,我得到了 Steam 覆盖。太棒了! 但是,我现在正在尝试获取用户的好友列表,这需要 Steam Communit
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 1 年前。 Improve
我正在 Pycharm Community Edition 2017.2.3 中开发 Python 3.6 项目。 我的项目中有多个运行配置。每个不同的运行配置将打开不同的 'Run tool win
我是一名优秀的程序员,十分优秀!