cloudstack on centos6.5 笔记

时间:2021-03-30 15:55:59

在centos6.5上安装cloudstack的笔记,无详细解释,仅用来作记录
1.安装centos6.5
2.配置静态网络

3.重启网络

server network restart

4.修改selinux为permissive

setenforce 0
修改/etc/selinux/config中对应的内容为如下
SELINUX=permissive

5.ntp设置
安装ntp

yum -y install ntp

设置ntp

chkconfig ntpd on
service ntpd start

6.设置CloudStack Package Repository
创建/etc/yum.repos.d/cloudstack.repo并添加下面内容

[cloudstack]
name=cloudstack
baseurl=http://mirrors.cloudstack-china.com/mirror/centos/6/4.8/
enabled=1
gpgcheck=0

7.NFS
安装

yum -y install nfs-utils

设置/etc/idmapd.conf添加一下内容

Domain = cloud.priv

Management Server 安装

1.修改host
修改/etc/hosts对应的内容为如下

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.11.50.11 management.cloud.org

修改/etc/sysconfig/network对应内容如下

HOSTNAME=management.cloud.org

2.安装Mysql Server

yum -y install mysql-server

3.在/etc/my.cnf的[mysqld]节添加以下内容

innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = ‘ROW’

4.重启并默认启动Mysql服务

service mysqld start
chkconfig mysqld on

5.安装cloudstack-management

yum -y install cloudstack-management
cloudstack-setup-databases cloud:123456@localhost –deploy-as=root
cloudstack-setup-management

6.挂载nfs盘
挂载nfs中secondary到/mnt/secondary

7.安装System Template

/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u http://mirrors.cloudstack-china.com/mirror/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2 -h kvm -F

8.卸载 /mnt/secondary

Agent 安装

1.修改host
修改/etc/hosts对应的内容为如下

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.11.50.11 agent.cloud.org

修改/etc/sysconfig/network对应内容如下

HOSTNAME=agent.cloud.org

2.安装

yum -y install cloudstack-agent

3.QEMU配置
设置/etc/libvirt/qemu.conf对应内容如下

vnc_listen=0.0.0.0

4.Linvirt配置
配置/etc/libvirt/libvirtd.conf对应的内容如下

listen_tls = 0
listen_tcp = 1
tcp_port = “16059”
auth_tcp = “none”
mdns_adv = 0

配置/etc/sysconfig/libvirtd对应内容如下

LIBVIRTD_ARGS=”–listen”

重启服务

service libvirtd restart

若重启服务失败,可以将/etc/libvirt/libvirtd.conf中下面内容的注释去掉

log_outputs=”3:syslog:libvirtd”

NFS Server配置

1.配置NFS
设置 /etc/exports并添加下面内容

/export *(rw,async,no_root_squash,no_subtree_check)

创建文件夹

mkdir -p /export/primary
mkdir -p /export/secondary

设置/etc/sysconfig/nfs添加一下内容

LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020

配置/etc/sysconfig/iptables添加下面规则

-A INPUT -s 172.16.10.0/24 -m state –state NEW -p udp –dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 2049 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 32803 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p udp –dport 32769 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p udp –dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p udp –dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p tcp –dport 662 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state –state NEW -p udp –dport 662 -j ACCEPT

重启iptables

service iptables restart

设置nfs服务自启动并启动它

service rpcbind start
service nfs start
chkconfig rpcbind on
chkconfig nfs on