openstack安裝過程中遇見的一些錯誤

下載所有源碼包進行安裝,過程中安裝各種依賴包。

過程中遇到的錯誤
首先安裝Python2.7
安裝其他依賴包,若報找不到zlib模塊,則首先安裝zlib-devel,然後重新編譯python2.7
error: command 'gcc' failed with exit status 1 的解決辦法


yum install gcc python-devel


需要lxml時執行:
yum install python-lxml

keystone glance quantum horizon swift
錯誤:
Traceback (most recent call last):
 File "setup.py", line 22, in <module>
   from swiftclient.openstack.common import setup
 File "/tmp/openstack_src/python-swiftclient-1.1.1/swiftclient/__init__.py", line 5, in <module>
   from client import *
 File "/tmp/openstack_src/python-swiftclient-1.1.1/swiftclient/client.py", line 31, in <module>
   from httplib import HTTPException, HTTPSConnection
ImportError: cannot import name HTTPSConnection
安裝openssl openssl-devel
重新編譯python2.7
./configure make make install
安裝lxml錯誤:
src/lxml/lxml.etree.c:163157: error: ‘
error: command 'gcc' failed with exit status 1
安裝如下包解決
yum install python-devel libxml2-devel libxslt-devel
ImportError: No module named MySQLdb
解決:安裝MySQLdb
如果通過yum安裝有可能導致路徑不正確,最好源碼安裝
安裝時需要依賴mysql-devel
安裝mysql-server
創建數據庫並修改權限分別是nova,keystone,glance,quantum:
GRANT ALL PRIVILEGES ON *.* TO 'quantum'@'%' IDENTIFIED BY 'quantum';
flush PRIVILEGES ;
同步數據庫
nova-manage db sync
glance-manage db_sync
keystone-manage db_sync
創建文件夾:
/etc/nova
/etc/glance
/etc/keystone
/etc/quantum
/home/creds/novarc novarc_compute
/var/log/nova
/var/log/glance
/var/log/keystone
/var/log/quantum
/var/lock/nova
/var/lock/glance
啓動服務錯誤
nova-api
無法load ec2 from /etc/nova/api-paste.ini
解決 安裝python-paste-deploy-1.5該版本必須大於1.5
sudo。。。。。。
File "/usr/local/lib/python2.7/subprocess.py", line 1249, in _execute_child
2012-08-23 19:43:28 TRACE nova.service     raise child_exception
2012-08-23 19:43:28 TRACE nova.service OSError: [Errno 2] No such file or directory
解決:
安裝sudo
問題:
Traceback (most recent call last):
[Sat Aug 25 01:39:10 2012] [error] [client 10.28.163.59]   File "/opt/horizon-2012.2/openstack_dashboard/wsgi/django.wsgi", line 4, in <module>
[Sat Aug 25 01:39:10 2012] [error] [client 10.28.163.59]     import django.core.handlers.wsgi
[Sat Aug 25 01:39:10 2012] [error] [client 10.28.163.59] ImportError: No module named django.core.handlers.wsgi
解決:
安裝mod_wsgi:
安裝mod_wsgi-3.3過程中的錯誤
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
解決:
源碼安裝mod_wsgi出現如下問題:
  1. /usr/bin/ld: .../lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC  

  2. .../lib/libpython2.7.a: could not read symbols: Bad value  

  3. collect2: ld returned 1 exit status  


網上有很多介紹該問題的解決方法:http://www.cbug.org/2011/11/21/multiple-python-versions-cause-shared-library-mess.html#more-85 介紹的最爲詳細,不料一一試之,問題依然存在!

最後在modwsgi官網http://code.google.com/p/modwsgi/wiki/InstallationIssues發現如下:


