Openstack Folsom KeyStone Install(版本日期2013.1)

Openstack Folsom KeyStone Install(版本日期2013.1)

使用non-root用户操作

1.将本地源更新到最新版本
[quote]sudo vi /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade[/quote]

2.下载pip,git工具
[quote]sudo apt-get install python-pip
sudo apt-get install git[/quote]

3.下载相关工具
[quote]sudo apt-get install python-dev libxml2-dev libxslt1-dev libsasl2-dev libsqlite3-dev libssl-dev libldap2-dev[/quote]

4.下载keystone最新源码
[quote]git clone https://github.com/openstack/keystone.git[/quote]

cd keystone/

5.根据需要安装依赖
# Install the dependencies for running keystone
[quote]sudo pip install -r tools/pip-requires[/quote]

# Install the dependencies for developing, testing, and running keystone
[quote]sudo pip install -r tools/test-requires[/quote]

6.安装keystone
# Use python setup.py to link Keystone into python's site-packages
[quote]sudo python setup.py develop[/quote]

7.修改配置文件
[quote]vi etc/keystone.conf [/quote]

我现在使用的配置
[b][DEFAULT]
# A "shared secret" between keystone and other openstack services
admin_token =Lee

# The IP address of the network interface to listen on
bind_host = 192.168.88.77

# The port number which the public service listens on
public_port = 5000

# The port number which the public admin listens on
admin_port = 35357

# The base endpoint URLs for keystone that are advertised to clients
# (NOTE: this does NOT affect how keystone listens for connections)
public_endpoint = http://192.168.88.77:5000/
admin_endpoint = http://192.168.88.77:35357/

# The port number which the OpenStack Compute service listens on
compute_port = 8774

# Path to your policy definition containing identity actions
# TODO(dolph): This config method will probably be deprecated during grizzly
policy_file = policy.json

# Rule to check if no matching policy definition is found
# FIXME(dolph): This should really be defined as [policy] default_rule
# policy_default_rule = admin_required

# Role for migrating membership relationships
# During a SQL upgrade, the following values will be used to create a new role
# that will replace records in the user_tenant_membership table with explicit
# role grants. After migration, the member_role_id will be used in the API
# add_user_to_project, and member_role_name will be ignored.
# member_role_id = 9fe2ff9ee4384b1894a90878d3e92bab
# member_role_name = _member_

# === Logging Options ===
# Print debugging output
# (includes plaintext request logging, potentially including passwords)
debug = true

# Print more verbose output
verbose = true

# Name of log file to output to. If not set, logging will go to stdout.
#log_file = keystone.log

# The directory to keep log files in (will be prepended to --logfile)
# log_dir = /var/log/keystone

# Use syslog for logging.
use_syslog = false

# syslog facility to receive log lines
# syslog_log_facility = LOG_USER

# If this option is specified, the logging configuration file specified is
# used and overrides any other logging options specified. Please see the
# Python logging module documentation for details on logging configuration
# files.
#log_config = logging.conf

# A logging.Formatter log message format string which may use any of the
# available logging.LogRecord attributes.
#log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s

# Format string for %(asctime)s in log records.
#log_date_format = %Y-%m-%d %H:%M:%S

# onready allows you to send a notification when the process is ready to serve
# For example, to have it notify using systemd, one could set shell command:
# onready = systemd-notify --ready
# or a module with notify() method:
onready = keystone.common.systemd

[sql]
# The SQLAlchemy connection string used to connect to the database
connection = sqlite:///keystone.db

# the timeout before idle sql connections are reaped
idle_timeout = 200

[identity]
driver = keystone.identity.backends.sql.Identity

# This references the domain to use for all Identity API v2 requests (which are
# not aware of domains). A domain with this ID will be created for you by
# keystone-manage db_sync in migration 008. The domain referenced by this ID
# cannot be deleted on the v3 API, to prevent accidentally breaking the v2 API.
# There is nothing special about this domain, other than the fact that it must
# exist to order to maintain support for your v2 clients.
#default_domain_id =default

[catalog]
# dynamic, sql-based backend (supports API/CLI-based management commands)
driver = keystone.catalog.backends.sql.Catalog

# static, file-based backend (does *NOT* support any management commands)
# driver = keystone.catalog.backends.templated.TemplatedCatalog

