啥也没写
分类: 系统运维
2014-09-10 16:10:16
安装相应软件包
sudo apt-get install -y git python-dev sqlite3 libxml2-dev libxslt1-dev libsasl2-dev libsqlite3-dev libssl-dev libldap2-dev python-setuptools python-pip
安装MYSQL
sudo apt-get install mysql-server mysql-client python-mysqldb
sudo mysql -u root -p
mysql>create database keystone;
mysql>grant all on keystone.* to identified by '123456';
sudo sed -i 's#127.0.0.1#0.0.0.0#g' /etc/mysql/my.cnf
sudo /etc/init.d/mysql restart
克隆keystone库
git clone
git clone keystone/client
cd keystone
git branch -a
git checkout -b icehouse origin/stable/icehouse
安装keystone
cd keystone
sudo pip install -e .
或者
sudo python setup.py install
keystone配置:
sudo mkdir -p /etc/keystone
sudo cp etc/* /etc/keystone/
sudo mv /etc/keystone/keystone.conf.sample /etc/keystone/keystone.conf
vi /etc/keystone/keystone.conf
#admin_token=ADMIN
admin_token=ADMIN
public_endpoint=%(public_port)s/
admin_endpoint=%(admin_port)s/
#connection=
connection=mysql://keystone:123456@localhost/keystone?charset=utf8
日志:
sudo mkdir -p /var/log/keystone
sudo touch /var/log/keystone/keystone.log
同步数据库:
keystone-manage db_sync
echo $?
0
创建kestone账户及SSL证书
sudo useradd keystone
sudo chown -R keystone.keystone /etc/keystone/
sudo keystone-manage pki_setup --keystone-user=keystone --keystone-group=keystone
启动服务:
keystone-all -d &
配置keytone:
变量环境
export OS_SERVICE_TOKEN=ADMIN
export SERVICE_ENDPOINT=
创建租户
keystone tenant-create --name adminTenant --description "Admin Tenant" --enabled true
创建用户(需要记录租户的ID)
keystone user-create --tenant_id a6db417389a44dbd9f6b87ca395d6e0c --name admin --pass 123456 --enabled true
keystone user-create --tenant_id a6db417389a44dbd9f6b87ca395d6e0c --name demo --pass 123456 --enabled true
创建role
keystone role-create --name adminRole
目录创建ID有:
Tenant ID: a6db417389a44dbd9f6b87ca395d6e0c [租户:adminTenant]
User ID: 069629bd4d824d2485713ceaf7809550 [用户:admin]
37252e21cc3b44afb67127a521e639a3 [用户:demo]
Role ID: c821698bee85437a9b5de2dd0dec7343 [ROLE:adminRole]
将用户admin加入到adminrole里面
keystone user-role-add --user-id 069629bd4d824d2485713ceaf7809550 --tenant-id a6db417389a44dbd9f6b87ca395d6e0c --role-id c821698bee85437a9b5de2dd0dec7343
通过以下两个命令简单测试:
keystone user-role-list --user admin --tenant adminTenant
keystone user-list