When attempting to compile mod_wsgi on a Linux system using an X86 64 bit processor, the following error message can arise:

  1. /bin/sh /usr/lib64/apr/build/libtool --silent --mode=link gcc -o \  

  2.  mod_wsgi.la -I/usr/local/include/python2.4 -DNDEBUG  -rpath \  

  3.  /usr/lib64/httpd/modules -module -avoid-version mod_wsgi.lo \  

  4.  -L/usr/local/lib/python2.4/config -lpython2.4 -lpthread -ldl -lutil  

  5. /usr/bin/ld: /usr/local/lib/python2.4/config/  

  6. libpython2.4.a(abstract.o): relocation R_X86_64_32 against `a local  

  7. symbol' can not be used when making a shared object; recompile with -fPIC  

  8. /usr/local/lib/python2.4/config/libpython2.4.a: could not read symbols: Bad value  

  9. collect2: ld returned 1 exit status  

  10. apxs:Error: Command failed with rc=65536

  11. .  

  12. make: *** [mod_wsgi.la] Error 1



This error is believed to be result of the version of Python being used having been originally compiled for the generic X86 32 bit architecture whereas mod_wsgi is being compiled for X86 64 bit architecture. The actual error arises in this case because 'libtool' would appear to be unable to generate a dynamically loadable module for the X86 64 bit architecture from a X86 32 bit static library. Alternatively, the problem is due to 'libtool' on this platform not being able to create a loadable module from a X86 64 bit static library in all cases.

If the first issue, the only solution to this problem is to recompile Python for the X86 64 bit architecture. When doing this, it is preferable, and may actually be necessary, to ensure that the '--enable-shared' option is provided to the 'configure' script for Python when it is being compiled and installed.

If rebuilding Python to generate a shared library, do make sure that the Python shared library, or a symlink to it appears in the Python 'config' directory of your Python installation. If the shared library doesn't appear here next to the static version of the library, 'libtool' will not be able to find it and will still use the static version of the library. It is understood that the Python build process may not actually do this, so you may have to do it by hand.

If the version of Python being used was compiled for X86 64 bit architecture and a shared library does exist, but not in the 'config' directory, then adding the missing symlink may be all that is required.

簡單翻譯之就是說如果遇到此問題,將python重新編譯(以x86 64位靜態庫),即./configure時加上 --enable shared

之後編譯mod_wsgi會出現如下問題:


  1. error while loading shared libraries: libpython2.6.so.1.0: \  

  2. cannot open shared object file: No such file or directory  


解決方法很簡單:(debian系統)
  1. # echo "/usr/local/lib" >> /etc/ld.so.conf

  2. # ldconfig



其他系統具體詳見:http://hi.baidu.com/susuper_/blog/item/b1a3af012ea741326a60fbfb.html

至此編譯mod_wsgi,正常,make&&make install 一切順利

困擾了一天的問題終於解決,可以進行下一步了


在/etc/httpd/conf/httpd.conf

添加

LoadModule wsgi_module modules/mod_wsgi.so


問題:

Memcached cache backend requires either the 'memcache' or 'cmemcache' library


解決:

easy_install python-memcached


問題:

FilterError: /usr/bin/env: node: No such file or directory

解決:

安裝nodejs即node.js

源碼安裝:http://nodejs.org/dist/node-v0.4.8.tar.gz


安裝好後複製/usr/local/bin/node 到/usr/bin



dashboard創建相關文件夾:

mkdir /opt/horizon-2012.2/static

mkdir /opt/horizon-2012.2/static/dashboard

mkdir /opt/horizon-2012.2/static/dashboard/css

chown apache:apache -R static

配置keystone

登錄dashboard,無效的用戶名和密碼

執行keystone_data.sh腳本


問題:
apxs: command not found
解決:
安裝httpd-devel
nova-compute
Unable to load the virtualization driver: No module named libvirt


將2.6的pythonpath加入到環境變量PYTHONPATH中
可通過
python
>>>import sys
>>>print sys.path
查看路徑
export PYTHONPATH=../.../..:/../../:....


keystone安裝問題:

運行keystone_data.sh
必須初始化數據庫
否則用戶名和密碼錯誤

ServiceCatalogException: Invalid service catalog service: compute

keystone.conf中的catalog配置


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章