作者:li-yuefang_883 | 来源:互联网 | 2014-05-27 20:19
yumupdatesed-is/SELINUXenforcing/SELINUXdisabled//etc/selinux/configrebootyuminstallbridge-utilsvi/etc/sysconfig/network-scripts/ifcfg-br0DEVICEbr0NM_CONTROLLED
yum update
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
reboot
=====================
yum install bridge-utils
vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
NM_COnTROLLED="yes"
OnBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=IP地址
PREFIX=24 IP地址段
GATEWAY=IP网关
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_COnTROLLED="yes"
OnBOOT=yes
TYPE="Ethernet"
UUID="跟原来文件里的一致"
HWADDR=跟原来文件里的一致
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0
/etc/init.d/network restart
ifconfig
====================
wget
http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-4.noarch.rpm
rpm -ivh kernel-xen-release-6-4.noarch.rpm
yum install xen-libs kernel-xen xen kernel-xen-devel
virt-manager bridge-utils libvirt libvirt-python python-virtinst
gcc-c++
vi /boot/grub/menu.lst 查看xen内核引导应该是这样:
title CentOS (2.6.32.57-2.el6xen.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32.57-2.el6xen.x86_64 ro root=/dev/mapper/vg_server1-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFOnT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=de rd_LVM_LV=vg_server1/LogVol01 rd_LVM_LV=vg_server1/LogVol00 rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32.57-2.el6xen.x86_64.img
改成
title CentOS (2.6.32.57-2.el6xen.x86_64)
root (hd0,0)
kernel /xen.gz dom0_mem=512M cpufreq=xen
module /vmlinuz-2.6.32.57-2.el6xen.x86_64 ro root=/dev/mapper/vg_server1-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFOnT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=de rd_LVM_LV=vg_server1/LogVol01 rd_LVM_LV=vg_server1/LogVol00 rd_NO_DM rhgb quiet
module /initramfs-2.6.32.57-2.el6xen.x86_64.img
(网上很多文章,在 cpufreq=xen 后面都有 dom0_max_vcpus=1
dom0_vcpus_pin 测试发现,原来服务器上有8核的cpu,但是 cat /proc/cpuinfo
只能看到一个CPU了。去掉后,才恢复正常)
修改 default=1 为 default=0,从xen内核启动
reboot
uname -r 查看是否xen内核
pstree -p | grep xen 查看xen是否安装好
|-xenconsoled(3062)---{xenconsoled}(3063)
|-xend(3071)-+-{xend}(3072)
|
|-{xend}(3073)
|
|-{xend}(3117)
|
|-{xend}(3118)
|
|-{xend}(3119)
|
|-{xend}(3120)
|
`-{xend}(3121)
|-xenstored(3053)
`-xenwatchdogd(2934)