template_file = default_catalog.templates

[token]
driver = keystone.token.backends.kvs.Token

# Amount of time a token should remain valid (in seconds)
# expiration = 86400

[policy]
driver = keystone.policy.backends.sql.Policy

[ec2]
driver = keystone.contrib.ec2.backends.kvs.Ec2

[ssl]
#enable = True
#certfile = /etc/keystone/ssl/certs/keystone.pem
#keyfile = /etc/keystone/ssl/private/keystonekey.pem
#ca_certs = /etc/keystone/ssl/certs/ca.pem
#cert_required = True

[signing]
token_format = PKI
certfile = /etc/keystone/ssl/certs/signing_cert.pem
keyfile = /etc/keystone/ssl/private/signing_key.pem
ca_certs = /etc/keystone/ssl/certs/ca.pem
key_size = 1024
valid_days = 3650
ca_password = None

[ldap]
# url = ldap://localhost
# user = dc=Manager,dc=example,dc=com
# password = None
# suffix = cn=example,cn=com
# use_dumb_member = False
# allow_subtree_delete = False
# dumb_member = cn=dumb,dc=example,dc=com
# page_size = 0

# The LDAP scope for queries, this can be either 'one'
# (onelevel/singleLevel) or 'sub' (subtree/wholeSubtree)
# query_scope = one

# user_tree_dn = ou=Users,dc=example,dc=com
# user_filter =
# user_objectclass = inetOrgPerson
# user_domain_id_attribute = businessCategory
# user_id_attribute = cn
# user_name_attribute = sn
# user_mail_attribute = email
# user_pass_attribute = userPassword
# user_enabled_attribute = enabled
# user_enabled_mask = 0
# user_enabled_default = True
# user_attribute_ignore = tenant_id,tenants
# user_allow_create = True
# user_allow_update = True
# user_allow_delete = True
# user_enabled_emulation = False
# user_enabled_emulation_dn =

# tenant_tree_dn = ou=Groups,dc=example,dc=com
# tenant_filter =
# tenant_objectclass = groupOfNames
# tenant_domain_id_attribute = businessCategory
# tenant_id_attribute = cn
# tenant_member_attribute = member
# tenant_name_attribute = ou
# tenant_desc_attribute = desc
# tenant_enabled_attribute = enabled
# tenant_attribute_ignore =
# tenant_allow_create = True
# tenant_allow_update = True
# tenant_allow_delete = True
# tenant_enabled_emulation = False
# tenant_enabled_emulation_dn =

# role_tree_dn = ou=Roles,dc=example,dc=com
# role_filter =
# role_objectclass = organizationalRole
# role_id_attribute = cn
# role_name_attribute = ou
# role_member_attribute = roleOccupant
# role_attribute_ignore =
# role_allow_create = True
# role_allow_update = True
# role_allow_delete = True

# group_tree_dn =
# group_filter =
# group_objectclass = groupOfNames
# group_id_attribute = cn
# group_name_attribute = ou
# group_member_attribute = member
# group_desc_attribute = desc
# group_attribute_ignore =
# group_allow_create = True
# group_allow_update = True
# group_allow_delete = True

[auth]
methods = password,token
password = keystone.auth.plugins.password.Password
token = keystone.auth.plugins.token.Token

[filter:debug]
paste.filter_factory = keystone.common.wsgi:Debug.factory

[filter:token_auth]
paste.filter_factory = keystone.middleware:TokenAuthMiddleware.factory

[filter:admin_token_auth]
paste.filter_factory = keystone.middleware:AdminTokenAuthMiddleware.factory

[filter:xml_body]
paste.filter_factory = keystone.middleware:XmlBodyMiddleware.factory

[filter:json_body]
paste.filter_factory = keystone.middleware:JsonBodyMiddleware.factory

[filter:user_crud_extension]
paste.filter_factory = keystone.contrib.user_crud:CrudExtension.factory

[filter:crud_extension]
paste.filter_factory = keystone.contrib.admin_crud:CrudExtension.factory

[filter:ec2_extension]
paste.filter_factory = keystone.contrib.ec2:Ec2Extension.factory

[filter:s3_extension]
paste.filter_factory = keystone.contrib.s3:S3Extension.factory

[filter:url_normalize]
paste.filter_factory = keystone.middleware:NormalizingFilter.factory

