node1主机执行
1.mysql -u root -p
2.create database keystone; 创建数据库
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| keystone |
| mysql |
| performance_schema |
+--------------------+
3. GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost'
-> IDENTIFIED BY 'KEYSTONE_DBPASS'; 本地登录
4.GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'
-> IDENTIFIED BY 'KEYSTONE_DBPASS'; 远程登录
拓展内容 远程尝试登录一下数据库
cd /etc/yum.repos.d/
ls
vim cdrom.repo 创建本地源
[peng]
name=peng
gpgcheck=0
enabled=1
baseurl=file:///mnt
mount /dev/sr0 /mnt 有光盘然后挂载
yum clean all
yum makecache
其他终端首先下载mariadb
yum install mariadb -y
keystone启动 需要启动http 是http中的一个模块
5.yum install openstack-keystone httpd mod_wsgi -y
修改配置文件
6 cd /etc/keystone
ls
[root@node1 ~]# cd /etc/keystone
[root@node1 keystone]# ls
default_catalog.templates keystone.conf keystone-paste.ini logging.conf policy.json sso_callback_template.html
copy keystone.conf keystone.beifen 做一个备份 然后编辑 防止修改错误
[root@node1 keystone]# ll 查看具体权限 属主 属组信息
总用量 260
-rw-r----- 1 root keystone 2303 7月 27 2018 default_catalog.templates
-rw-r----- 1 root root 117987 8月 1 18:42 keystone.beifen
-rw-r----- 1 root keystone 117987 8月 1 18:45 keystone.conf
-rw-r----- 1 root keystone 2759 7月 27 2018 keystone-paste.ini
-rw-r----- 1 root keystone 1046 7月 27 2018 logging.conf
-rw-r----- 1 keystone keystone 9821 7月 27 2018 policy.json
-rw-r----- 1 keystone keystone 665 7月 27 2018 sso_callback_template.html
7 vim keystone.conf
删除原来的文件内容 复制下面的内容 配置内容参考本页最下面的内容
keystone需要连接数据库 在哪台机器登录 登录到哪个库
[database]
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@node1/keystone 需要修改成node1
8.mysql -uroot -p123 keystone数据库里面的表没有内容 需要导入表
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| keystone |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> use keystone
Database changed
MariaDB [keystone]> show tables;
Empty set (0.00 sec)
9. keystone数据库里面的表内容为空 导入表内容
[root@node1 ~]# cd /etc/keystone
[root@node1 keystone]# ls
default_catalog.templates keystone.conf logging.conf sso_callback_template.html
keystone.beifen keystone-paste.ini policy.json
[root@node1 keystone]# su -s /bin/sh -c "keystone-manage db_sync" keystone
[root@node1 keystone]# 在keystone导入表
su -s /bin/sh -c "keystone-manage db_sync" keystone
10. [root@node1 keystone]#
建立keystone用户和组
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
身份信息的认证
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
11.
[root@node1 keystone]#
keystone-manage bootstrap --bootstrap-password ADMIN_PASS 设置密码 --bootstrap-admin-url http://node1:35357/v3/ --bootstrap-internal-url http://node1:5000/v3/ --bootstrap-public-url http://node1:5000/v3/ 公共端点服务地址 --bootstrap-region-id RegionOne
12 vim /etc/httpd/conf/httpd.conf
13.ServerName controller 改成 ServerName node1
14.
cd etc/httpd/conf.d/
ls
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
什么也没有
[root@node1 conf.d]# ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
[root@node1 conf.d]# ls
autoindex.conf cobbler.conf README userdir.conf welcome.conf wsgi-keystone.conf
15. systemctl start httpd.service 启动keystone
systemctl enable httpd.service
systemctl status httpd.service
第一台机器安装完毕keystone
16.[root@node1 ~]# cd
[root@node1 ~]#
vim openrc export OS_USERNAME=admin 宣 告 变量名字 系统用户 export OS_PASSWORD=ADMIN_PASS 密码 export OS_PROJECT_NAME=admin 工作项目 export OS_USER_DOMAIN_NAME=Default 用户工作的域xport OS_PROJECT_DOMAIN_NAME=Default export OS_AUTH_URL=http://node1:35357/v3 认证地址 export OS_IDENTITY_API_VERSION=3 认证ipa版本
17 source openrc 宣告变量
相当于输完账户 密码 点击链接的步骤
8.openstack user list 查看openstack 环境 用户列表
19 openstack project list 查看项目列表
20 openstack user create class 创建openstack用户
21 openstack user delete class 删除用户
22 openstack role list 角色列表
23 openstack role create user 创建一个user的角色
24 openstack role add --project demo --user demo user 创建一个用户
eg : openstack role add --project admin --user yunwei admin
(在admin的项目中 创建一个yunwei用户的admin的角色)
25 创建项目
- 1. 创建一个demo的用户 密码设置为prompt 域设置为 default openstack user create --domain default --password=demo demo
- 2. 创建一个demo的项目 域设置为 default openstack project create --domain default --description "Demo Project" demo openstack project create --domain default --description "Service Project" service +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Service Project | | domain_id | default | | enabled | True | | id | 24ac7f19cd944f4cba1d77469b2a73ed | | is_domain | False | | name | service | | parent_id | default | +-------------+----------------------------------+