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

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

转载于:https://my.oschina.net/u/177808/blog/75045

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值