[filter:sizelimit]
paste.filter_factory = keystone.middleware:RequestBodySizeLimiter.factory

[filter:stats_monitoring]
paste.filter_factory = keystone.contrib.stats:StatsMiddleware.factory

[filter:stats_reporting]
paste.filter_factory = keystone.contrib.stats:StatsExtension.factory

[filter:access_log]
paste.filter_factory = keystone.contrib.access:AccessLogMiddleware.factory

[app:public_service]
paste.app_factory = keystone.service:public_app_factory

[app:service_v3]
paste.app_factory = keystone.service:v3_app_factory

[app:admin_service]
paste.app_factory = keystone.service:admin_app_factory

[pipeline:public_api]
pipeline = access_log sizelimit stats_monitoring url_normalize token_auth admin_token_auth xml_body json_body debug ec2_extension user_crud_extension public_service

[pipeline:admin_api]
pipeline = access_log sizelimit stats_monitoring url_normalize token_auth admin_token_auth xml_body json_body debug stats_reporting ec2_extension s3_extension crud_extension admin_service

[pipeline:api_v3]
pipeline = access_log sizelimit stats_monitoring url_normalize token_auth admin_token_auth xml_body json_body debug stats_reporting ec2_extension s3_extension service_v3

[app:public_version_service]
paste.app_factory = keystone.service:public_version_app_factory

[app:admin_version_service]
paste.app_factory = keystone.service:admin_version_app_factory

[pipeline:public_version_api]
pipeline = access_log sizelimit stats_monitoring url_normalize xml_body public_version_service

[pipeline:admin_version_api]
pipeline = access_log sizelimit stats_monitoring url_normalize xml_body admin_version_service

[composite:main]
use = egg:Paste#urlmap
/v2.0 = public_api
/v3 = api_v3
/ = public_version_api

[composite:admin]
use = egg:Paste#urlmap
/v2.0 = admin_api
/v3 = api_v3
/ = admin_version_api[/b]

8.初始化并且同步数据库(命令在哪个目录执行,keystone.db就保存在哪里)
[quote]keystone-manage db_sync[/quote]

9.初始化证书到/etc/keystone/ssl
[quote]keystone-manage pki_setup[/quote]

10.启动服务([color=red][b]使用Root启动[/b][/color])
*****
使用non-root用户启动遇到测试请求后台会抛出异常:
Signing error: Unable to load certificate - ensure you've configured PKI with 'keystone-manage pki_setup'
前台会给出500的错误返回 Internal Server Error ,message : Unable to sign token
******
[quote]sudo su

keystone-all[/quote]

11.插入测试数据([color=red][b]使用non-root[/b][/color])测试
[quote]export SERVICE_TOKEN=Lee[/quote] [这里的Lee是keystone.conf设置的admin_token]
[quote]export SERVICE_ENDPOINT=http://192.168.88.77:35357/v2.0[/quote]

这里演示简单的数据:
(1)插入租户
[quote]keystone tenant-create --name boventech --description 'LiSi Tenant'[/quote]

+----------------------------------+-------------+---------+
| id | name | enabled |
+----------------------------------+-------------+---------+
| 90cef39a936b416c91054fc555f1a29d | boventech | True |
+----------------------------------+-------------+---------+

(2)插入权限
[quote]keystone role-create --name ADMIN[/quote]
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| id | bd7b8266304746a9b066310b3ba51fba |
| name | ADMIN |
+----------+----------------------------------+

(3)插入用户
[quote]keystone user-create --name lisi --tenant-id 90cef39a936b416c91054fc555f1a29d --pass lee --email si.li@boventech.com[/quote]
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | si.li@boventech.com |
| enabled | True |
| id | b7116f190d1145bd9faddf7513d1abe5 |
| name | lisi |
| tenantId | 90cef39a936b416c91054fc555f1a29d |
+----------+----------------------------------+

(4)插入服务
[quote]keystone service-create --name keystone --type identity --description 'Openstack Folsom KeyStone'[/quote]

+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Openstack Folsom KeyStone |
| id | d58dc871ca7d4773a834d462ba2bc09d |
| name | keystone |
| type | identity |
+-------------+----------------------------------+

