VPS에 리소스 할당

VPS에 리소스 할당

이러한 매개변수에 대한 일반인의 용어 정의와 서버에 리소스를 할당할 때 수행하는 작업이 필요합니다. 왜냐하면 Java가 각각 더 많은 것이 없으면 VM을 설정할 수 없는 것 같아서 설정 중인 VPS에 문제가 있기 때문입니다. 2Gb보다, 내가 뭔가 잘못한 것 같아요. 이것은 처음에 서버를 생성하고 리소스를 할당하는 데 사용하는 현재 스크립트입니다.

SERVID=$1
IPPICK=$2
HOSTNAME=$3
PW=$4
EMAIL=$5

if vzctl create $SERVID --ostemplate centos-6-x86_64.2 --config vps.packtwo-basic ;
    then
        echo -e "\nVPS container was successfully created...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "Please restart the package install, there was a problem creating the VPS..."
        exit $?
fi
if vzctl set $SERVID --onboot yes --save;
    then
        echo -e "\nSet to boot on start...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, the onboot config went wrong...\n"
        exit $?
fi

if vzctl set $SERVID --ipadd $IPPICK --save;
    then
        echo -e "\nIP added to the VPS successfully...\n"
    else
        echo -e "\nThe IP address used, may be used on another server, this may mean that the server has an issue contacting external addresses..\n"
fi

if vzctl set $SERVID --hostname $HOSTNAME --save;
    then
        echo -e "\nHostname assigned to the VPS successfully...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem assigning the Hostname to the VPS...\n"
        exit $?
fi
if vzctl set $SERVID --swappages=2224M:2224M --save;
        then
                echo -e "\nThe Swap Pages were successfully allocated...\n"
        else
                vzctl stop $SERVID
                vzctl destroy $SERVID
                echo -e "\nPlease restart the package install, there was a problem allocating Swappages to this VPS...\n"
                exit $?
fi
if vzctl set $SERVID --userpasswd root:$PW --save;
    then
        echo -e "\nThe root password was successfully assigned...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem assigning the chosen password for the root account...\n"
        exit $?
fi

#Resource double checking
if vzctl set $SERVID --diskspace 30G:32G --save;
    then
        echo -e "\nThe resources were successfully allocated...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"
        exit $?
fi

if vzctl set $SERVID --quotatime 800 --save;
    then
        echo -e "\nThe burst settings were successfully added...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating quta burst time to this VPS...\n"
        exit $?
fi


#Add RAM
if vzctl set $SERVID --vmguarpages 1124M --save;
    then
        echo -e "\nThe Vmguarpages have been successfully allocated...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating Vmguarpages to this VPS...\n"
        exit $?
fi
if vzctl set $SERVID --physpages 1124M:1124M --save;
    then
        echo -e "\nThe RAM was successfully allocated...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating the RAM to this VPS...\n"
        exit $?
fi
if vzctl set $SERVID --privvmpages 1124M:1124M --save;
    then
        echo -e "\nThe Privvmpages have been successfully allocated...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating Privvmpages to this VPS...\n"
        exit $?
fi
if vzctl set $SERVID --oomguarpages 1124M --save;
    then
        echo -e "\nThe Oomguarpages was successfully allocated...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating Oomguarpages to this VPS...\n"
        exit $?
fi
if vzctl start $SERVID;
    then
        echo -e "\nThe VPS was successfully started...\n"
    else
        vzctl stop $SERVID
        vzctl destroy $SERVID
        echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"
        exit $?
fi

관련 정보