Ubuntu 14.04 LTS 配置 Juno 版 Keystone
keystone配置概況
采用包安裝方式安裝的keystone,重要的文件結構有如下:
/etc/keystone/ - 包含keystone所有的配置信息
/var/log/keystone/ - 默認的日志輸出目錄
/usr/share/keystone/ - 包含初始化數據庫需要的腳本sample_data.sh
這里建議將系統的日志輸出、keystone的數據庫、初始化數據庫的腳本都配置到一個目錄下,比如:/home/keystone,這樣便于管理。
?
采用包安裝方式安裝的keystone配置文件在/etc/keystone目錄下,主要的配置文件包括:
-----------------------------------------------------------------------------------------------------
default_catalog.templates ?//目錄配置文件,標注openstack其他服務的網絡位置
ec2rc
keystone.conf.dpkg-dist //主配置文件模板
keystone.conf ? ?//keystone主配置文件
keystone-paste.ini.dpkg-dist ?//PasteDeploy配置文件模板
keystone-paste.ini ?//PasteDeploy配置文件
logging.conf.sample //日志配置文件模板
policy.json //權限管理文件
ssl/ ? ? //用來建立PKI的目錄
------------------------------------------------------------------------------------------------------
keystone主要的配置文件介紹
keystone的配置文件是基于Paste的ini格式的通用Python WSGI配置應用,其中主要有,
1. keystone-paste.ini
是PasteDeploy的配置入口點,在本文件中配置WSGI pipeline和filter等信
2. keystone.conf
這是keystone最主要的配置文件,內容包括通用的配置參數和具體針對不同驅動的配置參數
?該文件的結構如下:
- [DEFAULT]?- General configuration
- [assignment]?- Assignment system driver configuration
- [auth]?- Authentication plugin configuration
- [cache]?- Caching layer configuration
- [catalog]?- Service catalog driver configuration
- [credential]?- Credential system driver configuration
- [endpoint_filter]?- Endpoint filtering extension configuration
- [endpoint_policy]?- Endpoint policy extension configuration
- [federation]?- Federation driver configuration
- [identity]?- Identity system driver configuration
- [identity_mapping]?- Identity mapping system driver configuration
- [kvs]?- KVS storage backend configuration
- [ldap]?- LDAP configuration options
- [memcache]?- Memcache configuration options
- [oauth1]?- OAuth 1.0a system driver configuration
- [os_inherit]?- Inherited role assignment extension
- [paste_deploy]?- Pointer to the PasteDeploy configuration file
- [policy]?- Policy system driver configuration for RBAC
- [revoke]?- Revocation system driver configuration
- [saml]?- SAML configuration options
- [signing]?- Cryptographic signatures for PKI based tokens
- [ssl]?- SSL configuration
- [token]?- Token driver & token provider configuration
- [trust]?- Trust extension configuration
--------------------------------------------------------------------------------------------------------
正常運行keystone需要的部分配置與操作
?
#鎖定keystone端口,keystone使用在IANA注冊的35357端口,為了避免沖突,可以將該端口從臨時端口范圍中排除(可選)
$ sudo sysctl -w 'net.ipv4.ip_local_reserved_ports=35357'?#或者在/etc/sysctl.conf文件中添加相同的信息(可選)
$ sudo vim /etc/sysctl.conf#在打開的文末添加
net.ipv4.ip_local_reserved_ports = 35357#將配置目錄劃歸給當前用戶,使其啟動keystone時擁有讀取配置文件的權限
$ sudo chown -R darren:darren /etc/keystone#配置keystone
$ vim /etc/keystone/keystone.conf#取消這些字段前面的注釋,激活默認配置
[DEFAULT] admin_token=YOUR_ADMIN_TOKEN public_bind_host=0.0.0.0 admin_bind_host=0.0.0.0 compute_port=8774 admin_port=35357 public_port=5000 public_endpoint=http://localhost:5000/ admin_endpoint=http://localhost:35357/ log_config_append=/etc/keystone/logging.conf policy_file=policy.json[auth] methods=external,password,token password=keystone.auth.plugins.password.Password token=keystone.auth.plugins.token.Token external=keystone.auth.plugins.external.DefaultDomain[catalog] template_file=default_catalog.templates driver=keystone.catalog.backends.sql.Catalog[credential] driver=keystone.credential.backends.sql.Credential[database] #connection = sqlite:////var/lib/keystone/keystone.db #格式 connection = mysql://USER:PASSWORD@HOST:PORT/DATABASE connection = mysql://keystone:KEYSTONE_PASS@127.0.0.1:3306/keystone [identity] driver=keystone.identity.backends.sql.Identity[paste_deploy] config_file=keystone-paste.ini[signing] certfile=/etc/keystone/ssl/certs/signing_cert.pem keyfile=/etc/keystone/ssl/private/signing_key.pem ca_certs=/etc/keystone/ssl/certs/ca.pem ca_key=/etc/keystone/ssl/private/cakey.pem[token] driver=keystone.token.backends.sql.Token#后臺重啟keystone服務
$ keystone-all &?#初始化keystone數據庫,創建keystone數據庫中的各個數據表
$ keystone-manage db_sync?#將管理認證信息設置成系統變量,添加到.bashrc文件的末尾
cd cat >> .bashrc export OS_SERVICE_TOKEN=darren export OS_SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0 ctrl-D#初始化keystone數據,將相應的數據寫入已經創建好的數據庫
$ /usr/share/keystone/sample_data.sh至此為止已經完成keystone的初始化,以后可以利用keystone-all命令來啟動keystone服務器和Identity API,用keystone-manage來實現一些線上不能完成的操作,用keystone CLI來與keystone服務器完成各種交互了。
查看主配置文件keystone.conf的全面詳細解讀,參考《Juno版keystone配置完全詳解》
查看剛剛建立的數據庫中新建了哪些數據表,參考《Juno版Keystone數據庫結構》。
轉載于:https://www.cnblogs.com/Security-Darren/p/3834802.html
超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術人生總結
以上是生活随笔為你收集整理的Ubuntu 14.04 LTS 配置 Juno 版 Keystone的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android自动测试之MonkeyRu
- 下一篇: WinForm中的各种对话框