Skip to content

Instantly share code, notes, and snippets.

@eriweb
Last active August 29, 2015 14:04
Show Gist options
  • Save eriweb/1e19cd4383614121db98 to your computer and use it in GitHub Desktop.
Save eriweb/1e19cd4383614121db98 to your computer and use it in GitHub Desktop.
ACS mgmt server install
export HOSTNAME="acs44-mgmt"
# enable interfaces
sed -i 's/ONBOOT=.*/ONBOOT="yes"/' /etc/sysconfig/network-scripts/ifcfg-eth*
# change hostname
sed -i "s/HOSTNAME=.*/HOSTNAME=$HOSTNAME/" /etc/sysconfig/network
# disable selinux
setenforce 0
sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
# create repo file
cat > /etc/yum.repos.d/cloudstack.repo <<EOF
[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/rhel/4.4/
enabled=1
gpgcheck=0
EOF
# install mgmt server and mysql
yum install -y cloudstack-management-4.4.0 mysql-server nfs-utils
# create nfs directories
mkdir /primary
mkdir /secondary
cat > /etc/exports <<EOF
/secondary *(rw,async,no_root_squash)
/primary *(rw,async,no_root_squash)
EOF
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
iptables -F
service iptables save
service rpcbind start
service nfs start
chkconfig rpcbind on
chkconfig nfs on
cat >/etc/my.cnf <<EOF
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
EOF
service mysqld start
chkconfig mysqld on
IPADDR=$(ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2|cut -d ' ' -f 1)
cat >>/etc/hosts <<EOF
$IPADDR $HOSTNAME
EOF
cloudstack-setup-databases cloud:password@localhost --deploy-as=root
cloudstack-setup-management
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /secondary -u http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-kvm.qcow2.bz2 -h kvm -F
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment