第 30 章 OpenVZ

简介:

目录

30.1. 安装OpenVZ
30.2. 使用OpenVZ & 建立VPS
30.2.1. 安装操作系统模板
30.2.2. 创建OpenVZ操作系统节点(VPS)
30.3. 设置VPS参数

30.1. 安装OpenVZ

过程 30.1. OpenVZ 安装步骤

  1. 获得OpenVZ yum安装源

    # cd /etc/yum.repos.d
    # wget http://download.openvz.org/openvz.repo
    # rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ
    				
  2. 安装OpenVZ核心以及头文件

    # yum install ovzkernel[-flavor]
    				
  3. 修改启动所使用的内核为OpenVZ内核,使OpenVZ内核为默认启动内核

    # vim /etc/grub.conf
    				

    将类似下面的内容

    title Fedora Core (2.6.8-022stab029.1)
           root (hd0,0)
           kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=0x31B
           initrd /initrd-2.6.8-022stab029.1.img
    				

    修改为类似这样

    title OpenVZ (2.6.8-022stab029.1)
            root (hd0,0)
            kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5
            initrd /initrd-2.6.8-022stab029.1.img
    				

    或直接在里面寻找类似开头为

    title CentOS (2.6.18-194.3.1.el5.028stab069.6)
    
    				

    的项目,并且把default改为他的下标,下标从0开始

  4. 修改LINUX网络配置文件

    /etc/sysctl.conf
    # On Hardware Node we generally need
    # packet forwarding enabled and proxy arp disabled
    net.ipv4.ip_forward = 1 #修改
    
    net.ipv6.conf.default.forwarding = 1 #添加
    net.ipv6.conf.all.forwarding = 1 #添加
    net.ipv4.conf.default.proxy_arp = 0 #添加
    
    # 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 #添加
    				
  5. 关闭SELinux

    # lokkit --selinux=disabled
    				
    SELINUX=disabled
    				
  6. 重启LINUX

    # reboot
    				
  7. 安装OpenVZ管理工具

    # yum install vzctl
    # yum install vzquota
    # yum install vzyum
    				

    用到什么工具就安装什么工具,具体可以使用# yum search vz*搜索一下

  8. 启动OpenVZ服务

    # /sbin/service vz start
    				

Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by Disqus





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
缓存 Ubuntu Linux
LXC (Linux 虚拟环境)简单介绍
LXC是Linux containers的简称,操作系统级别的虚拟化技术。它可以在操作系统层次上为进程提供的虚拟的执行环境。一个虚拟的执行环境被称为一个容器(container)。可以为容器绑定特定的cpu和memory节点,分配特定比例的cpu时间、IO时间,限制可以使用的内存大小(包括内存和是swap空间),提供device访问控制,提供独立的namespace(网络、pid、ipc、mnt、uts)。
980 0
LXC (Linux 虚拟环境)简单介绍
|
10月前
|
存储 Linux 调度
Linux部署KVM虚拟化平台
Linux部署KVM虚拟化平台
264 0
|
安全 Java Linux
懂了!VMware/KVM/Docker原来是这么回事儿
懂了!VMware/KVM/Docker原来是这么回事儿
267 0
懂了!VMware/KVM/Docker原来是这么回事儿
|
Devops Unix Linux
在tinycorelinux上安装lxc,lxd (1)
本文关键字,在tinycorelinux上安装lxc,lxd,gcc4.4 self-reference struct typedef
246 0
在tinycorelinux上安装lxc,lxd (1)
|
Linux 开发工具 网络协议

热门文章

最新文章