Neutron数据库同步错误 NotImplementedError: No support for ALTER of constraints in SQLite dialect

错误信息

[email protected]:~# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade juno" neutron
INFO  [alembic.migration] Context impl SQLiteImpl.
INFO  [alembic.migration] Will assume non-transactional DDL.
INFO  [alembic.migration] Running upgrade havana -> e197124d4b9, add unique constraint to members
Traceback (most recent call last):
  File "/usr/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 173, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 83, in do_upgrade_downgrade
    do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 61, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 165, in upgrade
    script.run_env()
  File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 390, in run_env
    util.load_python_file(self.dir, ‘env.py‘)
  File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 243, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 108, in <module>
    run_migrations_online()
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 100, in run_migrations_online
    context.run_migrations()
  File "<string>", line 7, in run_migrations
  File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py", line 738, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py", line 309, in run_migrations
    step.migration_fn(**kw)
  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py", line 42, in upgrade
    local_cols=[‘pool_id‘, ‘address‘, ‘protocol_port‘]
  File "<string>", line 7, in create_unique_constraint
  File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py", line 805, in create_unique_constraint
    schema=schema, **kw)
  File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/sqlite.py", line 34, in add_constraint
    "No support for ALTER of constraints in SQLite dialect")
NotImplementedError: No support for ALTER of constraints in SQLite dialect

错误原因

如今用的数据库是mysql,可是当软件安装完之后会自己主动生成一个SQLite 轻量级数据库。在这儿之所以会出错是由于此处用了SQLite。 而上面的同步命令不符合SQLite的语法,所以会出错

解决方法

禁用SQLite。凝视掉/etc/neutron/neutron.conf文件里[database]节中的SQLite连接,例如以下:

# vim /etc/neutron/neutron.conf

[database]
connection = mysql://neutron:[email protected]/neutron
#connection = sqlite:////var/lib/neutron/neutron.sqlite

再次运行同步语句

[email protected]:~# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade juno" neutron

INFO  [alembic.migration] Context impl MySQLImpl.
INFO  [alembic.migration] Will assume non-transactional DDL.

这样就ok了

时间: 2024-12-07 22:52:34

Neutron数据库同步错误 NotImplementedError: No support for ALTER of constraints in SQLite dialect的相关文章

openstack neutron数据库

一.Neutron 数据库的整体架构图 Neutron Database采用的是分布式架构,由3台服务器组成一个cluster.Neutron Server通过Plugin,然后发送给Neutron Database的VIP, HAProxy收到消息后,转发给database的实地址. 1.Neutron server 接收 api 请求. 2.plugin转换消息,发送给database 3.database 保存 neutron 网络状态. 4.HAProxy实现数据的主备保护 二. Neu

sqlserver数据库脱机时发生异常:由于无法在数据库 &#39;SMS&#39; 上放置锁,ALTER DATABASE 失败。请稍后再试。 ALTER DATABASE 语句失败。 (.Net SqlClient Data Provider)

sqlserver数据库脱机时发生异常,如下: =================================== 设置脱机 对于 数据库“SMS”失败.  (Microsoft.SqlServer.Smo) ------------------------------ 有关帮助信息,请单击: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500.0+((KJ_PCU_Main).110

重启oracle数据库的一次操作命令和alter日志。

今天重启oracle数据库的命令和alter日志: [email protected]:~> sqlplus '/as sysdba' SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 27 18:49:13 2016 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to:Oracle Database 11g Enterprise Edition Release

[Hive - LanguageManual] Create/Drop/Alter Database Create/Drop/Truncate Table

Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Create/Drop/Truncate Table Alter Table/Partition/Column Create/Drop/Alter View Create/Drop/Alter Index Create/Drop Function Create/Drop/Grant/Revoke Roles

SQL Server 2012实施与管理实战指南(笔记)——Ch5启动SQL Server服务和数据库

5.启动SQL Server服务和数据库 在数据库和服务启动过程中,经常会出现的问题: 1.SQL Server实例无法正常启动 2.系统数据库无法正常启动 3.网络配置失败 4.用户数据库无法启动 5.集群环境下SQL Server资源无法保持在线 目录 5.启动SQL Server服务和数据库... 1 5.1 SQL Server服务启动步骤... 1 5.1.1 从注册表中读取SQL Server启动信息... 1 5.1.2 检查硬件,配置内存和CPU.. 2 5.1.3 数据库启动.

数据存储与访问之——初见SQLite数据库

      本节引言: 本节学习Android数据库存储与访问的第三种方式:SQLite数据库,和其他的SQL数据库不同,我们并不需要在手机上另外安装一个数据库手机软件,Android系统已经集成了这个数据库,我们无需像使用其他数据库软件(Oracle,MSSQL,MySql等)又要安装,然后完成相关配置,又要改端口之类的!       1.基本的概念 1)SQLite是什么?为什么要用SQLite?SQLite有什么特点? 答:下面本姑娘来为大家讲解 SQLite是一个轻量级的关系型数据库,运

openstack Neutron分析(3)—— neutron-dhcp-agent源码分析

1.neutron dhcp3个主要部件分别为什么?2.dhcp模块包含哪些内容?3.Dnsmasq配置文件是如何创建和更新的?4.DHCP agent的信息存放在neutron数据库的哪个表中? 扩展: neutron-dhcp-agent在neutron的作用是什么? 一.概述 neutron dhcp为租户网络提供DHCP服务,即IP地址动态分配,另外还会提供metadata请求服务. 3个主要的部件:DHCP agent scheduler:负责DHCP agent与network的调度

nova boot代码流程分析(三):nova与neutron的交互(2)

继续<nova boot代码流程分析(三):nova与neutron的交互(1)>的分析. #/nova/virt/libvirt/driver.py:LibvirtDriver # NOTE(ilyaalekseyev): Implementation like in multinics # for xenapi(tr3buchet) def spawn(self, context, instance, image_meta, injected_files, admin_password,

Neutron分析(4)—— neutron-dhcp-agent

一.概述 neutron dhcp为租户网络提供DHCP服务,即IP地址动态分配,另外还会提供metadata请求服务. 3个主要的部件: DHCP agent scheduler:负责DHCP agent与network的调度 DHCP agent:为租户网络提供DHCP的功能,提供metadata request服务. DHCP driver:即dnsmasq,用于管理DHCP server. 二.REST API neutron dhcp提供2类REST API接口,这两类API都是ext