2016년 5월 13일 금요일

CentOS 6.x Openstack Swift install

CentOS 6.x Openstack Swift install


yum -y install python-devel python-setuptools python-pip
pip install --upgrade setuptools pip
pip install python-swiftclient
pip install python-keystoneclient


[root@virtualbox ~]# swift stat
Traceback (most recent call last):
  File "/usr/bin/swift", line 7, in <module>
    from swiftclient.shell import main
  File "/usr/lib/python2.6/site-packages/swiftclient/__init__.py", line 20, in <module>
    from .client import *  # noqa
  File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 136
    return {key: safe_value(key, val) for (key, val) in headers}
                                        ^
SyntaxError: invalid syntax


에러발생가 발생한다.
yum 으로 설치된 python 버전은 2.6.6 이다.
2.7.11 버전으로 올려보자.


아래 과정을 하나씩 실행하면 된다.

wget --no-check-certificate -N http://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
tar zxvf Python-2.7.11.tgz
cd Python-2.7.11
./configure
make && make altinstall
mv /usr/bin/python /usr/bin/python_2.6.6
cp ./python /usr/bin/python
cd ..
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
tar zxvf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2
python setup.py install
easy_install pip
pip install python-swiftclient
pip install python-keystoneclient


설치가 완료되었다.

[root@virtualbox ~]# swift stat
Auth version 1.0 requires ST_AUTH, ST_USER, and ST_KEY environment variables
to be set or overridden with -A, -U, or -K.

Auth version 2.0 requires OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, and
OS_TENANT_NAME OS_TENANT_ID to be set or overridden with --os-auth-url,
--os-username, --os-password, --os-tenant-name or os-tenant-id. Note:
adding "-V 2" is necessary for this.

에러가 발생하지 않고 잘 된다.

CentOS 7.x 버전 Swift 설치는 여기를 http://blog.ivps.kr/54 참고하자.


위와 같이 강제로 python을 업그레이드 하게 되면 yum 이 실행되지 않는다.

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

다시 재설치 하는 방법은 http://blog.ivps.kr/222 여기를 참고하자.

댓글 없음:

댓글 쓰기