Changeset 8234


Ignore:
Timestamp:
Nov 12, 2018, 2:47:33 PM (2 years ago)
Author:
mabarracus
Message:

auto-set mysql config

Location:
lliurex-analytics-server/trunk/fuentes/debian
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/debian/changelog

    r8233 r8234  
    66  * Add new release 19
    77  * Fix postrm
     8  * Set mysql configuration when installing server
    89
    910 -- M.Angel Juan <m.angel.juan@gmail.com>  Mon, 12 Nov 2018 13:35:53 +0100
  • lliurex-analytics-server/trunk/fuentes/debian/postinst

    r8233 r8234  
    288288    mysql $rootuser $rootpass < /usr/lib/analytics-server/analytics_add_bionic.sql || true
    289289
    290 
     290# MYSQL PARAMETERS
     291    if grep -r "max_heap_table_size" /etc/mysql/mysql.conf.d/ > /dev/null;then
     292        echo max_heap_table_size configured!! leaving untouched!!
     293    else
     294        TMEM=$(cat /proc/meminfo |grep -i memtotal|awk "{print int($2/1024)}")
     295        PMEM="256M"
     296        if [ "$TMEM" -gt "1000" ]; then
     297            PMEM="500M"
     298        fi
     299        if [ "$TMEM" -gt "2000" ]; then
     300            PMEM="1000M"
     301        fi
     302        echo max_heap_table_size not configured!! setting $PMEM
     303        printf "[mysqld]\nmax_heap_table_size=$PMEM\n" > /etc/mysql/mysql.conf.d/lliurex-analytics-server.cnf
     304    fi;
    291305# CONFIG APACHE
    292306
     
    309323            echo
    310324    fi
    311    
     325
    312326
    313327    ;;
Note: See TracChangeset for help on using the changeset viewer.