因为从ovirt yum安装部署ovirt, 由于engine-setup更新包后导致ovirt-engine url无法打开, 可能是更新后的BUG, 数据库日志也报了大量的函数不存在的错误.
准备试一试oVirt打包的LiveCD ISO, 可以下载3.4.2或者最新的3.4.3-1
3.4.3-1的版本是基于CentOS 6.5封装的.
在使用LiveCD启动时, 在grub界面有10秒时间停留, 默认会进入LiveCD桌面, 如果要安装的话, 直接在grub中选择text 安装, 注意安装过程要传输镜像, 可能会比较慢.
安装好之后, 服务器会重启, 但是图形界面可能有问题, 不一定能进去, 建议通过console界面来来配置.
配置网络, ovirt-livecd 3.4.3.1安装好后, 网络是没有配置好的, 需要配置一下, ctrl alt F2切到text console, 先把管理网卡配置好.
移除不必要的配置.
配置内核, 时钟, 启动级别等
另外, ovirt-livecd默认还有一个网桥会自动启动, 如果用openvswitch的话, 建议删掉.
建议关闭selinux
导入jpackage gpgkey, 使用ovirt-engine-reports可能会用到这个. http://www.jpackage.org/gpgkey.php
配置主机名
更新包
配置防火墙
安装数据库
# vi /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
BOOTPROTO=static
ONBOOT=yes
BROADCAST=172.16.3.255
DNS1=202.101.172.35
GATEWAY=172.16.3.1
IPADDR=172.16.3.150
NETMASK=255.255.255.0
NM_CONTROLLED=no
TYPE=Ethernet
[root@livecd ~]# ifconfig -a
dummy0 Link encap:Ethernet HWaddr 2E:F6:61:61:37:12
inet6 addr: fe80::2cf6:61ff:fe61:3712/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:666 (666.0 b)
em1 Link encap:Ethernet HWaddr 00:22:19:60:77:8F
inet addr:172.16.3.150 Bcast:172.16.3.255 Mask:255.255.255.0
inet6 addr: fe80::222:19ff:fe60:778f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:76028 errors:0 dropped:0 overruns:0 frame:0
TX packets:40213 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:98776532 (94.2 MiB) TX bytes:3266194 (3.1 MiB)
em2 Link encap:Ethernet HWaddr 00:22:19:60:77:91
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
em3 Link encap:Ethernet HWaddr 00:22:19:60:77:93
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
em4 Link encap:Ethernet HWaddr 00:22:19:60:77:95
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:204 errors:0 dropped:0 overruns:0 frame:0
TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18008 (17.5 KiB) TX bytes:18008 (17.5 KiB)
ovirtmgmt Link encap:Ethernet HWaddr 2E:F6:61:61:37:12 这个网桥用于管理, 如果换openvswitch管理, 名字务必一样, 否则再ovirt添加主机会失败.
但是不建议使用openvswitch, 原因见 http://blog.163.com/digoal@126/blog/static/16387704020147683530613/
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::2cf6:61ff:fe61:3712/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:816 (816.0 b)
virbr0 Link encap:Ethernet HWaddr 52:54:00:92:FF:19
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
virbr0-nic Link encap:Ethernet HWaddr 52:54:00:92:FF:19
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@livecd ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:22:19:60:77:8f brd ff:ff:ff:ff:ff:ff
3: em2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:22:19:60:77:91 brd ff:ff:ff:ff:ff:ff
4: em3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:22:19:60:77:93 brd ff:ff:ff:ff:ff:ff
5: em4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:22:19:60:77:95 brd ff:ff:ff:ff:ff:ff
6: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 2e:f6:61:61:37:12 brd ff:ff:ff:ff:ff:ff
7: ovirtmgmt: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 2e:f6:61:61:37:12 brd ff:ff:ff:ff:ff:ff
8: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 52:54:00:92:ff:19 brd ff:ff:ff:ff:ff:ff
9: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
link/ether 52:54:00:92:ff:19 brd ff:ff:ff:ff:ff:ff
移除不必要的配置.
[root@150 ~]# cd /etc/sysconfig/network-scripts/
[root@150 network-scripts]# ll ifcf*
-rw-r-----. 1 root root 97 Jul 24 18:57 ifcfg-dummy0
-rw-r-----. 1 root root 174 Aug 5 09:46 ifcfg-em1
-rw-r-----. 1 root root 175 Aug 5 01:44 ifcfg-eth0
-rw-r--r--. 1 root root 254 Oct 10 2013 ifcfg-lo
-rw-r-----. 1 root root 120 Jul 24 18:57 ifcfg-ovirtmgmt
-rw-r-----. 1 root root 39 Jul 24 18:57 ifcfg-wlan0
[root@150 network-scripts]# mv ifcfg-dummy0 ifcfg-dummy0.bak
[root@150 network-scripts]# mv ifcfg-eth0 ifcfg-eth0.bak
[root@150 network-scripts]# mv ifcfg-ovirtmgmt ifcfg-ovirtmgmt.bak
[root@150 network-scripts]# mv ifcfg-wlan0 ifcfg-wlan0.bak
配置内核, 时钟, 启动级别等
# vi /etc/inittab
id:3:initdefault:
# vi /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 50100 64128000 50100 1280
fs.file-max = 7672460
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 0
net.ipv4.ip_conntrack_max = 655360
fs.aio-max-nr = 1048576
net.ipv4.tcp_timestamps = 0
vm.nr_hugepages=0
# sysctl -p
# vi /etc/security/limits.conf
* soft nofile 131072
* hard nofile 131073
* soft nproc 131072
* hard nproc 131073
* soft core unlimited
* hard core unlimited
* soft memlock 50000000
* hard memlock 50000001
# vi /etc/security/limits.d/90-nproc.conf
#* soft nproc 1024
#root soft nproc unlimited
* soft nproc 131072
* hard nproc 131073
chkconfig acpid off
chkconfig avahi-daemon off
chkconfig bluetooth off
chkconfig hidd off
chkconfig smartd off
chkconfig yum-updatesd off
chkconfig hplip off
chkconfig isdn off
chkconfig iscsi off
chkconfig iscsid off
chkconfig multipathd off
chkconfig NetworkManager off
chkconfig ip6tables off
chkconfig iptables on
另外, ovirt-livecd默认还有一个网桥会自动启动, 如果用openvswitch的话, 建议删掉.
# cd /etc/libvirt/qemu/networks/autostart
[root@150 autostart]# ll
total 0
lrwxrwxrwx. 1 root root 14 Jul 24 18:46 default.xml -> ../default.xml
[root@150 networks]# less default.xml
<network>
<name>default</name>
<uuid>cf47a42f-e66f-4263-920a-fabc46900708</uuid>
<bridge name="virbr0" />
<mac address='52:54:00:92:FF:19'/>
<forward/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.2" end="192.168.122.254" />
</dhcp>
</ip>
</network>
[root@150 autostart]# rm -f *
建议关闭selinux
# vi /etc/selinux/config
SELINUX=disabled
[root@150 ~]# setenforce 0
导入jpackage gpgkey, 使用ovirt-engine-reports可能会用到这个. http://www.jpackage.org/gpgkey.php
[root@150 network-scripts]# cd
[root@150 ~]# vi key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
mQGiBD20yCERBADLY2x5Q7+ATSH9+jtd17hrRsWfaCOm888ITZTAmggeJ3ycxXmV
or3EfbLXVFfTuFO6pU9ExFtRA9P6DsrCrsOlidZVl7TXZBiHOUpol3OyC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s24rJZS2APWWjmF1+ozQAoIO9xTE3M7UugyEqHgenbPNLtd3E
=Wifs
-----END PGP PUBLIC KEY BLOCK-----
~
"key" [New] 25L, 1391C written
[root@150 ~]# cat key |gpg --import
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key C431416D: public key "JPackage Project (JPP Official Keys) <jpackage@zarb.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
[root@150 ~]# gpg --fingerprint
/root/.gnupg/pubring.gpg
------------------------
pub 1024D/C431416D 2002-10-22
Key fingerprint = 1F81 C0FB C2B8 22B3 DE12 33A4 5C6C FFF7 C431 416D
uid JPackage Project (JPP Official Keys) <jpackage@zarb.org>
sub 1024g/F3813DB7 2002-10-22
配置主机名
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
#10.0.0.1 livecd.localdomain localdomain
172.16.3.150 150.sky-mobi.com
# hostname 150.sky-mobi.com
# vi /etc/sysconfig/network
HOSTNAME=150.sky-mobi.com
更新包
yum -y update
配置防火墙
# vi /etc/sysconfig/iptables
# add
-A INPUT -s 192.168.0.0/16 -j ACCEPT
-A INPUT -s 10.0.0.0/8 -j ACCEPT
-A INPUT -s 172.16.0.0/16 -j ACCEPT
# service iptables reload
安装数据库
yum -y install lrzsz sysstat e4fsprogs ntp readline-devel zlib zlib-devel openssl openssl-devel pam-devel libxml2-devel libxslt-devel python-devel tcl-devel gcc make smartmontools flex bison perl perl-devel perl-ExtUtils* OpenIPMI-tools openldap openldap-devel
略.
创建3个数据库, ovirt, ovirt_er, ovirt_eh.
数据库命令建议安装目录--exec-prefix=/usr, 否则备份会有问题, 因为自带的版本太低.
参见 :
配置数据库自启动
安装配置ovs (如果要同时作为ovirt management和ovirt vdsm使用的话)
# vi /etc/rc.local
su - postgres -c "pg_ctl start"
安装配置ovs (如果要同时作为ovirt management和ovirt vdsm使用的话)
不建议使用, 原因见
http://blog.163.com/digoal@126/blog/static/16387704020147683530613/
重启操作系统
配置openvswitch, 新建的用于管理虚拟机的网段的网桥名称必须使用ovirtmgmt.
[root@150 ~]# uname -r
2.6.32-431.20.3.el6.x86_64
[root@150 ~]# yum install -y rpm-build redhat-rpm-config kernel-devel-2.6.32-431.20.3.el6.x86_64
[root@150 ~]# cd /opt/soft_bak/
[root@150 soft_bak]# wget http://openvswitch.org/releases/openvswitch-1.9.3.tar.gz
[root@150 soft_bak]# tar -zxvf openvswitch-1.9.3.tar.gz
[root@150 soft_bak]# mkdir -p /root/rpmbuild/SOURCES
[root@150 soft_bak]# cp openvswitch-1.9.3.tar.gz /root/rpmbuild/SOURCES/
[root@150 soft_bak]# cd openvswitch-1.9.3
[root@150 openvswitch-1.9.3]# rpmbuild -bb rhel/openvswitch.spec
[root@150 openvswitch-1.9.3]# cp rhel/openvswitch-kmod.files /root/rpmbuild/SOURCES/
[root@150 openvswitch-1.9.3]# yum install -y kabi-whitelists
[root@150 openvswitch-1.9.3]# uname -r
2.6.32-431.20.3.el6.x86_64
[root@150 openvswitch-1.9.3]# rpmbuild -bb -D "kversion 2.6.32-431.20.3.el6.x86_64" -D "kflavors default" rhel/openvswitch-kmod-rhel6.spec
[root@150 openvswitch-1.9.3]# cd /root/rpmbuild/RPMS/x86_64/
[root@150 x86_64]# ll
total 9292
-rw-r--r--. 1 root root 1200952 Aug 5 10:30 kmod-openvswitch-1.9.3-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 2149824 Aug 5 10:28 openvswitch-1.9.3-1.x86_64.rpm
-rw-r--r--. 1 root root 6159100 Aug 5 10:28 openvswitch-debuginfo-1.9.3-1.x86_64.rpm
[root@150 x86_64]# rpm -ivh kmod-openvswitch-1.9.3-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:kmod-openvswitch ########################################### [100%]
[root@150 x86_64]# rpm -ivh openvswitch-1.9.3-1.x86_64.rpm
Preparing... ########################################### [100%]
1:openvswitch ########################################### [100%]
[root@150 x86_64]# vi /etc/modprobe.d/blacklist.conf
# add by digoal, use openvswitch instead
blacklist bridge
重启操作系统
# reboot
配置openvswitch, 新建的用于管理虚拟机的网段的网桥名称必须使用ovirtmgmt.
不建议使用, 原因见 :
http://blog.163.com/digoal@126/blog/static/16387704020147683530613/
安装oVirt engine reports
配置oVirt引擎
[参考]
[root@150 ~]# ovs-vsctl add-br br0
[root@150 ~]# ifconfig br0 up
[root@150 ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:22:19:60:77:8f brd ff:ff:ff:ff:ff:ff
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:22:19:60:77:91 brd ff:ff:ff:ff:ff:ff
4: em3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:22:19:60:77:93 brd ff:ff:ff:ff:ff:ff
5: em4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:22:19:60:77:95 brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 0a:cf:04:db:13:41 brd ff:ff:ff:ff:ff:ff
[root@150 ~]# cd /etc/sysconfig/network-scripts/
[root@150 network-scripts]# cp ifcfg-em1 ifcfg-br0
[root@150 network-scripts]# vi ifcfg-br0
DEVICE=br0
BOOTPROTO=static
ONBOOT=yes
BROADCAST=172.16.3.255
DNS1=202.101.172.35
GATEWAY=172.16.3.1
IPADDR=172.16.3.150
NETMASK=255.255.255.0
NM_CONTROLLED=no
[root@150 network-scripts]# vi ifcfg-em1
DEVICE=em1
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0
[root@150 network-scripts]# ovs-vsctl add-port br0 em1; service network restart
[root@150 ~]# ovs-vsctl show
fb8f1987-c908-4a8f-bc2c-1f8c19f034fc
Bridge "br0"
Port "em1"
Interface "em1"
Port "br0"
Interface "br0"
type: internal
ovs_version: "1.9.3"
[root@150 ~]# ifconfig
br0 Link encap:Ethernet HWaddr 00:22:19:60:77:8F
inet addr:172.16.3.150 Bcast:172.16.3.255 Mask:255.255.255.0
inet6 addr: fe80::222:19ff:fe60:778f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:192 errors:0 dropped:0 overruns:0 frame:0
TX packets:185 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18500 (18.0 KiB) TX bytes:16968 (16.5 KiB)
em1 Link encap:Ethernet HWaddr 00:22:19:60:77:8F
inet6 addr: fe80::222:19ff:fe60:778f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:129 errors:0 dropped:0 overruns:0 frame:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14521 (14.1 KiB) TX bytes:11236 (10.9 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5600 (5.4 KiB) TX bytes:5600 (5.4 KiB)
安装oVirt engine reports
[root@150 ~]# yum localinstall -y http://resources.ovirt.org/pub/yum-repo/ovirt-release34.rpm
[root@150 ~]# yum install -y ovirt-engine-reports
配置oVirt引擎
[root@150 ~]# engine-setup
[参考]