转载请注明出处:http://blog.csdn.net/sonach/article/details/7694261 谢谢!
1 概要
服务器硬件配置:Dell R710,8GB RAM,1TB SATA
注意:需要BIOS中开启虚拟化支持。
HostOS:Ubuntu-Server-11.10-x86_64(300GB SATA)
Backend:openSUSE-11.4-DVD-x86_64 JeOS(2CPU, 1.5GB RAM,150GB SATA)
Frontend:openSUSE-11.4-DVD-x86_64 JeOS(2CPU,1GB RAM,100GB SATA)
Worker:openSUSE-11.4-DVD-x86_64 JeOS(4CPU, 2.5GB RAM,150GB SATA)
MerDS:openSUSE-11.4-DVD-x86_64 JeOS(1CPU,512MB RAM, 100GB SATA)
HostOS:192.168.188.141
Backend:192.168.188.142
Frontend:192.168.188.143
Worker:192.168.188.144
MerDS:192.168.188.1452 HostOS安装和配置
选择分区方式时,选择“entire disk and LVM group”;
创建安装Ubuntu的LogicalVolume分区大小:300GB;
选择OpenSSH 和 VirtualMachine支持;
安装成功后,sudo su - 可切换到root身份,此后可设置 root密码;
安装必备工具:
aptitude install qemu-kvm libvirt-bin ubuntu-vm-builderbridge-utils
将当前用户加入kvm和libvirtd的组:
sudo adduser `id -un` kvm
sudo adduser `id -un` libvirtd
确认VM Service是否在运行:
virsh -cqemu:///system list
如果打印:
Id Name State
----------------------------------
表明VM Service在运行。
安装Ubuntu的桌面工具;
安装VM的GUI工具:
sudo apt-get install virt-manager
桥接设置(/etc/network/interfaces):
auto br0
iface br0 inet static
address 192.168.188.141
netmask 255.255.255.0
network 192.168.188.0
broadcast 192.168.188.255
gateway 192.168.188.2
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
3 VM的安装
创建LVM分区:sudo lvcreate --name obsbe_vm --size 150G ubtsvr
(其中ubtsvr是LVM Group的名称)
选择Storage是/dev/ubtsvr/obsbe_vm
确认网络设备是“br0”
安装OpenSUSE11.4JeOS:用openSUSE-11.4-DVD-x86_64;在选择KDE/GNOME/Other的界面,选择“Other”,然后选择Minimal Server installation。
VM安装成功并启动后,做如下配置:
安装vim:zypper install vim
设置IP:
/etc/sysconfig/network/ifcfg-eth0:
BOOTPROTO=static
IPADDR=192.168.1.110
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
设置网关:
echo “default 192.168.188.2 - -“ >> /etc/sysconfig/network/routes
设置ssh:
Chkconfig --add sshd
关闭防火墙:
chkconfig --del SuSEfirewall2_setup
chkconfig --del SuSEfirewall2_init
重启VM。
4 MerOBS安装
从https://github.com/lbt/obs-setup 下载到setup-obs.sh
Backend安装:setup-obs.sh be
Frontend安装:setup-obs.sh fe
Worker安装:setup-obs.sh worker
MerDS安装:
参考https://wiki.merproject.org/wiki/Mer_Delivery_System
可以用curl http://192.168.188.145:8001/public/source/Core:i586/acl来测试MerDS是否正确运行。
5 配置与运行
在https://fe这个WEBUI上创建一个工程:
<project name="MerDS">
<title>Mer Delivery System</title>
<description>A 'remote link' to the MDS API service running against a local copy of Mer
</description>
<remoteurl>http://192.168.188.145:8001/public</remoteurl>
<person userid="Admin" role="maintainer"/>
<person userid="Admin" role="bugowner"/>
</project>
创建机器名和IP的映射:
修改fe/be/worker的/etc/hosts文件,以backend为例:
192.168.188.144linux-58rw.site linux-58rw
192.168.188.143linux-nk4m.site linux-nk4m
192.168.188.145linux-ye9b.site linux-ye96
备注:在完成编译后,在backend上查看/srv/obs/log/publish.log文件,发现无法找到”createrepo”工具,于是手动安装该工具:
Zypper install createrepo
Mer Release的下载:
rsync -a --progressrsync://releases.merproject.org/mer-releases/releases/latest/builds/armv7l/packages/*.
将Mer Releases放到frontend的/srv/obs/repos目录下,即可在REPO上看到。
6 参考资料
http://wiki.merproject.com/wiki/Mer_OBS_VM_Setup_Guide
https://wiki.merproject.org/wiki/OBS_Setup
https://wiki.merproject.org/wiki/Mer_Delivery_System