让CentOS6提供基于OpenVZ的虚拟化服务
刚刚写了OpenVZ常用的几个参数,该文章基于OpenWall的LiveCD安装的,所以关于如何安装OpenVZ没有介绍,并且由于内核没有编译IPv6模块,所以虚拟机不支持IPv6协议,OpenVZ官方文档是支持IPv6的,所以在CentOS6下试验安装OpenVZ。
以下为具体步骤:
1、最小化安装CentOS 6,建议安装x86_64版本,配置好网络及相应的yum升级配置。
2、安装前的准备,禁用SElinux、修改sysctl.conf中的IPv4和IPv6转发,具体如下:
# On Hardware Node we generally need # packet forwarding enabled and proxy arp disabled net.ipv4.ip_forward = 1 net.ipv4.conf.default.proxy_arp = 0 net.ipv6.conf.default.forwarding = 1 net.ipv6.conf.all.forwarding = 1 net.ipv6.conf.default.proxy_ndp = 1 net.ipv6.conf.all.proxy_ndp = 1 # Enables source route verification net.ipv4.conf.all.rp_filter = 1 # Enables the magic-sysrq key kernel.sysrq = 1 # We do not want all our interfaces to send redirects net.ipv4.conf.default.send_redirects = 1 net.ipv4.conf.all.send_redirects = 0
/etc/selinux/config文件:
SELINUX=disabled
3、增加yum安装所需的repo文件
cd /etc/yum.repos.d wget http://download.openvz.org/openvz.repo rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
4、安装OpenVZ内核级相关工具
yum install vzkernel.x86_64
5、重启操作系统即可
6、安装基于Web的管理控制面板
wget -O - http://ovz-web-panel.googlecode.com/svn/installer/ai.sh | sh
完毕后,通过http://IP:3000/访问,默认用户名/密码:admin/admin
注:虚拟机支持IPv6和swap分区了。