Neutron資料庫同步錯誤 NotImplementedError: No support for ALTER of constraints in SQLite dialect

來源:互聯網
上載者:User

標籤:openstack   linux   mariadb   neutron   

錯誤資訊
[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" neutronINFO  [alembic.migration] Context impl SQLiteImpl.INFO  [alembic.migration] Will assume non-transactional DDL.INFO  [alembic.migration] Running upgrade havana -> e197124d4b9, add unique constraint to membersTraceback (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" neutronINFO  [alembic.migration] Context impl MySQLImpl.INFO  [alembic.migration] Will assume non-transactional DDL.

這樣就ok了

Neutron資料庫同步錯誤 NotImplementedError: No support for ALTER of constraints in SQLite dialect

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.