一. 安装环境
(1) 系统环境:Ubuntu14.04
下载地址:http://www.ubuntu.com/download/desktop/
(2)openstack:icehouse
二. 安装过程
1.首先安装Ubuntu14.04操作系统并更新系统,安装git
apt-get dist-upgrade
apt-get install git
2.设置使用豆瓣pypi源
mkdir $HOME/.pip
vi $HOME/.pip/pip.conf
输入以下内容:
[global]
index-url = http://pypi.douban.com/simple/
简单的做法:
mkdir /root/.pip
cat >/root/.pip/pip.conf <<EOF
[global]
index-url = http://pypi.douban.com/simple/
EOF
3.下载代码
cd /home
git clone https://github.com/openstack-dev/devstack.git
注意:目前Devstack脚本已经不支持直接使用root身份运行,你需要创建stack用户运行
cd /home/devstack/tools/
./create-stack-user.sh
修改devstack目录权限,让stack用户可以运行
chown -R stack:stack /home/devstack
切换到stack用户下
su stack
cd /home/devstack
4.执行
./stack.sh
出现的问题
- pipy源链接失败解决方法:
(1)更换pip源
index-url = http://mirrors.aliyun.com/pypi/simple/ //阿里源
index-url = http://pypi.hustunique.com/ //华中理工大学
index-url = http://pypi.sdutlinux.org/ //山东理工大学
index-url = http://pypi.mirrors.ustc.edu.cn/ //中国科学技术大学
(2)手动安装
安装Devstack时提示pip源的问题,如:Download of get-pip.py failed,可以手动安装:
wget http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
wget https://github.com/pypa/pip/raw/master/contrib/get-pip.py
sudo python get-pip.py
然后在devstack/tools目录下,找到install_pip.py,注释掉install_get_pip这个函数调用,就OK了。再执行./stack.sh
注:pip是一个安装和管理Python包的工具,是easy_install的一个替换品。