OpenStack版本升级之Horizon

来源:互联网 发布:python3 人工智能 编辑:程序博客网 时间:2024/05/16 07:11

安装依赖库

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

[plain] view plaincopy
  1. [ugyn@localhost horizon]$ git diff origin/stable/essex:tools/pip-requires origin/stable/folsom:tools/pip-requires  
  2. diff --git a/origin/stable/essex:tools/pip-requires b/origin/stable/folsom:tools/pip-requires  
  3. index cd7e275..08d53a6 100644  
  4. --- a/origin/stable/essex:tools/pip-requires  
  5. +++ b/origin/stable/folsom:tools/pip-requires  
  6. @@ -1,23 +1,14 @@  
  7.  # Horizon Core Requirements  
  8. -Django>=1.3  
  9. -python-cloudfiles  
  10. -python-dateutil  
  11. -django-nose  
  12. +Django>=1.4  
  13. +django_compressor  
  14. +django_openstack_auth  
  15. +python-cinderclient  
  16. +python-glanceclient<2  
  17. +python-keystoneclient  
  18. +python-novaclient  
  19. +python-quantumclient>=2.0  
  20. +python-swiftclient>1.1,<2  
  21. +pytz  
  22.   
  23. -# Glance Requirements  
  24. -PasteDeploy  
  25. -eventlet  
  26. -kombu  
  27. -paste  
  28. -pycrypto==2.3  
  29. -routes  
  30. -sqlalchemy  
  31. -sqlalchemy-migrate  
  32. -webob==1.0.8  
  33. -xattr  
  34. -iso8601  
  35. -  
  36. -# Horizon Non-pip Requirements  
  37. --e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient  
  38. --e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient  
  39. --e git+https://github.com/openstack/glance@stable/essex#egg=glance  
  40. +# Horizon Utility Requirements  
  41. +lockfile # for SECURE_KEY generation  
  42.   
  43.   
  44. [root@stackcc update_horizon]# pip install django_compressor django_openstack_auth python-cinderclient pytz  
  45. [root@stackcc update_horizon]# wget http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x64.tar.gz  
  46. [root@stackcc update_horizon]# tar -zxf node-v0.8.14-linux-x64.tar.gz  
  47. [root@stackcc update_horizon]# cp node-v0.8.14-linux-x64/bin/node /usr/bin/  

下载Horizon

[plain] view plaincopy
  1. [root@stackcc update_horizon]# git clone git://github.com/openstack/horizon.git  
  2. [root@stackcc update_horizon]# cd horizon  
  3. [root@stackcc horizon]# git checkout -b folsom origin/stable/folsom  

配置

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

[plain] view plaincopy
  1. [root@stackcc horizon]# cd openstack_dashboard/local/  
  2. [root@stackcc local]# cp local_settings.py.example local_settings.py  
  3. [root@stackcc local]# diff -u local_settings.py.example local_settings.py  
  4. --- local_settings.py.example   2012-11-21 19:01:00.551430262 +0800  
  5. +++ local_settings.py   2012-11-21 21:07:11.299613374 +0800  
  6. @@ -34,11 +34,20 @@  
  7.  # for all of them.  
  8.  # from horizon.utils import secret_key  
  9.  # SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))  
  10. +SECRET_KEY = 'qiweufsaldfalsduifalodefhalsdfh'  
  11.   
  12.  # We recommend you use memcached for development; otherwise after every reload  
  13.  # of the django development server, you will have to login again. To use  
  14.  # memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'  
  15. -CACHE_BACKEND = 'locmem://'  
  16. +CACHE_BACKEND = 'memcached://127.0.0.1:11211/'  
  17. +  
  18. +SESSION_ENGINE = 'django.contrib.sessions.backends.cache'  
  19. +CACHES = {  
  20. +    'default': {  
  21. +        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',  
  22. +        'LOCATION': '127.0.0.1:11211'  
  23. +    }  
  24. +}  
  25.   
  26.  # Send email to the console by default  
  27.  EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'  

