【问题标题】:Openstack-Keystone failing to startOpenstack-Keystone 无法启动
【发布时间】:2013-03-24 08:01:02
【问题描述】:

在过去的几天里,我几乎尝试了所有方法来让 keystone 运行无济于事。

设置都在同一台主机上,虚拟化和openstack和keystone都在同一台主机上,所以我尝试用127.0.0.1和localhost和主机的IP设置keystone,但没有运气

[DEFAULT] log_file = /var/log/keystone/keystone.log 
admin_token = *** 
bind_host = 192.168.33.11 
public_port = 5000 
admin_port = 35357 
compute_port = 8774

# === Logging Options ===
# Print debugging output verbose = True

# Print more verbose output
# (includes plaintext request logging, potentially including passwords)
# debug = False

# 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] connection = mysql://keystone:***@localhost/keystone
# idle_timeout = 200

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

[catalog] template_file = /etc/keystone/default_catalog.templates driver = keystone.catalog.backends.sql.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.sql.Token
# driver = keystone.token.backends.kvs.Token

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

我已在 logging.conf 文件中启用日志记录并将级别设置为 DEBUG 和 INFO,但日志文件中没有任何内容。

[root@* keystone]# service openstack-keystone restart
Stopping keystone:                                         [FAILED]
Starting keystone:                                         [  OK  ]
[root@* keystone]# service openstack-keystone restart
Stopping keystone:                                         [FAILED]
Starting keystone:                                         [  OK  ]
[root@* keystone]# ps aux | grep keystone
root     25580  0.0  0.0 103236   880 pts/1    S+   09:41   0:00 grep keystone
[root@* keystone]#

任何想法将不胜感激。谢谢

【问题讨论】:

  • 我一直看到像 [DEFAULT] 这样的部分标签在自己的一行上。

标签: openstack keystone


【解决方案1】:

正如我在评论中提到的,我从未见过一个配置文件的部分标题与配置选项位于同一行:

[DEFAULT] log_file = /var/log/keystone/keystone.log 

我也见过这样的:

[DEFAULT]
log_file = /var/log/keystone/keystone.log 

但是,我不知道这是否与您的问题有关。

要启用调试级日志记录,请确保在 /etc/keystone/logging.conf 中设置以下内容:

[logger_root]
level=DEBUG

然后尝试手动运行 keystone 而不是作为服务运行:

$ sudo -u keystone bash
$ HOME=/var/lib/keystone keystone-all --debug

希望您会在标准输出上看到相关的错误消息。

(我相信它仍然会将日志记录发送到 /var/log/keystone/keystone.log,不确定如何在像这样手动运行时真正让它记录到标准输出)。

【讨论】:

  • 洛林您好,感谢您的回复。我创建帖子时格式已关闭,这就是为什么会这样。所以我设法按照您的建议启动它并且它正在工作,但是我不明白为什么它没有作为服务启动,也许我会检查启动它的脚本或者修改它们,但这不是一个很好的启动方式就是这样。再次感谢您的帮助
  • 我可以让它按照您建议的方式工作(作为用户基石)也像这样:runuser -s /bin/sh keystone -c "/usr/bin/keystone-all --debug" 但它无法作为服务运行!
  • 不知何故现在它在作为服务运行时也在日志文件中显示错误:keystone ConfigFileNotFound。顺便说一句,这是在 F21 上。
  • 现在,os.path.exists(paste_config) 似乎返回 false,即使它确实存在(我将其打印到日志中)
  • 我想我发现了错误,文件在/usr/share/keystone/keystone-dist-paste.ini 中,这也是keystone.conf 所拥有的,但是服务无法访问此位置,因此它认为该文件不存在,将.ini 文件复制到/etc/keystone 并更正chown 现在服务运行。如果其他人遇到同样的错误,这将是一个答案。
【解决方案2】:
  1. 为 admin_token 添加一个有效的令牌。它不应该是“*”。

  2. 检查以下行: [sql] 连接 = mysql://keystone:*@localhost/keystone 它应该是这样的: 连接 = mysql://keystone:keystone@localhost/keystone

  3. 请参阅此 URL 以获取示例 keystone.conf 文件 http://docs.openstack.org/trunk/openstack-compute/install/yum/content/keystone-conf-file.html

