From a93db641c72acbc3f89a925ac54877947b05d001 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 2 Aug 2013 18:16:54 +0300 Subject: [PATCH] Mysql aio fix for OpenVZ --- install/rhel/mysql-512.cnf | 2 +- install/rhel/mysql.cnf | 1 + install/vst-install.sh | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/install/rhel/mysql-512.cnf b/install/rhel/mysql-512.cnf index dc5a94971..361d352c5 100644 --- a/install/rhel/mysql-512.cnf +++ b/install/rhel/mysql-512.cnf @@ -27,7 +27,7 @@ query_cache_size=8M query_cache_type=1 tmp_table_size=16M -innodb_use_native_aio = 0 +#innodb_use_native_aio = 0 innodb_file_per_table [mysqld_safe] diff --git a/install/rhel/mysql.cnf b/install/rhel/mysql.cnf index fc1f67cff..c7b6e652a 100644 --- a/install/rhel/mysql.cnf +++ b/install/rhel/mysql.cnf @@ -11,6 +11,7 @@ long_query_time=5 #log-queries-not-using-indexes #log-slow-queries=/var/log/mysql/log-slow-queries.log +#innodb_use_native_aio = 0 innodb_file_per_table [mysqld_safe] diff --git a/install/vst-install.sh b/install/vst-install.sh index 0c3aa3b78..539795f2e 100644 --- a/install/vst-install.sh +++ b/install/vst-install.sh @@ -21,7 +21,7 @@ software="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid phpMyAdmin awstats webalizer vsftpd mysql mysql-server exim dovecot clamd spamassassin curl roundcubemail bind bind-utils bind-libs mc screen ftp libpng libjpeg libmcrypt mhash zip unzip openssl flex rssh libxml2 - ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync sysstat + ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync rrdtool GeoIP freetype ntp openssh-clients vesta vesta-nginx vesta-php" @@ -521,6 +521,11 @@ if [ "$srv_type" = 'micro' ]; then else wget $CHOST/$VERSION/mysql.cnf -O /etc/my.cnf fi + +# Disable aio on OpenVZ +if [ -e "/proc/user_beancounters" ]; then + sed -i "s/#innodb_use_native_aio/innodb_use_native_aio/g" /etc/my.cnf +fi chkconfig mysqld on service mysqld start if [ "$?" -ne 0 ]; then @@ -742,6 +747,10 @@ vst_ip=$(wget vestacp.com/what-is-my-ip/ -O - 2>/dev/null) if [ ! -z "$vst_ip" ] && [ "$vst_ip" != "$main_ip" ]; then # Set NAT association $VESTA/bin/v-change-sys-ip-nat $main_ip $vst_ip + + # Assign passive ip address + echo "pasv_address=$vst_ip" >> /etc/vsftpd/vsftpd.conf + service vsftpd restart fi if [ -z "$vst_ip" ]; then vst_ip=$main_ip