安装Horizon

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

配置httpd

[plain] view plaincopy
  1. [root@stackcc horizon]# cd /etc/httpd/conf.d/  
  2. [root@stackcc conf.d]# cp horizon.conf horizon.conf.backup  
  3. [root@stackcc conf.d]# ll /usr/lib/python2.6/site-packages/ | grep horizon  
  4. drwxr-xr-x.  7 root root   4096 Oct 30 14:59 horizon-2012.1-py2.6.egg  
  5. drwxr-xr-x   6 root root   4096 Nov 21 20:05 horizon-2012.2.1-py2.6.egg  
  6. [root@stackcc conf.d]# sed -i 's/horizon-2012.1-py2.6.egg/horizon-2012.2.1-py2.6.egg/g' horizon.conf  
  7. [root@stackcc conf.d]# cat horizon.conf  
  8. <VirtualHost *:80>  
  9.     WSGIScriptAlias / /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/openstack_dashboard/wsgi/django.wsgi  
  10.     WSGIDaemonProcess horizon user=apache group=apache processes=3 threads=10 home=/usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg  
  11.   
  12.     SetEnv APACHE_RUN_USER apache  
  13.     SetEnv APACHE_RUN_GROUP apache  
  14.     WSGIProcessGroup horizon  
  15.   
  16.     DocumentRoot /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/.blackhole/  
  17.     Alias /media /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/openstack_dashboard/static  
  18.   
  19.     <Directory />  
  20.         Options FollowSymLinks  
  21.         AllowOverride None  
  22.     </Directory>  
  23.   
  24.     <Directory /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/>  
  25.         Options Indexes FollowSymLinks MultiViews  
  26.         AllowOverride None  
  27.         Order allow,deny  
  28.         allow from all  
  29.     </Directory>  
  30.   
  31.     ErrorLog /var/log/httpd/horizon_error.log  
  32.     LogLevel warn  
  33.     CustomLog /var/log/httpd/horizon_access.log combined  
  34. </VirtualHost>  
  35.   
  36. WSGISocketPrefix /var/run/httpd  
  37. [root@stackcc conf.d]# mkdir /usr/lib/python2.6/site-packages/horizon-2012.2.1-py2.6.egg/.blackhole  

安装遗漏的包并启动Horizon

[plain] view plaincopy
  1. [root@stackcc conf.d]# pip install python-memcached  
  2. [root@stackcc conf.d]# service httpd start  
  3. [root@stackcc conf.d]# service nova-api restart  

更新noVNC

[plain] view plaincopy
  1. [root@stackcc update_horizon]# git clone git://github.com/kanaka/noVNC.git  
  2. [root@stackcc update_horizon]# cd noVNC  
  3. [root@stackcc noVNC]# git checkout -b binary origin/binary  
  4. [root@stackcc noVNC]# cd ..  
  5. [root@stackcc update_horizon]# rm -fr /var/lib/noVNC  
  6. [root@stackcc update_horizon]# rsync -az --exclude=noVNC/.git noVNC /var/lib/  
  7. [root@stackcc update_horizon]# diff -u noVNC/utils/nova-novncproxy /var/lib/noVNC/utils/nova-novncproxy  
  8. --- noVNC/utils/nova-novncproxy 2012-11-22 19:38:40.947866979 +0800  
  9. +++ /var/lib/noVNC/utils/nova-novncproxy        2012-11-22 20:18:08.738045480 +0800  
  10. @@ -148,5 +148,8 @@  
  11.                                  target_host='ignore',  
  12.                                  target_port='ignore',  
  13.                                  wrap_mode='exit',  
  14. +                                unix_target=None,  
  15. +                                ssl_target=None,  
  16. +                                target_cfg=None,  
  17.                                  wrap_cmd=None)  
  18.      server.start_server()  
  19. [root@stackcc update_horizon]# /var/lib/noVNC/utils/nova-novncproxy --web /var/lib/noVNC --daemon  
  20. [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.访问速度比较慢!!!

原创粉丝点击