参考资料https://openvz.org/Quick_Installation_CentOS_6

1:首先下载openvz.repo
wget -P /etc/yum.repos.d/ https://download.openvz.org/openvz.repo

2:yum更新安装
yum update
yum install vzkernel
yum install vzctl vzquota ploop

3vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.default.forwarding = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

第一步:新建主机cn3131
vzctl create 3131 --hostname cn3131 --ostemplate centos-6-x86_64 --ipadd 10.86.3.131 --config defa
vzctl set 3131 --userpasswd root:firadio
vzctl start 3131

删掉的指令
vzctl stop 3131
vzctl delete 3131

详细配置命令
vzctl set 3131 --save --cpus 4
vzctl set 3131 --save --ram 8G
vzctl set 3131 --save --swap 8G
vzctl set 3131 --save --diskspace 20G


主机测试用
vzctl create 3132 --hostname cn3132 --ostemplate centos-6-x86_64 --ipadd 10.86.3.132 --config vip4
vzctl set 3132 --userpasswd root:123
vzctl start 3132


免费送一台
vzctl create 3141 --hostname cn3141 --ostemplate centos-6-x86_64 --ipadd 10.86.3.141
vzctl set 3141 --userpasswd root:firadio

vzctl create 3143 --hostname cn3143 --ostemplate centos-6-x86_64 --ipadd 10.86.3.143
vzctl set 3143 --save --cpus 1
vzctl set 3143 --save --ram 8G
vzctl set 3143 --save --swap 8G
vzctl set 3143 --save --diskspace 20G

 

posted on 2017-02-13 00:12  飞儿传媒  阅读(867)  评论(0编辑  收藏  举报
飞儿传媒