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: No such file or directory
解决:
安装sudo
问题:
Traceback (most recent call last):
File "/opt/horizon-2012.2/openstack_dashboard/wsgi/django.wsgi", line 4, in <module>
import django.core.handlers.wsgi
ImportError: No module named django.core.handlers.wsgi
解决:
安装mod_wsgi:
./configure --with-python=/usr/local/bin/python2.7
http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions
安装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出现如下问题:view plaincopyprint?
[*] /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
[*] .../lib/libpython2.7.a: could not read symbols: Bad value
[*] 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:
view plaincopyprint?
[*] /bin/sh /usr/lib64/apr/build/libtool --silent --mode=link gcc -o \
[*] mod_wsgi.la -I/usr/local/include/python2.4 -DNDEBUG-rpath \
[*] /usr/lib64/httpd/modules -module -avoid-version mod_wsgi.lo \
[*] -L/usr/local/lib/python2.4/config -lpython2.4 -lpthread -ldl -lutil
[*] /usr/bin/ld: /usr/local/lib/python2.4/config/
[*] libpython2.4.a(abstract.o): relocation R_X86_64_32 against `a local
[*] symbol' can not be used when making a shared object; recompile with -fPIC
[*] /usr/local/lib/python2.4/config/libpython2.4.a: could not read symbols: Bad value
[*] collect2: ld returned 1 exit status
[*] apxs:Error: Command failed with rc=65536
[*] .
[*] make: *** 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会出现如下问题:
view plaincopyprint?
[*] error while loading shared libraries: libpython2.6.so.1.0: \
[*] cannot open shared object file: No such file or directory
解决方法很简单:(debian系统)
view plaincopyprint?
[*] # echo "/usr/local/lib" >> /etc/ld.so.conf
[*] # 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配置
页:
[1]