【讨论】:

  • 您好 Vigay,我在发布问题时已编辑掉所有敏感信息。根据我之前的回复,我似乎让它运行起来了,唯一剩下的就是能够将它作为服务运行
【解决方案3】:

我也遇到了这个问题。我在 Ubuntu 12.04LTS 上运行。我发现/etc/init/keystone.conf 中的服务启动命令正在使用 start-stop-daemon 来运行服务。它是为比我盒子上的版本更新的版本编写的。 --chdir 变量不被接受为输入。一旦我删除该行梯形石立即启动。

尝试运行:

start-stop-daemon --start --chuid keystone --name keystone --exec /usr/bin/keystone-all

/etc/init/keystone.conf  after

description "Keystone API server"
author "Soren Hansen <soren@linux2go.dk>"

start on runlevel [2345]
stop on runlevel [!2345]

respawn

exec start-stop-daemon --start --chuid keystone \
            --name keystone \
            --exec /usr/bin/keystone-all

【讨论】:

    【解决方案4】:

    检查你的IP地址是否等于localrc中的HOST_IP=...

    【讨论】:

      【解决方案5】:

      这可能是由于 keystone 未正确启动,因此端口 35357 未处于侦听模式。 这似乎是服务基石的异常行为。 我提到了在我的系统上用于在 Ubuntu 12.04 内核版本 3.2.0-67-generic 上安装哈瓦那的步骤。围绕这个问题头疼了一天。尝试这些步骤,最好按照相同的顺序。

      1) 移除 keystone 包:-

        apt-get remove  keystone 
      

      2) 重启系统

       reboot 
      

      3) 重新启动后再次安装 KEYSTONE。

      apt-get install keystone
      

      4) 检查keystone服务状态

       service keystone status
      

      它将显示启动/运行

      5) 现在在 /etc/keystone/keystone.conf 中进行必要的更改

      更改 conf 文件后请勿重启 KeySTONE SERVICE

      使用 stop 和 start 命令产生重启的效果,但不重启。

      服务基石停止

      服务基石启动

      如需进一步帮助,请粘贴我的 CLI 转储:-

      http://pastebin.com/sduuFCL7

      【讨论】:

        【解决方案6】:

        icehouse 文档和安装存在多个问题。 packstack 已损坏,因此开始的唯一方法是手动关注 upstream docs for your distro。 keystone 在继续之前首先正确设置非常重要,因为其他服务依赖它。

        1. 粘贴文件 /usr/share/keystone/keystone-dist-paste.ini 应复制到 /etc/ 以便配置脚本可以访问,如下所示:

          cp /usr/share/keystone/keystone-dist-paste.ini /etc/keystone/
          chown keystone:keystone /etc/keystone/*
          

          确保使用新的 config_file 值更新 keystone.conf

        2. 关于mysql 连接的文档有误,它应该转到[sql] 而不是[database] 所以:

          openstack-config --set /etc/keystone/keystone.conf    sql connection mysql://keystone:PASSWD@controller/keystone
          
        3. 名称controller 应该解析为mysql 绑定的任何名称,如果/etc/my.cnf 中的[mysqld]/bind-address 是10.1.1.100,我会将其添加到/etc/hosts 中:

          10.1.1.100  controller
          
        4. 确保在 keystone.conf 中取消注释 log_file 以了解正在发生的事情。

        【讨论】:

          【解决方案7】:

          我遇到了类似的问题。我按照下面提到的步骤操作并启动了 openstack-keystone 服务。

          编辑 /etc/keystone/keystone.conf 文件并完成以下操作:

          1. 在 [DEFAULT] 部分中

            [DEFAULT]
            
            admin_token = ADMIN_TOKEN
            
          2. 在 [数据库] 部分中

            [database]
            connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone
            
          3. 在 [token] 部分,配置 UUID 令牌提供程序和 SQL 驱动程序

            [token]
            provider = keystone.token.providers.uuid.Provider
            driver = keystone.token.persistence.backends.sql.Token
            
          4. 在[撤销]部分

            [revoke]
            driver = keystone.contrib.revoke.backends.sql.Revoke
            

          进行上述更改后,使用命令填充身份服务数据库

          su -s /bin/sh -c "keystone-manage db_sync" keystone
          

          使用以下命令启动 openstack-keystone 服务

          systemctl start openstack-keystone
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2016-08-24
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多