Fedora 16上源码建立PyDev + Eclipse的OpenStack开发环境笔记
1网络桥接配置
首先,Fedora 16对网卡使用了新的命名方式,第一块网卡不叫eth0,我的T420上叫em1。
最后配置桥接
sudoyuminstallbridge-utils
sudovi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
#changethehardwareaddresstomatchthehardwareaddressyourNICuses
HWADDR=00:21:CC:60:D6:1A
ONBOOT=yes
#BOOTPROTO=dhcp
#MODE=Managed
BRIDGE=br100
NM_CONTROLLED=no
sudovi/etc/sysconfig/network-scripts/ifcfg-br100
DEVICE=br100
TYPE=Bridge
BOOTPROTO=dhcp
#BOOTPROTO=static
#IPADDR=192.168.99.100
#NETWORK=192.168.99.0
#NETMASK=255.255.255.0
#GATEWAY=192.168.99.1
#DNS1=202.106.195.30
ONBOOT=yes
NM_CONTROLLED=no
最后重启网络服务,sudoservicenetworkrestart,需要注意的是,fedora默认使用NetworkManager来管理网卡,而briage不支持NetworkManager,所以需要关闭NetworkManager服务(sudoserviceNetworkManagerstop&sudoserviceNetworkManager disable)。不然会报下列错(tail-f/var/log/message):
Bringingupinterfaceeth0:Error:Connectionactivationfailed:DevicenotmanagedbyNetworkManagerorunavailable
[FAILED]
RTNETLINKanswers:Fileexists
不过,我没有使用上述方法,因为你关闭NetworkManager服务的话,你的无线网卡也不能用NetworkManager管理了,所以我在上述的配置中加了“NM_CONTROLLED=no”实现了同样的目的。
我机器的其他条件是:
1)你得确保安装了libvirtd(yuminstalllibvirtd&servicelibvirtdstart),可用virsh-cqemu:///systemlist命令测试
2)安装gcc,这个在安装pythonmodules时会用到
3)mysql的root用户应该有密码,可用echo"showdatabases"|mysql-uroot-ppassword
4)在命令行中先切换到root用户,然后再启动eclipse
2通过git下载源码
1) 安装java与eclipse,略
2)为eclipse安装pydev插件(help->installnewsoftwae...,http://pydev.org/updates),然后再"window->preferences":菜单中的Pydev->Interpreter–Python选项卡中点击AutoConfig按钮配置python
3) 为eclipse安装egit插件(http://download.eclipse.org/egit/updates)
4)为eclipse安装django插件:
installdjangopluginforpython,firstdownloadhttp://www.djangoproject.com/download/1.3.1/tarball/
sudopythonsetup.pyinstallexportPATH=/usr/lib/python2.7/site-packages/django/bin:$PATH
django-admin.py–version
django-admin.pystartprojectmyFirstDjango
cdmyFirstDjango
sudochmod777*
./manage.pyrunserver
http://127.0.0.1:8000/
5)在eclipse中通过git插件clone下列组件的master分支(cloneagitrepository),注意,有的组件会下载失败,只需要将https协议换成git协议即可。我的代码下载在/bak/openstack目录下。
#computeservice
NOVA_REPO=https://github.com/openstack/nova.git
#storageservice
SWIFT_REPO=https://github.com/openstack/swift.git
#imagecatalogservice
GLANCE_REPO=https://github.com/openstack/glance.git
#unifiedauthsystem(managesaccounts/tokens)
KEYSTONE_REPO=https://github.com/openstack/keystone.git
#awebsockets/html5orflashpoweredVNCconsoleforvminstances
NOVNC_REPO=https://github.com/cloudbuilders/noVNC.git
#djangopoweredwebcontrolpanelforopenstack
HORIZON_REPO=https://github.com/openstack/horizon.git
#pythonclientlibrarytonovathathorizon(andothers)use
NOVACLIENT_REPO=https://github.com/openstack/python-novaclient.git
#pythonkeystoneclientlibrarytonovathathorizonuses
KEYSTONECLIENT_REPO=https://github.com/openstack/python-keystoneclient
#quantumservice
QUANTUM_REPO=https://github.com/openstack/quantum
#quantumclient
QUANTUM=https://github.com/openstack/python-quantumclient
#Tempesttestsuite
https://github.com/openstack/tempest.git
#melangeservice
https://github.com/openstack/melange.git
#pythonmelangeclientlibrary
https://github.com/openstack/python-melangeclient.git
#swiftclient
https://github.com/chmouel/python-swiftclient.git