Friday, June 21, 2013

Cloudstack 4.1 on Ubuntu Server

My objective was to setup a Cloudstack 4.1 management node which will also server an NFS server for both primary and secondary storage.

The series of commands below were run on an Ubuntu Server 12.04.2(precise) system. During installation of the operating system, only the OpenSSH server was enabled in the task selection screen. I also made sure to name the server with a fully qualified domain name i.e. cloudstack.henyo.com.

#setup cloudstack source
echo "deb http://cloudstack.apt-get.eu/ubuntu precise 4.1" > /etc/apt/sources.list.d/cloudstack.list
#setup percona source
cat <<EOF >/etc/apt/sources.list.d/percona.list
deb http://repo.percona.com/apt precise main
deb-src http://repo.percona.com/apt precise main
EOF

#install the cloudstack apt-key
wget -O - http://cloudstack.apt-get.eu/release.asc|apt-key add -

#install stuff
apt-get update && \
apt-get install -y --force-yes openntpd nfs-kernel-server cloudstack-management percona-server-server-5.5 percona-server-client-5.5

cat <<EOF >/etc/mysql/conf.d/cloudstack.cnf
[mysqld]
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
EOF
service mysql restart

#setup nfs
mkdir -p /export/primary /export/secondary /var/primary /var/secondary
cat <<EOF >>/etc/fstab
/var/primary    /export/primary   none    bind  0  0
/var/secondary  /export/secondary none    bind  0  0
EOF
mount --bind /var/primary/ /export/primary/
mount --bind /var/secondary/ /export/secondary/
echo "/export         *(rw,async,no_root_squash,no_subtree_check)" >> /etc/exports
exportfs -a
service nfs-kernel-server restart

#setup cloudstack database
cloudstack-setup-databases cloud:test@localhost --deploy-as=root:root

#setup management server
echo 'Defaults:cloud !requiretty' >> /etc/sudoers.d/cloudstack
cloudstack-setup-management

reboot


I hope you found the post useful. You can subscribe via email or subscribe via a feed reader to get relevant updates from this blog. Have a nice day.

No comments:

Post a Comment