Deploy private cloud CloudStack

catalog

preface

The infrastructure cloud formed by CloudStack and Data center Operators can quickly and easily build on their existing infrastructure to provide cloud services, elastic cloud computing services. CloudStack users can make full use of cloud computing to provide higher efficiency, unlimited scale and faster deployment of new services and systems to end users.

CloudStack is an open-source cloud operating system, which can help users to use their own hardware to provide public cloud services similar to Amazon EC2. CloudStack can build a harmonious environment by organizing and coordinating users' virtualization resources. CloudStack has many powerful functions that enable users to build a secure multi tenant cloud computing environment. CloudStack is compatible with the Amazon API interface.

CloudStack allows users to quickly and easily build their own cloud services on existing architectures. CloudStack can help users better coordinate server, storage and network resources to build an IaaS platform.

1. Cluster planning

IP role
192.168.0.232 Xenserver virtual machine, CloudStack server, primary storage
192.168.0.233 Xenserver virtual machine, secondary storage
192.168.0.231 Physical host, Xenserver server server

2. Set yum source

wget -O /etc/yum.repos.d/CentOS-Base.repo  http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo  http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

3. close the firewall and selinux

systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

4. Install nfs

4.1.192.168.0.232

yum -y install nfs-utils
mkdir /data/export/primary -p
echo "/data/export/primary 192.168.0.0/24(rw,async,no_root_squash,no_subtree_check)" >>/etc/exports
cat >>/etc/sysconfig/nfs <<EOF
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
EOF
systemctl start nfs
systemctl start rpcbind 
systemctl enable rpcbind
systemctl enable nfs

4.2.192.168.0.233

yum -y install nfs-utils
mkdir /data/export/secondary -p
echo "/data/export/secondary 192.168.0.0/24(rw,async,no_root_squash,no_subtree_check)" >>/etc/exports
cat >>/etc/sysconfig/nfs <<EOF
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
EOF
systemctl start nfs
systemctl start rpcbind 
systemctl enable rpcbind
systemctl enable nfs

5. Install and start MySQL server

yum -y install mariadb-server
vi /etc/my.cnf     #Under [mysqld], add the following parameters:
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format= 'ROW'

systemctl start mariadb.service
systemctl enable mariadb.service

6. Install and start cloudstack management

rpm --import http://repo.mysql.com/RPM-GPG-KEY-mysql import GPG public key from MySQL
yum -y install mysql-connector-python  #Install MySQL connector
cd /root/cloudstack4.11.1/  && yum -y localinstall cloudstack-*  #http://download.cloudstack.org/centos/7/4.11/
cloudstack-setup-databases cloud:123456@localhost --deploy-as=root  #Initialize CloudStack database
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;  #Authorized user rights
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /data/export/primary/ -f /root/cloudstack4.11.1/systemvmtemplate-4.11.1-xen.vhd.bz2 -h xenserver -F  #Import the basic template systemvmtemplate-4.11.1-xen.vhd.bz2 download address: http://docs.cloudstack.apache.org/en/4.11.1.0/adminguide/systemvm.html
cloudstack-setup-management  #192.168.0.233 no need to start
systemctl enable cloudstack-management  #192.168.0.233 no need to start

7. Browser access

User name / password: admin/password
http://192.168.0.232:8080/client/

Tags: Linux yum MySQL SELinux CentOS

Posted on Sun, 10 May 2020 23:56:54 -0400 by johnpaine