Join the community today
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 Premium Member Premium Member

    5,294
    1,315
    113
    May 25, 2014
    Ratings:
    +2,036
    Local Time:
    3:25 PM
    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

    48,900
    11,189
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,423
    Local Time:
    5:25 PM
    Nginx 1.21.x
    MariaDB 10.x
    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