(5)为用户附加权限
[quote]keystone user-role-add --user-id b7116f190d1145bd9faddf7513d1abe5 --role-id bd7b8266304746a9b066310b3ba51fba --tenant-id 90cef39a936b416c91054fc555f1a29d[/quote]
未提示错误就表示添加成功
也可以通过命令查询
[quote]keystone user-role-list --tenant-id 90cef39a936b416c91054fc555f1a29d --user-id b7116f190d1145bd9faddf7513d1abe5[/quote]

+----------------------------------+----------+----------------------------------+----------------------------------+
| id | name | user_id | tenant_id |
+----------------------------------+----------+----------------------------------+----------------------------------+
| 9fe2ff9ee4384b1894a90878d3e92bab | ADMIN | b7116f190d1145bd9faddf7513d1abe5 | 90cef39a936b416c91054fc555f1a29d |
+----------------------------------+----------+----------------------------------+----------------------------------+
(6)添加endpoint
[quote]keystone endpoint-create --region RegionOne --service-id d58dc871ca7d4773a834d462ba2bc09d --publicurl 'http://192.168.88.77:5000/v2.0' --adminurl 'http://192.168.88.77:35357/v2.0' --internalurl 'http://192.168.88.77:5000/v2.0'[/quote]
+----------------------------------+-----------+--------------------------------+--------------------------------+---------------------------------+----------------------------------+
| id | region | publicurl | internalurl | adminurl | service_id |
+----------------------------------+-----------+--------------------------------+--------------------------------+---------------------------------+----------------------------------+
| d0d11c518ba846bd9f2f8ff0bd9d8bb3 | RegionOne | http://192.168.88.77:5000/v2.0 | http://192.168.88.77:5000/v2.0 | http://192.168.88.77:35357/v2.0 | 8fa9dbaa448943d0802572dcceaa42b9 |
+----------------------------------+-----------+--------------------------------+--------------------------------+---------------------------------+----------------------------------+


查看所有插入信息
[quote]keystone tenant-list
keystone role-list
keystone user-list
keystone service-list
keystone user-role-list --tenant-id 90cef39a936b416c91054fc555f1a29d --user-id b7116f190d1145bd9faddf7513d1abe5
keystone endpoint-list[/quote]

12.测试
[quote]curl -d '{"auth": {"tenantName": "boventech", "passwordCredentials":{"username": "lisi", "password": "lee"}}}' -H "Content-type: application/json" http://192.168.88.77:35357/v2.0/tokens | python -mjson.tool[/quote]

这里就返回结果说一下:
情况:Unable to sign token,
出现原因:keystone-all 命令是由非root用户执行
[quote]% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 187 100 94 100 93 528 522 --:--:-- --:--:-- --:--:-- 556
{
"error": {
"code": 500,
"message": "Unable to sign token.",
"title": "Internal Server Error"
}
}[/quote]

正常显示:

