Open VZ
1/18/2025 5:48:10 PM in Japan
OpenVZについて apt-get install linux-image-openvz-686 get http://download.openvz.org/template/precreated/debian-6.0-x86_64.tar.gz to /var/liv/vz/template/cache/ mkdir /home/vz/private vzctl create 1 --ostemplate=debian-6.0-x86_64 vzctl set 1 --hostname hostnamehogehoge --save vzctl set 1 --nameserver 192.168.1.1 --save vzctl set 1 --ipadd 192.168.1.? --save file /etc/sysctl.conf net.ipv4.ip_forward=1 sysctl -p vzctl stop 1 vzctl start 1 backup cd /home/vz/private/1 tar -zcf /var/lib/vz/template/cache/debian-6.0-x86_64-minimal.tar.gz . reuse vzctl create 2 --ostemplate=debian-6.0-x86_64-minimal timezone ln -s /usr/share/zoneinfo/Japan /etc/localtime vzlist表示例 # vzlist CTID NPROC STATUS IP_ADDR HOSTNAME 10 20 running 192.168.11.35 debian mua 81 37 running 192.168.11.81 db01 mysql 100 20 running 192.168.11.91 web01 apache, nginx 102 14 running 192.168.11.93 app01 tomcat 106 ?? running 192.168.11.96 debianapp debian etc diskspaceサイズ調整 softlimit(8GByte):hardlimit(8GByte) # vzctl set 100 --diskspace 8000000:8000000 --save disk quotaの確認 CTID 100のquotaを確認 # vzquota stat 100 resource usage softlimit hardlimit grace 1k-blocks 4480476 8000000 8000000 inodes 199537 200000 220000 ※inode利用可能数が足りないようです。調整が必要です。 inodeのsoftlimit, hardlimitを2倍の値にセットします。 # vzctl set 100 --diskinodes 400000:420000 --save UB limits were set successfully CT configuration saved to /etc/vz/conf/100.conf # vzquota stat 100 resource usage softlimit hardlimit grace 1k-blocks 4480480 8000000 8000000 inodes 199537 400000 420000