{"id":1821,"date":"2017-10-16T09:22:08","date_gmt":"2017-10-16T13:22:08","guid":{"rendered":"https:\/\/easy-admin.ca\/?p=1821"},"modified":"2017-10-25T18:32:36","modified_gmt":"2017-10-25T22:32:36","slug":"virtualmin-backup-failed-mysql-crashed","status":"publish","type":"post","link":"https:\/\/easy-admin.ca\/index.php\/2017\/10\/16\/virtualmin-backup-failed-mysql-crashed\/","title":{"rendered":"VirtualMIN Backup Failed &#8211; MySQL &#8220;MariaDB&#8221; crash"},"content":{"rendered":"<p><em><strong>Good day!<\/strong><\/em> I ran into a problem when backing up all my virtualMIN websites. When the backup failed something stange happened to MySQL &#8220;<strong>MariaDB<\/strong>&#8221; database server. When backup fail, <strong>MariaDB<\/strong> crash!<\/p>\n<p>To fix this issue I added a command to run after backup:<\/p>\n<p>systemctl<strong> stop <\/strong>mariadb ; systemctl<strong> start <\/strong>mariaDB<\/p>\n<p><strong>Located in &gt; <\/strong>VirtualMIN<strong> &gt; Scheduled Backups &gt;<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1825\" src=\"https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/10\/virtualMIN-backup-failed-png.png\" alt=\"\" width=\"933\" height=\"663\" srcset=\"https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/10\/virtualMIN-backup-failed-png.png 933w, https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/10\/virtualMIN-backup-failed-png-300x213.png 300w, https:\/\/easy-admin.ca\/wp-content\/uploads\/2017\/10\/virtualMIN-backup-failed-png-768x546.png 768w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/p>\n<p>This will prevent mariaDB to crash after a failed virtualMIN backup!<\/p>\n<p><strong>Notes:<\/strong> Check the size of your \/tmp and increase it!<\/p>\n<p><span style=\"color: #ff0000;\"><strong>If you are having &#8220;Out of resources <\/strong><\/span>Errcode :<span style=\"color: #ff0000;\"><strong> 24 message&#8221;<\/strong><\/span><\/p>\n<p><strong>The <\/strong>mysql<strong> error:<\/strong>\u00a0 Out of resources when opening file&#8230; (Errcode: 24)\u00a0\u00a0 indicates that the number of files that msyql is permitted to open has been exceeded.<\/p>\n<p>This limit is controlled by the variable <strong>open_files_limit<\/strong>. \u00a0 You can read this in phpMyAdmin (or the MySQL command line utility) with the statement:<\/p>\n<div class=\"geshifilter\">\n<pre class=\"mysql geshifilter-mysql\"><a href=\"http:\/\/search.mysql.com\/search?site=refman-%35%31&amp;q=SHOW\">SHOW<\/a> VARIABLES <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/%35.%31\/en\/non-typed-operators.html\">LIKE<\/a> 'open%'<\/pre>\n<\/div>\n<p>To set this variable to a higher number, edit the \/etc\/my.cnf file and add the lines:<\/p>\n<pre>[mysqld]\r\nopen_files_limit = 5000<\/pre>\n<p>Then be sure to restart mysql with:\u00a0\u00a0 sudo \/etc\/init.d\/mysql restart<\/p>\n<p>Remember to use the server administrative account and sudo when you edit the file.\u00a0 The choice of editor is up to you.<\/p>\n<p>Now, showing the variable should show the number you choose.<\/p>\n<p>Note that 5000 shown above is an example. A good rule of thumb is to take the current number of files and add 1000 to it. If this doesn&#8217;t help, add some more.\u00a0 This number affects the amount of memory that MySQL uses, so setting it to a very high number is not a good idea.<\/p>\n<p><strong>You may also verified your \/etc\/my.cfg configurations:<\/strong><\/p>\n<p>[mysqld]<br \/>\ndatadir = \/var\/lib\/mysql<br \/>\nsocket = \/var\/lib\/mysql\/mysql.sock<\/p>\n<p>local-infile=0<br \/>\nsymbolic-links=0<br \/>\ninnodb_file_per_table = 1<br \/>\nthread_concurrency = 8<br \/>\nquery_cache_size = 64M<br \/>\nthread_cache_size = 8<br \/>\nmyisam_sort_buffer_size = 256M<br \/>\nread_rnd_buffer_size = 32M<br \/>\nread_buffer_size = 4M<br \/>\nsort_buffer_size = 4M<br \/>\ntable_open_cache = 512<br \/>\nmax_allowed_packet = 7M<br \/>\nkey_buffer_size = 512M<br \/>\n<span style=\"color: #ff0000;\">open_files_limit = 10000<\/span><br \/>\nmax_connections = 32768<br \/>\ninnodb_buffer_pool_size = 40M<\/p>\n<p>[mysqld_safe]<br \/>\nlog-error=\/var\/log\/mariadb\/mariadb.log<br \/>\npid-file=\/var\/run\/mariadb\/mariadb.pid<\/p>\n<p>!includedir \/etc\/my.cnf.d<\/p>\n<p><strong>After modifications you must restart MySQL server<\/strong><\/p>\n<p># systemctl restart mariadb<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good day! I ran into a problem when backing up all my virtualMIN websites. When the backup failed something stange happened to MySQL &#8220;MariaDB&#8221; database server. When backup fail, MariaDB crash! To fix this issue I added a command to run after backup: systemctl stop mariadb ; systemctl start mariaDB Located in &gt; VirtualMIN &gt; &hellip; <a href=\"https:\/\/easy-admin.ca\/index.php\/2017\/10\/16\/virtualmin-backup-failed-mysql-crashed\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">VirtualMIN Backup Failed &#8211; MySQL &#8220;MariaDB&#8221; crash<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1821","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1821"}],"version-history":[{"count":0,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1821\/revisions"}],"wp:attachment":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}