Carreychen 发表于 2016-1-9 07:02:47

OpenStack版本升级之Horizon

安装依赖库
  对照下面E版和F版的pip-requires比较并运行pip freeze查看已经安装的包,然后安装缺少的依赖包,另外F版还需要有nodejs支持:

$ git diff origin/stable/essex:tools/pip-requires origin/stable/folsom:tools/pip-requires
diff --git a/origin/stable/essex:tools/pip-requires b/origin/stable/folsom:tools/pip-requires
index cd7e275..08d53a6 100644
--- a/origin/stable/essex:tools/pip-requires
+++ b/origin/stable/folsom:tools/pip-requires
@@ -1,23 +1,14 @@
# Horizon Core Requirements
-Django>=1.3
-python-cloudfiles
-python-dateutil
-django-nose
+Django>=1.4
+django_compressor
+django_openstack_auth
+python-cinderclient
+python-glanceclient<2
+python-keystoneclient
+python-novaclient
+python-quantumclient>=2.0
+python-swiftclient>1.1,<2
+pytz
-# Glance Requirements
-PasteDeploy
-eventlet
-kombu
-paste
-pycrypto==2.3
-routes
-sqlalchemy
-sqlalchemy-migrate
-webob==1.0.8
-xattr
-iso8601
-
-# Horizon Non-pip Requirements
--e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient
--e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient
--e git+https://github.com/openstack/glance@stable/essex#egg=glance
+# Horizon Utility Requirements
+lockfile # for SECURE_KEY generation

# pip install django_compressor django_openstack_auth python-cinderclient pytz
# wget http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x64.tar.gz
# tar -zxf node-v0.8.14-linux-x64.tar.gz
# cp node-v0.8.14-linux-x64/bin/node /usr/bin/

下载Horizon

# git clone git://github.com/openstack/horizon.git
# cd horizon
# git checkout -b folsom origin/stable/folsom
配置
  我这里采用memcached来作为session的存储不再采用数据库,各种session存储方式的比较见这里

# cd openstack_dashboard/local/
# cp local_settings.py.example local_settings.py
# diff -u local_settings.py.example local_settings.py
--- local_settings.py.example   2012-11-21 19:01:00.551430262 +0800
+++ local_settings.py   2012-11-21 21:07:11.299613374 +0800
@@ -34,11 +34,20 @@
# for all of them.
# from horizon.utils import secret_key
# SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
+SECRET_KEY = 'qiweufsaldfalsduifalodefhalsdfh'
# We recommend you use memcached for development; otherwise after every reload
# of the django development server, you will have to login again. To use
# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
-CACHE_BACKEND = 'locmem://'
+CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
+
+SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
+CACHES = {
+    'default': {
+      'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+      'LOCATION': '127.0.0.1:11211'
+    }
+}
# Send email to the console by default
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
安装Horizon

# cd ../../
# service httpd stop
# python setup.py install > ../install.info
# mkdir /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/static
# chown apache:apache /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/static
配置httpd

# cd /etc/httpd/conf.d/
# cp horizon.conf horizon.conf.backup
# ll /usr/lib/python2.6/site-packages/ | grep horizon
drwxr-xr-x.7 root root   4096 Oct 30 14:59 horizon-2012.1-py2.6.egg
drwxr-xr-x   6 root root   4096 Nov 21 20:05 horizon-2012.2.1-py2.6.egg
# sed -i 's/horizon-2012.1-py2.6.egg/horizon-2012.2.1-py2.6.egg/g' horizon.conf
# cat horizon.conf
<VirtualHost *:80>
WSGIScriptAlias / /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/openstack_dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=apache group=apache processes=3 threads=10 home=/usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg
SetEnv APACHE_RUN_USER apache
SetEnv APACHE_RUN_GROUP apache
WSGIProcessGroup horizon
DocumentRoot /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/.blackhole/
Alias /media /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/openstack_dashboard/static
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/horizon_error.log
LogLevel warn
CustomLog /var/log/httpd/horizon_access.log combined
</VirtualHost>
WSGISocketPrefix /var/run/httpd
# mkdir /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/.blackhole
安装遗漏的包并启动Horizon

# pip install python-memcached
# service httpd start
# service nova-api restart

更新noVNC

# git clone git://github.com/kanaka/noVNC.git
# cd noVNC
# git checkout -b binary origin/binary
# cd ..
# rm -fr /var/lib/noVNC
# rsync -az --exclude=noVNC/.git noVNC /var/lib/
# diff -u noVNC/utils/nova-novncproxy /var/lib/noVNC/utils/nova-novncproxy
--- noVNC/utils/nova-novncproxy 2012-11-22 19:38:40.947866979 +0800
+++ /var/lib/noVNC/utils/nova-novncproxy      2012-11-22 20:18:08.738045480 +0800
@@ -148,5 +148,8 @@
target_host='ignore',
target_port='ignore',
wrap_mode='exit',
+                              unix_target=None,
+                              ssl_target=None,
+                              target_cfg=None,
wrap_cmd=None)
server.start_server()
# /var/lib/noVNC/utils/nova-novncproxy --web /var/lib/noVNC --daemon
# echo "/var/lib/noVNC/utils/nova-novncproxy --web /var/lib/noVNC --daemon" >> /etc/rc.d/rc.local

小问题
  1.Admin权限用户登录后,Admin选项卡的Volume列表的Action列没有内容

2.Admin中的Overview选项的Usage Summary和Project中的Overview选项的Usage Summary显示不正确,只能统计到更新Horizon后新建或resize的实例信息(可能是因为我将以前创建的实例关联的flavor删除了造成的)

3.Project中的Overview选项的Quota Summary显示不正确

4.英语环境下,Project的Access & Security选项的Floating IP列表的Action列宽度不够(详情)

5.访问速度比较慢!!!
  北方工业大学 |
云计算研究中心 | 姜永
页: [1]
查看完整版本: OpenStack版本升级之Horizon