[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;