OpenStack版本升级之Horizon

安装依赖库

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

[ugyn@localhost horizon]$ 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


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

下载Horizon

[root@stackcc update_horizon]# git clone git://github.com/openstack/horizon.git
[root@stackcc update_horizon]# cd horizon
[root@stackcc horizon]# git checkout -b folsom origin/stable/folsom

配置

我这里采用memcached来作为session的存储不再采用数据库,各种session存储方式的比较见这里

[root@stackcc horizon]# cd openstack_dashboard/local/
[root@stackcc local]# cp local_settings.py.example local_settings.py
[root@stackcc local]# 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

[root@stackcc local]# cd ../../
[root@stackcc horizon]# service httpd stop
[root@stackcc horizon]# python setup.py install > ../install.info
[root@stackcc horizon]# mkdir /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/static
[root@stackcc horizon]# chown apache:apache /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/static

配置httpd

[root@stackcc horizon]# cd /etc/httpd/conf.d/
[root@stackcc conf.d]# cp horizon.conf horizon.conf.backup
[root@stackcc conf.d]# 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
[root@stackcc conf.d]# sed -i 's/horizon-2012.1-py2.6.egg/horizon-2012.2.1-py2.6.egg/g' horizon.conf
[root@stackcc conf.d]# 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
[root@stackcc conf.d]# mkdir /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/.blackhole

安装遗漏的包并启动Horizon

[root@stackcc conf.d]# pip install python-memcached
[root@stackcc conf.d]# service httpd start
[root@stackcc conf.d]# service nova-api restart

更新noVNC

[root@stackcc update_horizon]# git clone git://github.com/kanaka/noVNC.git
[root@stackcc update_horizon]# cd noVNC
[root@stackcc noVNC]# git checkout -b binary origin/binary
[root@stackcc noVNC]# cd ..
[root@stackcc update_horizon]# rm -fr /var/lib/noVNC
[root@stackcc update_horizon]# rsync -az --exclude=noVNC/.git noVNC /var/lib/
[root@stackcc update_horizon]# 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()
[root@stackcc update_horizon]# /var/lib/noVNC/utils/nova-novncproxy --web /var/lib/noVNC --daemon
[root@stackcc update_horizon]# 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.访问速度比较慢!!!

北方工业大学 | 云计算研究中心 | 姜永

你可能感兴趣的:(OpenStack版本升级之Horizon)