[root@controller nova]# su -s /bin/sh -c “nova-manage db sync” nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u’Duplicate index block_device_mapping_instance_uuid_virtual_name_device_name_idx
. This is deprecated and will be disallowed in a future release.‘)
result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u’Duplicate index uniq_instances0uuid
. This is deprecated and will be disallowed in a future release.’)
result = self._query(query)
根据提示:uuid重复了,这里算是警告信息把?不用管它也行,没有提示error
原因:这个警告表明在nova数据库中存在重复的索引。在未来的MariaDB版本中,这将是不允许的。为了解决这个问题,你需要删除重复的索引。以下是详细的步骤:
登录数据库:
选择 nova数据库
查询和删除:
MariaDB [nova]> SHOW INDEX FROM instances;
MariaDB [nova]> ALTER TABLE instances DROP INDEX uniq_instances0uuid;
删除后:
再次执行:
[root@controller nova]# su -s /bin/sh -c "nova-manage db sync" nova
MariaDB [(none)]> use nova;
MariaDB [nova]> SHOW INDEX FROM instances;