MySQL 5.6因为伯父导致数据库重启

  

  线上的一套MySQL 5.6的从库,因为伯父而导致数据库重启。   

  <前>   #,tail  -50,/var/log/消息   Nov  13, 16:00:40  app-push-db2 内核:,Out  of 记忆:,Kill  process  26121, (mysqld), score  957年,趁机sacrifice 儿童   Nov  13, 16:00:40  app-push-db2 内核:,Killed  process  26121, (mysqld), total-vm: 18804176 kb,, anon-rss: 15541596 kb,, file-rss: 0 kb, shmem-rss: 0 kb   之前   

  
  

  

  报错原因:   

  

  这台实例所在的服务器上面部署了单实例MySQL,物理内存为16 g,分配给数据库的缓存innodb_fuffer_pool_size为12克。   

  <前>   #,free  - g   ,,,,,,,,,,,,,total ,,,,,,, used ,,,,,,, free ,,,,, shared ,浅黄色/cache ,可用   Mem:,,,,,,,,,,,,, 15,,,,,,,,,, 10个,,,,,,,,,,,0,,,,,,,,,,,0,,,,,,,,,,,5,,,,,,,,,,,4   交换:,,,,,,,,,,,,,0,,,,,,,,,,,0,,,,,,,,,,,0   之前   

  为了提高性能,这台实例关闭了磁盘的交换交换。   
  

  <前>   #,cat /etc/自动加载   # !/bin/bash   #,却;能够FILE  IS  ADDED  FOR  COMPATIBILITY 目的   #   #,It  is  highly  advisable 用create  own  systemd  services 或是udev 规则   #,用run  scripts  during  boot  instead  of  using 却;能够文件。   #   #,拷贝contrast 用previous  versions  due 用parallel  execution  during 引导   #,却;能够script  will  NOT  be  run  after  all  other 服务。   #   #,Please  note  that 你must  run  & # 39; chmod  + x /etc/d/自动加载# 39;用保证   #,that 却;能够script  will  be  executed  during 引导。   touch /var/锁定/中高/当地   swapoff  -   之前   

  当客户端连接多的时候,导致内存资源耗尽。   

  

  
  

  

  解决方法:   

  

  将通过innodb_buffer_pool_size调整为10 g中,预留出一些内存给操作系统和客户端连接。   

  

  重启数据库,使参数生效。   

  <前>   #,grep  innodb_buffer_pool 。/etc/my . cnf中所做   通过innodb_buffer_pool_size=10克   之前   

  
  

  

  
  

MySQL 5.6因为伯父导致数据库重启