Want to subscribe to topics you're interested in?
Become a Member

MariaDB Changing value of "innodb_log_file_size"

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Nov 27, 2021.

  1. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    6:20 AM
    Mainline
    10.2
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • MariaDB MySQL Version Installed: 10.3.xx
    Is this guide still applicable?
    https://dba.stackexchange.com/a/1265

    Or I can now change my.cnf config and restart MariaDB safely & directly?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    8:20 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Latest MariaDB 10 versions like 10.3 should be able to change that on the fly just by changing it in /etc/my.cnf InnoDB System Variables. You'll know if your version of MariaDB/MySQL doesn't support such when you change /etc/my.cnf and try to restart your server and it won't start MySQL/MariaDB server if it doesn't support it. And you'll see errors related to it in MariaDB log file via command

    Look at last 200 lines of logs for MariaDB 10.3
    Code (Text):
    journalctl -u mariadb --no-pager | tail -200| sed -e "s|$HOSTNAME|hostname|g"

    Example of working properly here I changed innodb_log_file_size from 768MB to 512MB in /etc/my.cnf and restarted MariaDB MySQL server and excerpt of relevant log entry
    Code (Text):
    journalctl -u mariadb --no-pager | tail -200 | sed -e "s|$HOSTNAME|hostname|g"
    
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: Resizing redo log from 2*805306368 to 2*536870912 bytes; LSN=13433032083
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: Starting to delete and rewrite log files.
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 536870912 bytes
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 536870912 bytes
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
    Nov 27 11:15:44 hostname mysqld[31751]: 2021-11-27 11:15:44 0 [Note] InnoDB: New log files created, LSN=13433032083