0. 导入第三方软件源
#sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm (此文件根据情况, 可能是6-5或者其它,自行上网查看)
#sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
#sudo iptables -F ( 清空防火墙 )
#sudo service iptables stop (首先关闭防火墙,待安装成功后再打开防火墙)
#sudo setenforce 0
#sudo vim /etc/selinux/config (禁用selinux,避免安装出问题无法查找)
SELINUX=disabled
#sudo reboot (重启系统)
1. 安装 OpenStack Identity Service - Keystone
0) 依赖包安装
#sudo yum install mysql mysql-server MySQL-python
#sudo chkconfig --level 35 mysqld on
#sudo service mysqld start
#mysql -u root -p
mysql>create database keystone DEFAULT CHARACTER SET utf8;
mysql>GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
mysql>GRANT ALL ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
mysql>flush privileges;
mysql>use mysql;
mysql>select Host,User,Password from user;
mysql>select Host,Db,User from db;
mysql>exit
1) 安装keyston
i)自动安装
#sudo yum install openstack-utils openstack-keystone python-keystoneclient
#sudo vim /etc/keystone/keystone.conf
设置connection如下:
connection = mysql://keystone:密码@localhost/keystone
设置admin-token如下:
admin_token = 012345SECRET99TOKEN012345
#sudo chkconfig --level 35 openstack-keystone on
#sudo service openstack-keystone restart
#sudo keystone-manage db_sync //同步数据库
ii)源代码安装:
下载:https://launchpad.net/keystone/
#tar xzf keystone-2013.1~g1.tar.gz
#sudo python setup.py
2) 配置用户等
命令安装或者直接使用脚本sample_data.sh (openstack官方网站下载https://github.com/openstack/keystone/blob/master/tools/sample_data.sh, 或者见附件)
(然后自行修改sample_data的内容为自己需要的)
#sudo bash sample_data.sh
(脚本可根据需要自行修改, 这里修改的用户名密码都一样: admin/admin, glance/glance, nova/nova,swift/swift, quantum/quantum)
(下面是手动操作)
#export SERVICE_TOKEN=012345SECRET99TOKEN012345 (keystone.conf配置文件中的admin_token)#export SERVICE_ENDPOINT=http://172.16.10.2:35357/v2.0 (keystone.conf配置文件中绑定的IP地址)
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 tenant-create --name openstackDemo --description "Default Tenant"
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-create --tenant-id [上一步得到的tenant_id] --name admin --pass admin
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 role-create --name admin
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 role-create --name memberRole
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-role-add --user-id 2940224f37ee4b468380e9ca3fe9af4e --tenant-id 051a021b97c64bafb2f09c3df1d614a1 --role-id 32b11b2085464c279a54624a6127c9ab
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 tenant-create --name service --description "Service Tenant"
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-create --tenant-id a596b427e88e49a78704eb4fa2be02d3 --name glance --pass glance
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-role-add --user-id ba98713f1b4e43a6b13a39b2e4c803db --tenant-id a596b427e88e49a78704eb4fa2be02d3 --role-id 32b11b2085464c279a54624a6127c9ab
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-create --tenant-id a596b427e88e49a78704eb4fa2be02d3 --name nova --pass nova
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-role-add --user-id c38644e3083a4d8481f42a48486ac75e --tenant-id a596b427e88e49a78704eb4fa2be02d3 --role-id 32b11b2085464c279a54624a6127c9ab
#keystone --token 012345SECRET99TOKEN012345 --endpoint http://172.16.10.2:35357/v2.0 user-create --tenant-id a596b427e88e49a78704eb4fa2be02d3 --name ec2 --pass ec2
#keyston