下载新版本并备份相关文件及数据
前面已经比较过Keystone在E版和F版中的一些差异,现在该是升级的时候了。原Keystone的Essex版本是在CentOS6.2下通过源代码安装的,后面在epel的rpm安装包找了个init脚本,使得Keystone能通过service管理并在开机时自动运行,因此这里仍然通过源代码进行升级。以防万一,首先要备份相关旧版的文件、数据,要备份的文件主要包括/usr/bin下的三个文件,/etc/keystone下的所有配置文件以及数据库keystone,命令如下所示:
[root@stackcc update_keystone]# wget https://launchpad.net/keystone/folsom/2012.2/+download/keystone-2012.2.tar.gz
[root@stackcc update_keystone]# mkdir -p backup/bin
[root@stackcc update_keystone]# cp /usr/bin/keystone* backup/bin/
[root@stackcc update_keystone]# mkdir backup/etc
[root@stackcc update_keystone]# cp /etc/keystone/* backup/etc/
[root@stackcc update_keystone]# mysqldump -ukeystone -p keystone > backup/keystone.sql
停止Keystone服务并安装F版Keystone
[root@stackcc update_keystone]# service keystone stop
[root@stackcc update_keystone]# tar -zxf keystone-2012.2.tar.gz
[root@stackcc update_keystone]# cd keystone-2012.2
[root@stackcc keystone-2012.2]# python setup.py install > keystone.info
配置F版Keystone
主要修改了admin_token、log选项、sql选项、token和ec2选项,如下所示:
[root@stackcc keystone-2012.2]# rm -fr /etc/keystone/*
[root@stackcc keystone-2012.2]# cp etc/* /etc/keystone/
[root@stackcc keystone-2012.2]# ll /etc/keystone/
total 20
-rw-r--r-- 1 root root 1539 Nov 4 19:42 default_catalog.templates
-rw-r--r-- 1 root root 5753 Nov 4 19:42 keystone.conf.sample
-rw-r--r-- 1 root root 758 Nov 4 19:42 logging.conf.sample
-rw-r--r-- 1 root root 59 Nov 4 19:42 policy.json
[root@stackcc keystone-2012.2]# mv /etc/keystone/keystone.conf.sample /etc/keystone/keystone.conf
[root@stackcc keystone-2012.2]# mv /etc/keystone/logging.conf.sample /etc/keystone/logging.conf
[root@stackcc keystone-2012.2]# cat /etc/keystone/keystone.conf
[DEFAULT]
# A "shared secret" between keystone and other openstack services
admin_token = 7d97448231c0a2bac8a3
# The IP address of the network interface to listen on
# bind_host = 0.0.0.0
# 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 port number which the OpenStack Compute service listens on
# compute_port = 8774
# === Logging Options ===
# Print debugging output
# verbose = False
# 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 g