解决xtrabackup 报错innodb too many file问题

软件版本:
centos 7.5-64
mysql 5.7
xtrabackup 2.4

按照相关文档和资料在centos7上安装了xtrabackup,然后依照命令进行备份报错:

[[email protected] ~]#innobackupex --default-file=/etc/my.cnf --user=root --password=111111 --host=localhost /Data/bak_db/

……
……
InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means ‘Too many open files‘.

操作系统,防止系统压力过大或者资源不足,对用户可以打开的文件数或进程数等做了相应的限制。
既然上面的命令报错,就想到了可能是系统限制导致的错误。

解决办法:

在redhat相关的Linux系统中,在?/etc/security/limits.conf ??配置(限制)每个用户的资源。

格式:
#<domain> <type> <item> <value>
# soft core 0
#
hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4

打开limits.conf文件,在最后添加一下内容:

  • soft nproc 2047
  • hard nproc 16384
  • soft nofile 65536
  • hard nofile 65536

添加后不是立即生效,需要重启

如果不方便重启,可以使用命令设置,下次重启后即失效:
?[[email protected] ~]# ulimit -n 65535

我是因为在自己虚拟机,直接重启系统后即可。
再次运行备份命令
[[email protected] ~]#innobackupex --default-file=/etc/my.cnf --user=root --password=111111 --host=localhost /Data/bak_db/
……
……
181207 14:14:53 [00] Copying ib_buffer_pool to /Data/bak_db/2018-12-07_14-13-51/ib_buffer_pool
181207 14:14:53 [00] ...done
181207 14:14:53 Backup created in directory ‘/Data/bak_db/2018-12-07_14-13-51/‘
MySQL binlog position: filename ‘mysql_3306.000009‘, position ‘154‘
181207 14:14:53 [00] Writing /Data/bak_db/2018-12-07_14-13-51/backup-my.cnf
181207 14:14:53 [00] ...done
181207 14:14:53 [00] Writing /Data/bak_db/2018-12-07_14-13-51/xtrabackup_info
181207 14:14:53 [00] ...done
xtrabackup: Transaction log of lsn (1063990393) to (1063990402) was copied.
181207 14:14:53 completed OK!

到相应目录查看也有了备份文件。

原文地址:https://blog.51cto.com/jxplpp/2480223

时间: 2024-08-01 10:33:15

解决xtrabackup 报错innodb too many file问题的相关文章

opencv mac macOS Sierra 报错 &#39;QTKit/QTKit.h&#39; file not found 解决记录

在安装opencv时如果升级了macOS Sierra可能会遇到如下错误: XXX/cap_qtkit.mm:46:9: fatal error: 'QTKit/QTKit.h' file not found #import ^ 1 error generated. make[2]: *** [modulesideoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1 make[1]: *** [modulesideoio/CM

Svn启动窗口报错 Could not load file or assembly &#39;SharpSvn.dll&#39; or one of its

win10 64位系统生成没问题,测试都没问题,结果换到win7 64位系统上,点开就出现,网上搜了下,通过以下方式解决, 必须把bin 文件夹全部删除,重新生成.要不还是会报错. Solve it. Change my platform to x86 Output path to "bin\" Downloaded the x86 of SharpSVN (1.7008.2243.14245) Add SharpSVN.dll in GAC. Delete the bin folde

系统调优:如何解决系统报错too many open files瓶颈

一.检查系统版本是否手工升级 [[email protected] ~]# uname -r   linux的内核版本号 2.6.32-358.el6.x86_64 [[email protected] ~]# cat /proc/version Linux version 2.6.32-358.el6.x86_64  [[email protected] ~]# cat /etc/issue  系统安装时默认的发行版本 CentOS release 6.4 (Final) [[email pr

iis配置问题报错 -- Could not load file or assembly &#39;Oracle.DataAccess&#39; or one of its dependencies

具体提示: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. 试图加载格式不正确的程序. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about

Asp.Net程序报错 - error CS2001: Source file &#39;C:\Windows\TEMP\eulevokb.0.cs&#39; could not be found warning CS2008

一个Asp.Net项目,Excel导入功能出现如下错误:error CS2001: Source file 'C:\Windows\TEMP\eulevokb.0.cs' could not be foundwarning CS2008: No source files specified 本地执行是没有问题的,访问正式服务器就会出现这样的错误,搜索一下,原来是权限的问题. 解决办法:打开C盘,找到C:\Windows\TEMP目录,给temp添加IIS_IUSER的权限就没有问题了! Asp.

phonegap archive 报错 Cordova/CDVViewController.h&#39; file not found

在BuildSettings->Header Search Paths  增加如下路径,问题解决 $(OBJROOT)/UninstalledProducts/include phonegap archive 报错 Cordova/CDVViewController.h' file not found

git:Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).

Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists). 解决办法一:保留本地的更改,中止合并->重新合并->重新拉取 $:git merge --abort $:git reset --merge $:git pull 解决办法二:舍弃本地代码,远端版本覆盖本地版本(慎重) $:git fetch --all $:git reset --hard origin/ma

解决tomcat报错javax.imageio.IIOException: Can&#39;t create output stream!

启动tomcat catalina.out报错如下,登陆的时候无法显示验证码 2017-06-09 11:23:06,628 DEBUG org.springframework.web.servlet.DispatcherServlet 845 - DispatcherServlet with name 'spring-mvc' processing GET request for [/data-analysis/kaptchaImage.do]2017-06-09 11:23:06,629 D

解决mysql报错:- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column &#39;information_schema.PROFILING.SEQ&#39;

mysql执行报错: - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_fu