关闭

CentOS6.2下源码安装openStack keystone

标签: centosservicemysqlpython数据库database
4132人阅读 评论(9) 收藏 举报
分类:

参考文档:

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

http://keystone.openstack.org/installing.html

http://keystone.openstack.org/configuration.html

http://docs.openstack.org/trunk/openstack-compute/install/content/ch_installing-openstack-identity-service.html


1.将当前用户ugyn添加到sudo:

su
echo 'ugyn ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
su ugyn

2.安装epel:
sudo rpm -i http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

3.安装git:
sudo yum install git

4.安装setuptools:
sudo yum install python-setuptools

5.安装pip:
下载pip: http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#md5=62a9f08dd5dc69d76734568a6c040508
解压:tar zxpf pip-1.1.tar.gz
安装:cd pip-1.1 && sudo python setup.py install

6.获取最新的keystone代码:
cd
git clone https://github.com/openstack/keystone.git

7.安装依赖:
先安装pip依赖:sudo yum install python-sqlite2 python-lxml python-greenlet-devel python-ldap
sudo pip install -r keystone/tools/pip-requires

8.安装keystone:
cd keystone && sudo python setup.py install

9.配置keystone:
拷贝默认配置文件:sudo cp -R etc /etc/keystone
修改/etc/keystone/keystone.conf的数据库连接为mysql: connection = mysql://user:password@10.10.10.138/database
sudo vim /etc/keystone/keystone.conf

10.设置mysql:
修改/etc/my.cnf
在[mysqld]下添加:(理由见这里
default_table_type=InnoDB
character-set-server=utf8
init_connect='SET NAMES utf8'
使mysql开机自动运行:sudo chkconfig mysqld on
重启动mysqld:sudo service mysqld restart
登录mysql创建所需数据库及用户:
create database keystone;
grant all privileges on keystone.* to 'keystone'@'%' identified by 'keystone';

11.初始化数据库:
keystone-manage db_sync

12.安装keystorn客户端:
cd
git clone https://github.com/openstack/python-keystoneclient.git
sudo pip install -r python-keystoneclient/tools/pip-requires
cd python-keystoneclient && sudo python setup.py install

13.启动keystone:
keystone-all

14.创建初始tenants、users、roles、services、endpoints:
修改keystone/tools/sample_data.sh,在文件开头添加以下内容:

#设置管理密码:
ADMIN_PASSWORD=youradminpassword
#设置服务密码:
SERVICE_PASSWORD=yourservicepassword
#要创建endpoint,请添加:
ENABLE_ENDPOINTS=true
#要创建与swif相关的user,service:
ENABLE_SWIFT=true
#要创建与quantum相关的user,service,添加:
ENABLE_QUANTUM=true

运行脚本:
cd
sudo keystone/tools/sample_data.sh



15.测试:
keystone tenant-list
keystone user-list
keystone service-list
keystone role-list

keystone endpoint-list


16.测试结果:



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:176688次
    • 积分:2316
    • 等级:
    • 排名:第16196名
    • 原创:45篇
    • 转载:7篇
    • 译文:0篇
    • 评论:166条
    最新评论