使用devstack的Cloudfoundry灰熊基石安装:keystone.conf中的configparser错误

时间:2013-07-16 15:49:55

标签: openstack configparser keystone devstack

我正在尝试在新的ubuntu 12.04服务器上安装opnstack grizzly。 sript运行fin,直到达到这一点:

screen -S stack -p key -X stuff 'cd /opt/stack/keystone &&  
/opt/stack/keystone/bin/keystone-all --config-file /etc/keystone/keystone.con' --log-  
config  
/etc/keystone/logging.conf -d --debug || touch "/opt/stack/status/stack/key.failure"
2013-07-16 17:33:03 + echo 'Waiting for keystone to start...'
2013-07-16 17:33:03 Waiting for keystone to start...
2013-07-16 17:33:03 + timeout 60 sh -c 'while ! http_proxy= curl -s   
http://192.168.20.69:5000/v2.0/ >/dev/null; do sleep 1; done'
2013-07-16 17:34:03 + die 311 'keystone did not start'
2013-07-16 17:34:03 + local exitcode=0
2013-07-16 17:34:03 + set +o xtrace
2013-07-16 17:34:03 [ERROR] ./stack.sh:311 keystone did not start

日志文件:

File "/opt/stack/keystone/bin/keystone-all", line 112, in <module>
options = deploy.appconfig('config:%s' % paste_config)
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 261, in appconfig
global_conf=global_conf)
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 413, in get_context
defaults = self.parser.defaults()
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 68, in defaults
defaults[key] = self.get('DEFAULT', key) or val
File "/usr/lib/python2.7/ConfigParser.py", line 623, in get
return self._interpolate(section, option, value, d)
File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 75, in _interpolate
self, section, option, rawval, vars)
File "/usr/lib/python2.7/ConfigParser.py", line 669, in _interpolate
option, section, rawval, e.args[0])
ConfigParser.InterpolationMissingOptionError: Error in file /etc/keystone/keystone.conf:   
Bad value substitution:
    section: [DEFAULT]
    option : admin_endpoint
    key    : admin_port
    rawval : http://192.168.20.69:%(admin_port)s/

解析指令:

https://github.com/openstack/keystone/blob/master/keystone/common/config.py

ConfigParser.InterpolationMissingOptionError:

当从值引用的选项不存在时引发异常。 InterpolationError的子类。

我实际上并不知道哪个选项不存在..

提前感谢您的帮助。

达明

6 个答案:

答案 0 :(得分:1)

运行stack.sh时遇到了同样的问题。运行stack.sh时的localrc文件是:

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
# enable_service q-lbass
disable_service mysql
enable_service postgresql
# enable_service swift
# SWIFT_HASH=devstack
#
LOGFILE=$DEST/logs/stack.log
SCREEN_LOGDIR=$DEST/logs/screens
#
SERVICE_TOKEN=devstack
SCHEDULER=nova.scheduler.chance.ChanceScheduler

# Repositories
GLANCE_BRANCK=stable/grizzly
HORIZON_BRANCH=stable/grizzly
KEYSTONE_BRANCH=stable/grizzly
NOVA_BRANCH=stable/grizzly
NEUTRON_BRANCH=stable/grizzly
CINDER_BRANCH=stable/grizzly
SWIFT_BRANCH=stable/grizzly
PBR_BRANCH=master
REQUIREMENTS_BRANCH=stable/grizzly
CEILOMETER_BRANCH=stable/grizzly
...

然而,在我删除了存储库定义之后,让stackrc中的默认值接管,即。所有分支都指向“主人”,问题就消失了。

此外,/ opt / stack / keystone / bin / keystone-all脚本的内容在stable / grizzly和master分支之间是不同的。我认为'master'分支中的那个似乎现在可以在中子启用的情况下工作。

答案 1 :(得分:0)

此错误是因为

  1. 以root身份运行此“stack.sh”
  2. 或者您忘记在/etc/keystone/keystone.conf

    中修改配置
    1. chmod 777 /etc/keystone/keystone.conf
    2. unstack.sh然后重新运行stack.sh

答案 2 :(得分:0)

只是简单地

visudo命令

将堆栈添加为root用户但不需要密码的用户

堆叠ALL =(ALL:ALL)ALL

su stack

cp -r / root / devstack / home / stack /

cd / home / stack / devstack /

./ stack.sh

必要时首先清理所有

答案 3 :(得分:0)

看起来像已经为keystone https://bugs.launchpad.net/keystone/+bug/1201861提交的错误,它仍然是开放的。

答案 4 :(得分:0)

修改devstack / lib / keystone,如下所示:

iniset $KEYSTONE_CONF DEFAULT public_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:35357/"
iniset $KEYSTONE_CONF DEFAULT admin_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/"

答案 5 :(得分:-1)

我自己就碰到了这个。问题是DevStack正在/etc/keystone/keystone.conf中构建Keystone配置文件,其中在设置之前使用选项“admin_port”。而且您不能只编辑keystone.conf并重新运行stack.sh,因为您编辑的版本将被覆盖。我仍然在追查那些使配置文件失效的代码......