[quote]% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2423 100 2330 100 93 11060 441 --:--:-- --:--:-- --:--:-- 11148
{
"access": {
"metadata": {
"is_admin": 0,
"roles": [
"9fe2ff9ee4384b1894a90878d3e92bab",
"395cc0aba7df43c1a45b58b9a07ab4b7" //新版keystone提供的默认角色_member_
]
},
"serviceCatalog": [
{
"endpoints": [
{
"adminURL": "http://192.168.88.77:35357/v2.0",
"id": "d0d11c518ba846bd9f2f8ff0bd9d8bb3",
"internalURL": "http://192.168.88.77:5000/v2.0",
"publicURL": "http://192.168.88.77:5000/v2.0",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "KeyStone",
"type": "identity"
}
],
"token": {
"expires": "2013-03-14T03:36:45Z",
"id": "MIIEbwYJKoZIhvcNAQcCoIIEYDCCBFwCAQExCTAHBgUrDgMCGjCCA0gGCSqGSIb3DQEHAaCCAzkEggM1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0wMy0xM1QwMzozNjo0Ni4wMTE0OTciLCAiZXhwaXJlcyI6ICIyMDEzLTAzLTE0VDAzOjM2OjQ1WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogImh1YXNoaSBkZSBjdW5jaHUiLCAiZW5hYmxlZCI6IHRydWUsICJpZCI6ICI5MGNlZjM5YTkzNmI0MTZjOTEwNTRmYzU1NWYxYTI5ZCIsICJuYW1lIjogImhzIn19LCAic2VydmljZUNhdGFsb2ciOiBbeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTkyLjE2OC44OC43NzozNTM1Ny92Mi4wIiwgInJlZ2lvbiI6ICJSZWdpb25PbmUiLCAiaW50ZXJuYWxVUkwiOiAiaHR0cDovLzE5Mi4xNjguODguNzc6NTAwMC92Mi4wIiwgImlkIjogImIwODhhNWEyZjg5NzQ5ZTliMDA5NzRjY2U2MmRlMmViIiwgInB1YmxpY1VSTCI6ICJodHRwOi8vMTkyLjE2OC44OC43Nzo1MDAwL3YyLjAifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiaWRlbnRpdHkiLCAibmFtZSI6ICJLZXlTdG9uZSJ9XSwgInVzZXIiOiB7InVzZXJuYW1lIjogImxlZSIsICJyb2xlc19saW5rcyI6IFtdLCAiaWQiOiAiNmYyYTc4NzNkZjA4NDAxMDljMGJjNTdkNzZlMTc2ZDgiLCAicm9sZXMiOiBbeyJuYW1lIjogIl9tZW1iZXJfIn0sIHsibmFtZSI6ICJBRE1JTiJ9XSwgIm5hbWUiOiAibGVlIn0sICJtZXRhZGF0YSI6IHsiaXNfYWRtaW4iOiAwLCAicm9sZXMiOiBbIjlmZTJmZjllZTQzODRiMTg5NGE5MDg3OGQzZTkyYmFiIiwgIjM5NWNjMGFiYTdkZjQzYzFhNDViNThiOWEwN2FiNGI3Il19fX0xgf8wgfwCAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECBMFVW5zZXQxDjAMBgNVBAcTBVVuc2V0MQ4wDAYDVQQKEwVVbnNldDEYMBYGA1UEAxMPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIGAa0XcVfa2wO1PhsK3J+VtFJHjS-xOg0LZSFJoKPCqmPR34DTngKglVp7UY-oR8IP83OtlhbULRh2ijOHBNQSfokWVWFiRkgqAcqZc7Kb13wfVewn9LrbRUubUmHUS6Vaycbu9XV27XRBs7xi2kSNfQf3wSikYCGOmJMKJk2FxwBQ=",
"issued_at": "2013-03-13T03:36:46.011497",
"tenant": {
"description": "LiSi Tenant",
"enabled": true,
"id": "90cef39a936b416c91054fc555f1a29d",
"name": "boventech"
}
},
"user": {
"id": "b7116f190d1145bd9faddf7513d1abe5",
"name": "lisi",
"roles": [
{
"name": "_member_"
},
{
"name": "ADMIN"
}
],
"roles_links": [],
"username": "lisi"
}
}
}[/quote]

13.单个keystone正常运行了,后续提供Folsom Swift与Folsom Keystone 结合


Openstack的相关参考资料(为自己mark一下):

[url]http://blog.chinaunix.net/uid-21335514-id-3497996.html[/url]

[url]http://blog.chinaunix.net/uid-22414998-id-3265685.html[/url]

[url]http://blog.youkuaiyun.com/ugyn109/article/details/8146687[/url]
内容概要:本文详细探讨了基于MATLAB/SIMULINK的多载波无线通信系统仿真及性能分析,重点研究了以OFDM为代表的多载波技术。文章首先介绍了OFDM的基本原理和系统组成,随后通过仿真平台分析了不同调制方式的抗干扰性能、信道估计算法对系统性能的影响以及同步技术的实现与分析。文中提供了详细的MATLAB代码实现,涵盖OFDM系统的基本仿真、信道估计算法比较、同步算法实现和不同调制方式的性能比较。此外,还讨论了信道特征、OFDM关键技术、信道估计、同步技术和系统级仿真架构,并提出了未来的改进方向,如深度学习增强、混合波形设计和硬件加速方案。; 适合人群:具备无线通信基础知识,尤其是对OFDM技术有一定了解的研究人员和技术人员;从事无线通信系统设计与开发的工程师;高校通信工程专业的高年级本科生和研究生。; 使用场景及目标:①理解OFDM系统的工作原理及其在多径信道环境下的性能表现;②掌握MATLAB/SIMULINK在无线通信系统仿真中的应用;③评估不同调制方式、信道估计算法和同步算法的优劣;④为实际OFDM系统的设计和优化提供理论依据和技术支持。; 其他说明:本文不仅提供了详细的理论分析,还附带了大量的MATLAB代码示例,便于读者动手实践。建议读者在学习过程中结合代码进行调试和实验,以加深对OFDM技术的理解。此外,文中还涉及了一些最新的研究方向和技术趋势,如AI增强和毫米波通信,为读者提供了更广阔的视野。
### 解决方案 当在 Ubuntu 系统中遇到 `openstack-keystone` 包或服务缺失的情况时,可能是由于以下原因造成的:软件源配置不当、包名称拼写错误、依赖项未满足或其他安装问题。以下是具体的分析和解决方案。 #### 1. 更新 APT 缓存并验证仓库配置 确保系统的 APT 缓存是最新的,并且启用了正确的 OpenStack 存储库。运行以下命令更新缓存: ```bash sudo apt update ``` 如果存储库未正确配置,则需要手动添加适合当前 Ubuntu 版本OpenStack 云存储库。例如,在 Ubuntu 20.04 上可以使用以下命令添加 Victoria 发行版的 PPA: ```bash sudo add-apt-repository cloud-archive:victoria sudo apt update ``` #### 2. 明确包名是否正确 有时开发者可能会误解实际的包命名约定。对于 Keystone 组件而言,其标准包名为 `openstack-keystone`。可以通过搜索功能确认是否存在此包: ```bash apt-cache search openstack-keystone ``` 如果返回为空集,则说明确实缺少对应条目;反之则可继续尝试安装它。 #### 3. 手动指定版本号进行强制安装 部分情况下,默认分支可能暂时移除了特定组件的支持状态。这时可以显式指明期望获取的具体版本编号来进行强行装载动作。比如下面的例子演示了如何下载并部署 Wallaby 版本系列中的身份管理模块: ```bash sudo apt install -t focal-updates/wallaby openstack-keystone ``` #### 4. 替代方法——利用 DevStack 自动化环境搭建工具 DevStack 是一种快速构建全功能 OpenStack 开发测试平台的有效途径之一。按照官方指南准备好基础镜像之后只需简单几步即可完成全部核心服务的一键式布署工作流程。 访问地址如下所示: https://docs.openstack.org/devstack/latest/ #### 5. 使用虚拟机模板预先打包好的映象文件加速实施进程 考虑到时间成本因素的影响,也可以考虑采用已经经过预优化调整完毕的标准 OVA/OVF 格式的 VMWare/VirtualBox 形态交付物作为起点素材来减少重复劳动量。这些资源通常可以在各大云计算厂商官网或者社区贡献者的个人主页上面免费获得分享链接。 --- ### 示例脚本:自动化检测与修复工具 为了帮助用户更方便地定位问题所在位置以及采取相应措施加以纠正改进起见特编写一段 shell 脚本来辅助完成这一目标: ```bash #!/bin/bash # Check if the repository is properly set up first. check_repo() { echo "Checking available repositories..." grep -q "^deb http.*cloud\.archive" /etc/apt/sources.list || ( read -p "Cloud archive repo seems absent, do you want me adding it?(Y/n)" yn; case $yn in [Nn]* ) exit ;; * ) sudo add-apt-repository cloud-archive:ussuri # Replace ussuri with your desired release name. sudo apt-get update;; esac ) } install_keystone(){ check=$(dpkg-query -l | awk '{print $2}'|grep ^openstack-keystone$) if [[ "$check" != "" ]];then echo "Package already exists." else sudo apt-get install -y openstack-keystone fi systemctl list-units --type=service | grep keystone > /dev/null 2>&1 ret=$? if test $ret -ne 0; then echo "Service still cannot be located after installation!" else echo "Installation succeeded! Starting service now.." sudo systemctl start openstack-keystone fi } main(){ check_repo install_keystone } main ``` --- ### 总结 综上所述,面对 Ubuntu 下找不到 `openstack-keystone` 的状况时,应当依次检查APT源设置准确性、核实具体包称呼无误与否、探索不同发行周期间的兼容性差异等方面着手解决问题。同时借助一些便捷实用的小程序能够显著提升效率降低复杂度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值