Openstack之数据库同步调试

    直接用Openstack官方的源代码安装,到了同步数据库一步了,用: 

[root@xgtest scripts]# 
/usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/EGG-INFO/scripts
[root@xgtest scripts]# python nova-manage  db sync 
报了个提醒:
[root@xgtest scripts]# cat /var/log/nova/nova-manager.log 
2012-08-27 15:08:35 CRITICAL nova [-] /usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/nova/db/sqlalchemy/migrate_repo
数据库没有同步成功
直接去看看这里面的文件: /usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/nova/db/sqlalchemy/migrate_repo
执行:[root@xgtest migrate_repo]# python manage.py version
发现当前文件夹少了文件: migrate.cfg
去安装好的环境里面看看:
[root@node74 ~]# find /usr/ -name migrate.cfg
/usr/lib/python2.6/site-packages/glance-2012.1-py2.6.egg/glance/registry/db/migrate_repo/migrate.cfg
/usr/lib/python2.6/site-packages/nova-2012.1-py2.6.egg/nova/db/sqlalchemy/migrate_repo/migrate.cfg
/usr/lib/python2.6/site-packages/keystone-2012.1-py2.6.egg/keystone/common/sql/migrate_repo/migrate.cfg
/usr/lib/python2.6/site-packages/migrate/versioning/templates/repository/pylons/migrate.cfg
/usr/lib/python2.6/site-packages/migrate/versioning/templates/repository/default/migrate.cfg
把对应文件scp过去:
/usr/lib/python2.6/site-packages/nova-2012.1-py2.6.egg/nova/db/sqlalchemy/migrate_repo/migrate.cfg

这个文件配置为:
[root@xgtest migrate_repo]# cat migrate.cfg 
[db_settings]
# Used to identify which repository this database is versioned under.
# You can use the name of your project.
repository_id=nova

# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.
# If this is changed once a database is under version control, you'll need to 
# change the table name in each database too. 
version_table=migrate_version

# When committing a change script, Migrate will attempt to generate the 
# sql for all supported databases; normally, if one of them fails - probably
# because you don't have that database installed - it is ignored and the 
# commit continues, perhaps ending successfully. 
# Databases in this list MUST compile successfully during a commit, or the 
# entire commit will fail. List the databases your application will actually 
# be using to ensure your updates to that database work properly.
# This must be a list; example: ['postgres','sqlite']
required_dbs=[]

重新执行:
[root@xgtest migrate_repo]# python manage.py version
115
[root@xgtest migrate_repo]# 
good,
继续执行:
[root@xgtest scripts]# pwd
/usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/EGG-INFO/scripts
[root@xgtest scripts]# 
[root@xgtest scripts]# 
[root@xgtest scripts]#  nova-manage    --logdir=/var/log/nova/ --logfile=/var/log/nova/nova-manager.log  --sql_connection=mysql://nova:[email protected]/nova db sync

执行成功,找时间好好看看openstack数据库操作部分。

你可能感兴趣的:(DB,openstack,nova-manager)