第一步:CloudStack数据库的重新初始化
1)、停止CloudStack服务。service cloud-management stop.
2)、到mysql里查询select uuid from storage_pool; 删除存储的SR。
[iyunv@aa ~]# mysql -u root -ptcloud
mysql> use cloud;
Database changed
mysql> select uuid from storage_pool;
+————————————–+
| uuid |
+————————————–+
| 6550eb15-daed-363e-be38-7e76bcd973ec |
| 7abfabe4-7081-3b1e-8ab3-4dcbc9633636 |
| db8002d3-1c41-383c-bab3-a561b9583547 |
+————————————–+
3 rows in set (0.00 sec)
3)、删除CloudStack数据库,drop database cloud; drop database cloud_usage;
[iyunv@aa ~]# mysql -u root -ptcloud
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11958
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> drop database cloud; drop database cloud_usage;
4)、重新部署CloudStack数据库 cloudstack-setup-databases cloud:password@localhost –deploy-as=root:password
[iyunv@aa ~]# cloud-setup-databases cloud:password@localhost –deploy-as=root:password
Testing specified deployment credentials on server localhost:3306
Setting up user credentials in:
-> /etc/cloud/management/db.properties … done.
Applying file /usr/share/cloud/setup/create-database.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/create-schema.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/create-database-premium.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/create-schema-premium.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/server-setup.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/templates.sql to the database on server localhost:3306
Applying file /usr/share/cloud/setup/create-index-fk.sql to the database on server localhost:3306