2.22.2009

OpenVZ on F8

我的系统是fedora8

关于openvz的安装:

1.第一步我们为了要安装openvz呢,我们需要把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.在安装时要选择适合你的数据库:

yum search ovzkernel

然后安装它yum install ovzkernel……

3.为了在系统开启时选择正确的内核我们修改一下启动是的名称:

vi /etc/grub/grub.conf

修改这个文件哦

default=0

timeout=5

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

hiddenmenu

title Fedora OpenVZ (2.6.18-92.1.18.el5.028stab060.2)

root (hd0,0)

kernel /boot/vmlinuz-2.6.18-92.1.18.el5.028stab060.2 ro root=LABEL=/ rhgb quiet acpi=force apm=power-off

initrd /boot/initrd-2.6.18-92.1.18.el5.028stab060.2.img

4.安装一些openvz的工具:

yum install vzctl vzquota

5.打开sysctl.conf文件设置一些参数:

vi /etc/sysctl.conf

net.ipv4.ip_forward = 1 (这个东东我们老大说没有设置是不会上网的哦)
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
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

6.接着运行sysctl -p 在修改/etc/vz/vz.conf文件使neigthbour_devs=all

7.需要把selinux给禁用了,

vi /etc/sysconfig/selinux

selinux=disabled

selinuxtype=targeted

8.接着重启系统一下 reboot

9.重启之后再看看你的内核把 uname -r

10.openvz已经安装好了,接下来的事情就是要安装(template)模板了

http://wiki.openvz.org/Download/template/precreated

满地都是。下载到/vz/template/cache下边

11.创建一个cente os5 系统

12. 创建一个操作系统的template

vzctl create 101 –ostemplate fedora-9-i386-minimal –config vps.basic

呵呵就是把那个.tar.gz去了使用前边的名字。

13.设置101开启

vzctl set 101 –onboot yes –save

14.设置101的名字和ip地址

vzctl set 101 –hostname test.example.com –save

vzctl set 101 –ipadd 192.168.0.101 –save

设置成你的局域网的ip地址哦

15.设置101 的sock号以及他的dns server

vzctl set 101 –numothersock 120 –save

vzctl set 101 –nameserver 213.133.98.98 –nameserver 213.133.99.99 –nameserver 213.133.100.100 –nameserver 145.253.2.75 –save

16.开启101

vzctl start 101

17.设置101的密码

vzctl exec 101 passwd

18.进入101

vzctl enter 101

19.退出101

exit

20.停止101

vzctl stop 101

21.重启101

vzctl restart 101

22.把101删除了

vzctl destroy 101

23.查看openvz各个系统的状态

vzlist -a

Labels:

2.16.2009

Proxmox-虚拟技术的选择

用过Vmware,Openvz. 个人是偏向Openvz的。
今天看到一个更好的Proxmox,感觉它结合了Openvz的优点,
并且还有了Openvz不具备的东西,就是你可以自己安装Guest OS了。
怎么感觉有点像广告啊,闲话不多说了。开工

系统需求: 64bit,如果要支持自己安装GuestOS,那么CPU需要支持Inter VT/AMD V技术
我的测试机器是CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ RAM: 1G

千万注意:Proxmox是需要一个干净的系统的,如果不干净它会把你的系统删
光光的,所以一定要是测试机器,切记!!!

下载地址 http://pve.proxmox.com/wiki/Downloads
我这里用的是Proxmox VE 1.1
刻录成盘->安装到测试机器 整个过程也就是30分钟吧(当然了下载不算了)。

奇怪的事:
[Mon Feb 16 15:59:42 2009] [error] [client 192.168.90.183] File does not exist: /var/www/pve/qemu/VncViewer.class, referer: https://10.0.0.165/qemu/vnc-direct.htm?cid=0&veid=101
竟然没有VncViewer.class,找个来用吧,vnc-java里面就有,我这里传上来了。
wget http://www.enlamp.cn/soft/VncViewer.class

现在就可以用了,记得你的Proxmox的IP地址吧。
我的是 https://10.0.0.165
帐号是root 密码是安装过程中设置的

登录成功了,创建虚拟机,然后剩下的你应该都知道了吧。管理起来很简单的
截了几张图,Win那个不知道算不算侵权。Hoho
“小二,上图片!”

Labels:

8.05.2008

openvz install & use

Installation

x86_64 (2 cores)

CentOS5.1

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
yum install ovzkernel

(It will install x86 & x86_64, so del the i386, or it will lead to some errors.)

rpm -e ovzkernel-2.6.18-53.1.19.el5.028stab053.14.i686

(Change the /etc/sysctl.conf add or change the values)
# For Openvz
# 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
# Enables source route verification
#net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# TCP Explict Congestion Notification
#net.ipv4.tcp_ecn = 0
# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

(add the following lines to /etc/modprobe.conf)
options ip_conntrack ip_conntrack_enable_ve0=1

reboot

Labels: