通过源码安装部署keystone环境遇到的一些问题

安装所需依赖

以fedora 20 为例,

安装git 和pip  参考pip安装以及好用的pip镜像源

yum install gcc
yum install python-sqlite2 python-lxml python-greenlet-devel python-ldap sqlite-devel openldap-devel  python-devel libxml2-devel

pip install msgfmt virtualenv greenlet


下载代码

$ git clone https://github.com/openstack/keystone.git
$ cd keystone

 
 

安装环境

运行

$ python tools/install_venv.py
会自动部署好virtualenv的环境,这过程中遇到一些问题,例如

greenlet.h:8:20: 致命错误: Python.h:没有那个文件或目录

解决方法是安装python-dev,这是Python的头文件和静态库包:

sudo apt-get install python-dev
yum install python-devel


/root/keystone/.venv/build/lxml/src/lxml/includes/etree_defs.h:9:31: 致命错误:libxml/xmlversion.h:没有那个文件或目录

 #include "libxml/xmlversion.h"

解决方法
 yum install libxml2-devel
sudo ln -s /usr/include/libxml2/libxml   /usr/include/libxml



/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto

collect2: 错误:ld 返回 1
error: command 'gcc' failed with exit status 1

----------------------------------------
  Rolling back uninstall of python-ldap
Cleaning up...
解决方法
ubuntu:build-essential
libssl-dev

fedora: yum install openssl-devel.x86_64


测试是否安装成功

$ source .venv/bin/activate
$ python
>>> import keystone
>>>


参考:

http://docs.openstack.org/developer/keystone/setup.html

你可能感兴趣的:(源码,openstack,keystone)