设为首页 收藏本站
查看: 2466|回复: 0

[经验分享] openstack安装过程中遇见的一些错误

[复制链接]

尚未签到

发表于 2018-6-2 13:22:59 | 显示全部楼层 |阅读模式
  下载所有源码包进行安装,过程中安装各种依赖包。
过程中遇到的错误
首先安装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 &quot;setup.py&quot;, line 22, in <module>
    from swiftclient.openstack.common import setup
  File &quot;/tmp/openstack_src/python-swiftclient-1.1.1/swiftclient/__init__.py&quot;, line 5, in <module>
    from client import *
  File &quot;/tmp/openstack_src/python-swiftclient-1.1.1/swiftclient/client.py&quot;, 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 &quot;/usr/local/lib/python2.7/subprocess.py&quot;, 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 &quot;/opt/horizon-2012.2/openstack_dashboard/wsgi/django.wsgi&quot;, 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:
./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出现如下问题:[python]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:
[python]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: *** [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会出现如下问题:


[python]view plaincopyprint?



  •   error while loading shared libraries: libpython2.6.so.1.0: \  
  •    cannot open shared object file: No such file or directory  


解决方法很简单:(debian系统)
[python]view plaincopyprint?



  •   # echo &quot;/usr/local/lib&quot; >> /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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-508029-1-1.html 上篇帖子: openstack 组件volume,image后端存储使用ceph 下篇帖子: OpenStack 完整安装手册(CentOS6.2)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表