OpenStack 认证服务 KeyStone部署 (四)
?Keystone作用:
Keystone主要兩大功能用戶認證和服務目錄(相當于一個注冊中心)
- 用戶認證名詞介紹
User:用戶?
它是用一個數字代表使用openstack云服務的一個人、系統、或服務。身份驗證服務將會驗證傳入的由用戶聲明將調用的請求?
一個租戶可以有多個用戶?
一個用戶可以屬于一個或多個租戶?
用戶對租戶和操作權限由用戶在租戶中承擔的角色來決定。
Project:項目?
它是各個服務中的一些可以訪問的資源集合或者說叫資源組。它是一個容器,用于組織和隔離資源,或標識對象。
Token:令牌
Role:角色?
代表一組用戶可以訪問的資源權限,例如Nova中的虛擬機、Glance中的鏡像。
- 服務目錄兩大名詞介紹
Service:服務?
Service即服務,如Nova、Glance、Swift。根據前三個概念(User,Project和Role)一個服務可以確認當前用戶是否具有訪問其資源的權限。但是當一個user嘗試著訪問其租戶內的service時,他必須知道這個service是否存在以及如何訪問這個service。
Endpoint:端點?
Endpoint翻譯為“端點”,我們可以理解它是一個服務暴露出來的訪問點,如果需要訪問一個服務,則必須知道他的endpoint。Endpoint的每個URL都對應一個服務實例的訪問地址,并且具有public、orivate和admin這三種權限。pubic url可以完全被全局訪問,private url只能被局域網訪問,admin url被從常規的訪問中分離。
?
?
一) 安裝memcached緩存
1.1 安裝軟件包
yum install memcached python-memcached -y1.2 修改memcached配置
vim /etc/sysconfig/memcached OPTIONS="10.0.0.101"1.3.啟動服務
# systemctl enable memcached.service # systemctl start memcached.service?1.4 ?netstat -ntlp檢查服務端口是否存在
?
二)安裝keystone
2.1?安裝keystone軟件包
yum install openstack-keystone httpd mod_wsgi -y2.2 修改配置文件
vim /etc/keystone/keystone.conf 在[database]部分,配置數據庫訪問: [database] connection = mysql+pymysql://keystone:redhat@controller/keystone 在[token]部分,配置Fernet UUID令牌的提供者 提供令牌有四種方式[fernet|pkiz|pki|uuid]默認是uuid。[token] provider = fernet driver = memcache在[memcache]部分,配置memcache的連接地址和端口 [memcache] servers = 10.0.100.101:11211
?3.3 ?初始化數據庫
?su -s /bin/sh -c "keystone-manage db_sync" keystone?
自動找到keystone配置文件里的mysql連接,來幫我們創建數據庫中的表。
我們為什么要使用keystone用戶去同步數據庫呢?
因為同步數據庫會在/var/log/keystone目錄下去寫日志,如果使用root權限同步,當keystone用戶啟動服務時讀取這個日志文件,那么它將無法進行讀取(權限問題),會出現啟動錯誤的情況。
?檢查表是否創建成功
?mysql -uroot -predhat -e "use keystone;show tables;"?
提示:如果查看表的時候發現沒有,通過日志/var/log/keystone/keystone.log排查報錯信息。
?3.4 初始化Fernet keys
創建相關的證書
?# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone?
執行完命令之后會在/etc/keystone下生成fernet-keys目錄,它的權限是keystone里面存放這一些相關證書。
?
?3.5 引導服務標識
keystone-manage bootstrap --bootstrap-password redhat \ --bootstrap-admin-url http://controller:35357/v3/ \ --bootstrap-internal-url http://controller:35357/v3/ \ --bootstrap-public-url http://controller:5000/v3/ \ --bootstrap-region-id RegionOne?
?
三).apache配置
3.1 配置/etc/httpd/conf/httpd.conf文件,配置ServerName 選項為控制節點
vim /etc/httpd/conf/httpd.conf ServerName controller?
3.2?配置鏈接文件
?# ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/?
3.3?apache啟動并設置開機自啟動
# systemctl enable httpd.service # systemctl start httpd.service3.4 keytone排錯思路
查看日志 /var/log/keystone/keystone.log 是否有報錯信息
開啟debug模式
vim /etc/keystone/keystone.conf
[DEFAULT]
debug = true
?
轉載于:https://www.cnblogs.com/jimmy-xuli/p/8856404.html
總結
以上是生活随笔為你收集整理的OpenStack 认证服务 KeyStone部署 (四)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Redis的基本操作以及info命令
- 下一篇: 人民军队深入推进政治什么改革什么科技强军