diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index de237fb09..0a41990e3 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -38,18 +38,24 @@ Install_mysql() touch /var/log/mariadb/mariadb.log fi + # ----- cpu start ------ if [ -z "${cpuCore}" ]; then cpuCore="1" fi + if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` + fi + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') - if [ "${MEM_INFO}" != "0" ];then - if [ "${cpuCore}" -lt "${MEM_INFO}" ];then + if [ "${cpuCore}" != "1" ] &&& [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then cpuCore="${MEM_INFO}" fi else cpuCore="1" fi + # ----- cpu end ------ cd $serverPath/mdserver-web/plugins/mysql/lib && /bin/bash rpcgen.sh