分享

如何初始化CloudStack测试环境

xioaxu790 发表于 2014-7-31 19:42:18 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 10193
问题导读

1、CloudStack数据库如何重新初始化?
2、如何创建二级存储?
3、怎样初始化主存储?




在进行CloudStack测试的时候,经常遇到要重新安装CloudStack,如果全部重装的话,耗时耗力,纯粹是体力活。我借鉴网上各位大虾的方法做了下归纳。

第一步:CloudStack数据库的重新初始化
1)、停止CloudStack服务。
  1. service cloud-management stop
复制代码

2)、到mysql里查询; 删除存储的SR。
  1. [root@aa ~]# mysql -u root -ptcloud
  2. mysql> use cloud;
  3. Database changed
  4. mysql> select uuid from storage_pool;
  5. +————————————–+
  6. | uuid |
  7. +————————————–+
  8. | 6550eb15-daed-363e-be38-7e76bcd973ec |
  9. | 7abfabe4-7081-3b1e-8ab3-4dcbc9633636 |
  10. | db8002d3-1c41-383c-bab3-a561b9583547 |
  11. +————————————–+
  12. 3 rows in set (0.00 sec)
复制代码

3)、删除CloudStack数据
  1. [root@aa ~]# mysql -u root -ptcloud
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 11958
  4. Server version: 5.0.77 Source distribution
  5. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
  6. mysql> drop database cloud; drop database cloud_usage;
复制代码


4)、重新部署CloudStack数据库
  1. [root@aa ~]# cloud-setup-databases cloud:password@localhost –deploy-as=root:password
  2. Testing specified deployment credentials on server localhost:3306
  3. Setting up user credentials in:
  4. -> /etc/cloud/management/db.properties … done.
  5. Applying file /usr/share/cloud/setup/create-database.sql to the database on server localhost:3306
  6. Applying file /usr/share/cloud/setup/create-schema.sql to the database on server localhost:3306
  7. Applying file /usr/share/cloud/setup/create-database-premium.sql to the database on server localhost:3306
  8. Applying file /usr/share/cloud/setup/create-schema-premium.sql to the database on server localhost:3306
  9. Applying file /usr/share/cloud/setup/server-setup.sql to the database on server localhost:3306
  10. Applying file /usr/share/cloud/setup/templates.sql to the database on server localhost:3306
  11. Applying file /usr/share/cloud/setup/create-index-fk.sql to the database on server localhost:3306
复制代码


5)、管理
  1. [root@aa ~]# cloud-setup-management
  2. Starting to configure ElasterStack Management Server:
  3. Configure sudoers … [OK]
  4. Configure Firewall … [OK]
  5. Configure CloudStack Management Server …[OK]
  6. ElasterStack Management Server setup is Done!
复制代码


第二步:初始化主存储和二级存储
1)、删除主存储和二级存储中的所有文件


第三步:准备二级存储
1)、在管理节点上挂载二级储存NFS目录:/export/secondary。
  1. # mkdir -p /mnt/secondary
  2. # mount -t nfs 172.16.204.111:/export/secondary /mnt/secondary/
复制代码

2)、下载SystemVm文件

3)、解压SystemVm文件
  1. #/usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -f systemvm.vhd.bz2 -h xenserver -F
复制代码

4)、完成以后,卸载二级储存
  1. #umount /mnt/secondary/
复制代码


第四步:重新安装主机上的Hypervistor
如果要是不想重新安装主机上的Hypervistor,参考第一步的第2项,删除存储的SR。






没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条