一、keystone身份认证服务数据库安装
①创建keystone服务数据库
mysql -u root -p
创建数据库keystone
CREATE DATABASE keystone;
验证是否已经创建成功
show databases;
对``keystone``数据库授予恰当的权限:
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost'
IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'
IDENTIFIED BY 'KEYSTONE_DBPASS';
KEYSTONE_DBPASS 可以设置你自己的密码
二、keystone软件安装
①keystone软件安装
yum install openstack-keystone httpd mod_wsgi -y
②keystone配置修改
备份配置文件
cp -a /etc/keystone/keystone.conf{,.bak}
grep -Ev "^$|#" /etc/keystone/keystone.conf.bak > /etc/keystone/keystone.conf
修改配置
安装openstack-utils方便用命令修改配置文件不用VIM工具手动修改
yum install -y openstack-utils
openstack-config --set /etc/keystone/keystone.conf database connection mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
KEYSTONE_DBPASS为前面安装keystone数据库的密码
openstack-config --set /etc/keystone/keystone.conf token provider fernet
填充数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
创建keystone服务三个端点
keystone-manage bootstrap --bootstrap-password ADMIN_PASS
--bootstrap-admin-url http://controller:5000/v3/
--bootstrap-internal-url http://controller:5000/v3/
--bootstrap-public-url http://controller:5000/v3/
--bootstrap-region-id RegionOne
编辑``/etc/httpd/conf/httpd.conf`` 文件,配置``ServerName`` 选项为控制节点:
echo "ServerName controller" >> /etc/httpd/conf/httpd.conf
创建软链接
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
③设置Apache服务器开机自启及启动Apache服务器
systemctl enable httpd.service
systemctl start httpd.service
三、验证服务安装情况
①创建openstack环境变量脚本
cd ~ && touch admin_openrc.sh
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
ADMIN_PASS 为前面设置的密码
进入新建的环境变量
source admin_openrc.sh
查询前面创建的三个服务端点
openstack endpoint list
创建服务项目
openstack project create --domain default --description "Service Project" service
创建user用户
openstack role create user
验证服务端口
netstat -anp|grep 5000