標籤: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