[夏肇毅部落格 夏肇毅運算網 Mark Hsia Computing Web]
OpenStack 基金會的白金會員有Canonical(ubuntu),HP,IBM,Intel,RedHat,SUSE. 這是每年要交50萬美金的. (http://www.openstack.org/foundation/companies/)
台灣的雲端產業協會也是金牌會員之一.
看看這些會員名單, 就應該明白 OpenStack 將是他們未來產品的一環,我們大概就是使用者的角色了.
上個月VMware 發表新產品,就展示了如何在她的環境下建立OpenStack,也證明了這點.
去年至開始Trace OpenStack 程式時,花了一些時間來建立開發環境, 也作了些紀錄備忘.
以下就是環境設定的紀錄與指令說明:
要運行OpenStack 就要裝Linux.
我們先在Windows上用VMWare Player裝CentOS6.5.
下載keystone-2014.1.1 source code.
安裝openstck keystone.
再裝Eclipse.
主要是要在Eclipse來 Trace程式, 所以要安裝PyDev.
做過幾次每次都不太一樣, 所以要隨機應變, 見招拆招了.
重點就是把keystone的python dependencies裝全.
**2014901
-install the dependencies directly into your system from the requires files:
# Install the dependencies for running keystone
$ pip install -r requirements.txt
# Install the dependencies for developing, testing, and running keystone
$ pip install -r test-requirements.txt
# Use 'python setup.py' to link Keystone into Python's site-packages
$ python setup.py develop
(裝了以上開發設定後在正式環境就會有問題, 所以CentOS VM 要先備份. 正式環境就跳過這段)
-import keystone to eclipse PyDev
-install pastedeploy
[root@localhost markhsia]# pip install pastedeploy
Requirement already satisfied (use --upgrade to upgrade): pastedeploy in /usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg
Cleaning up...
[root@localhost markhsia]# pip uninstall pastedeploy
Uninstalling PasteDeploy:
/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg
Proceed (y/n)? y
Successfully uninstalled PasteDeploy
[root@localhost markhsia]# pip install pastedeploy
Downloading/unpacking pastedeploy
Downloading PasteDeploy-1.5.2-py2.py3-none-any.whl
Installing collected packages: pastedeploy
Successfully installed pastedeploy
Cleaning up...
-mouse point to keystone->bin-> keystone-all
-right click Debug As->Python Run
pydev debugger: starting (pid: 52269)
2014-04-24 17:47:24.449 52269 CRITICAL keystone [-] ConfigFileNotFound: An unexpected error prevented the server from fulfilling your request.
-install eclipse
-install pydev for eclipse http://pydev.org/updates
-Window->Preferences
PyDev->interpreter
Click "Advanced Auto-config"
system will scan Python interpreter and Site-Packages
Click "OK"
File->New->Other->PyDev->PyDev Project
Project Name: keystone
Click Finish
Under PyDev Package Explorer
Click keystone project
Right Click->Import->General_>File System
Click Next
Click Browse
Select keystone-2014.1.1 dir
Click keystone-2014.1.1 checkbox
Click Finish
Click keystone/bin/keystone-all
Right click keystone-all->Debug As->Debug Configurations
Click Python Run
Click New button(check icon of New on the right pane)
Name: keystone-all
Click Browse of Project section
Select keystone
Under Main Module pane, enter:
${workspace_loc:keystone/bin/keystone-all}
Click Tab Arguments
Working Directory: Click Others
${project_loc:keystone}
Copy bin/keystone-all
Paste to keystone/keystone-all
Click keystone/keystone-all
Right click->Rename, enter
keystone-all.py
Click OK.
Double click keystone/keystone-all.py to open source
Double click left of line 17 to set break point
Click keystone/keystone-all.py
Right click->Debug As->Python Run
System will switch to debug view and stop on line 17.