centos6.4安装CloudStack 4.2(开源云计算平台)详解

2020-01-30 13:41:21王旭

Configure sudoers ... [OK]
Configure Firewall ... [OK]
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!

控制节点应该和存储分开,这里为了方便,我们把 NFS 也装在这个控制节点上,并自己挂载自己的 NFS 分区:

复制代码
# yum install nfs-utils
# mkdir -p /export/primary
# mkdir -p /export/secondary
# vi /etc/exports
/export *(rw,async,no_root_squash,no_subtree_check)
# exportfs -a
# vi /etc/sysconfig/nfs
...
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
...
# service rpcbind start
# service nfs start
# chkconfig nfs on
# chkconfig rpcbind on
# reboot
# mkdir -p /mnt/primary
# mkdir -p /mnt/secondary
# mount -t nfs 192.168.2.150:/export/primary /mnt/primary
# mount -t nfs 192.168.2.150:/export/secondary /mnt/secondary

修改防火墙配置,开放下面一些端口:

复制代码
# vi /etc/sysconfig/iptables
...
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 662 -j ACCEPT
...
# service iptables restart
# service iptables save

创建虚拟机需要有模版,这个模版可以自己做,也可以下载官方现成的。需要注意的是,官方文档中的 /usr/lib64/cloud/common/… 路径不对,应该是 /usr/share/cloudstack-common/…:

复制代码
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u <a href="http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2">http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2</a> -h kvm -s -F

在计算节点上

为了保持一致,我们在计算节点上也采用 CentOS 6.4. 在每个计算节点上都需要如下的安装和配置。升级系统并修改 hostname、重启: