Openstack之數據庫同步調試

    直接用Openstack官方的源代碼安裝,到了同步數據庫一步了,用: node

[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:nova@10.28.163.158/nova db sync

執行成功,找時間好好看看openstack數據庫操做部分。
相關文章
相關標籤/搜索