您好,登錄后才能下訂單哦!
小編給大家分享一下CloudStack 4.4中如何安裝cloudstack-management,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
CloudStack的3.0版本和4.4版本的命令和目錄有很大的區別。
下面的命令,標注部分為3.0和4.4的區別,其他的不變。
主機名: 【cloud-server.perofu.com】
ip: 【172.22.2.76】
hostname cloud-server.perofu.com vi /etc/sysconfig/network HOSTNAME=cloud-server.perofu.com vi /etc/hosts 127.0.0.1 cloud-server.perofu.com 172.22.2.76 cloud-server.perofu.com 172.22.2.87 cloud-agent-1.perofu.com 172.22.2.100 cloud-agent-2.perofu.com |
vi /etc/sysconfig/selinux SELINUX=disabled setenforce 0 yum install ntpdate -y echo '#ntpd' >> /var/spool/cron/root echo "10 5 * * * /usr/sbin/ntpdate ntp.api.bz &> /dev/null" >> /var/spool/cron/root echo '' >> /var/spool/cron/root service ntpd stop chkconfig ntpd off /usr/sbin/ntpdate ntp.api.bz &> /dev/null |
這里將mysql單獨拿出來安裝,用的是光盤的yum源,可以節省資源,當然大家可以使用Cloudstack的安裝腳本進行安裝,一樣的效果。
yum install openssl-devel mysql-server mysql-devel -y cp -a /usr/share/doc/mysql-server-5.1.66/my-medium.cnf /etc/my.cnf vi /etc/my.cnf [mysqld] innodb_rollback_on_timeout=1 innodb_lock_wait_timeout=600 max_connections=350 log-bin=mysql-bin binlog-format=ROW /etc/init.d/mysqld start chkconfig mysqld on /usr/bin/mysql_secure_installation #配置mysql安全,可直接全選Y |
V4.4
vi /etc/yum.repos.d/cloudstack.repo [cloudstack] name=cloudstack baseurl=http://cloudstack.apt-get.eu/rhel/4.4/ enabled=1 gpgcheck=0 yum -y install cloudstack-management httpd |
V3.0
tar -axf CloudStack-oss-3.0.2-1-rhel6.2.tar.gz -C /usr/local/src/ cd /usr/local/src/CloudStack-oss-3.0.2-1-rhel6.2/ ./install.sh M |
“M”------> 安裝 Management Server 軟件。
“D”------> 安裝 MySQL。
V4.4
cloudstack-setup-databases cloud:dbpassword@localhost --deploy-as=root:password |
[root@cloud-server ~]# cloudstack-setup-databases cloud:123456@localhost --deploy-as=root:123456 |
V3.0
cloud-setup-databases cloud:dbpassword@localhost --deploy-as=root:password |
注:即表示以 root 用戶身份來生成數據庫,該數據庫屬于新建的 cloud 用戶(密碼 dbpassword 可以留空)。
[root@cloud-server ~]# cloud-setup-databases cloud:123456@localhost --deploy-as=root:123456 Mysql user name:cloud [ OK ] Mysql user password:123456 [ OK ] Mysql server ip:localhost [ OK ] Mysql server port:3306 [ OK ] Mysql root user name:root [ OK ] Mysql root user password:123456 [ OK ] Checking Cloud database files ... [ OK ] Checking local machine hostname ... [ OK ] Checking SELinux setup ... WARNING: We detected that your SELinux is not configured in permissive. to make sure cloudstack won't block by SELinux after system reboot, we strongly suggest you setting it in permissive in /etc/selinux/config, then reboot the machine. [ OK ] Detected local IP address as 172.22.2.76, will use as cluster management server node IP[ OK ] Preparing /etc/cloud/management/db.properties [ OK ] Applying /usr/share/cloud/setup/create-database.sql [ OK ] Applying /usr/share/cloud/setup/create-schema.sql [ OK ] Applying /usr/share/cloud/setup/create-database-premium.sql [ OK ] Applying /usr/share/cloud/setup/create-schema-premium.sql [ OK ] Applying /usr/share/cloud/setup/server-setup.sql [ OK ] Applying /usr/share/cloud/setup/templates.sql [ OK ] Applying /usr/share/cloud/setup/create-index-fk.sql [ OK ] Processing encryption ... [ OK ] Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloud/management/db.properties |
/etc/cloud/management/db.properties存放CloudStack數據庫的相關信息。
對操作系統 iptables、sudoers 的設置(CloudStack 本身有安全性方面的要求,不是無限暴露給網絡,同時又需要一些管理權限來運行自身服務,因此要做這兩項的設置)。
V4.4
/etc/init.d/httpd start chkconfig httpd on? cloudstack-setup-management /etc/init.d/cloudstack-management start chkconfig cloudstack-management on |
V3.0
cloud-setup-management /etc/init.d/cloud-management start chkconfig cloud-management on |
[root@cloud-server ~]# cloud-setup-management Starting to configure CloudStack Management Server: Configure sudoers ... [OK] Configure Firewall ... [OK] Configure CloudStack Management Server ...[OK] CloudStack Management Server setup is Done! |
manager的日志文件:/var/log/cloud/management/management-server.log
前面講過,CloudStack 需要兩類存儲(primary storage 和 secondary storage)來支持它的 cluster 和 host,本節中由 NFS 來提供這兩個存儲,因此前述步驟中要啟動 NFS 服務。同時為了方便起見,NFS Server 也由 cloud-server.perofu.com 充當。
yum install nfs-utils -y mkdir -p /data/{primary,secondary} #創建兩個目錄,分別作為一級和二級存儲 chmod 777 /data/* vi /etc/exports /data/primary *(rw,fsid=1,async,no_root_squash,no_subtree_check) /data/secondary *(rw,fsid=2,async,no_root_squash,no_subtree_check) exportfs -a #導出/data 目錄 cp /etc/sysconfig/nfs /etc/sysconfig/nfs.bak > /etc/sysconfig/nfs vi /etc/sysconfig/nfs #用于iptables LOCKD_TCPPORT=32803 LOCKD_UDPPORT=32769 MOUNTD_PORT=892 RQUOTAD_PORT=875 STATD_PORT=662 STATD_OUTGOING_PORT=2020 vi /etc/sysconfig/iptables #加入到所有INPUT之前,也可以關閉iptables -A INPUT -m state --state NEW -p udp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 2049 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 32803 -j ACCEPT -A INPUT -m state --state NEW -p udp --dport 32769 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 892 -j ACCEPT -A INPUT -m state --state NEW -p udp --dport 892 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 875 -j ACCEPT -A INPUT -m state --state NEW -p udp --dport 875 -j ACCEPT -A INPUT -m state --state NEW -p tcp --dport 662 -j ACCEPT -A INPUT -m state --state NEW -p udp --dport 662 -j ACCEPT service iptables restart service iptables save vi /etc/idmapd.conf #管理服務器(cloud-server.perofu.com)和 hypervisor都要 Domain = perofu.com service rpcbind restart service nfs restart mkdir /tmp/primarymount mount -t nfs 172.22.2.76:/data/primary /tmp/primarymount #測試能否掛載,iptables umount /tmp/primarymount/ service rpcbind restart service nfs restart chkconfig nfs on chkconfig rpcbind on |
[root@cloud-server ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 19G 1.7G 16G 10% / tmpfs 116M 0 116M 0% /dev/shm /dev/sda1 485M 32M 428M 7% /boot /dev/sr0 4.1G 4.1G 0 100% /mnt 172.22.2.76:/data/primary 19G 1.7G 16G 10% /tmp/primarymount |
系統虛擬機模板按要求要存放在輔助存儲上的,我們可以先手動掛載nfs輔助存儲, 然后把290M KVM虛擬化模板先下載到輔助存儲目錄下,然后在導入, 導入系統虛擬機模板步是必須要配置的內容。本例采用KVM虛擬化,下載導入KVM虛擬機模板。
1)、在management上掛載輔助存儲;
2)、下載kvm模板,并上傳到輔助存儲;
3)、導入。
systemvm64template-4.4.0-6-kvm.qcow2.bz2模板文件有點大,最好是通過別的下載工具進行下載,如百度網盤的離線下載,再上傳使用。
在management上操作。
V4.4
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /tmp/secondarymount -f systemvm64template-4.4.0-6-kvm.qcow2.bz2 -h kvm -F |
V3.0
mkdir /tmp/secondarymount mount -t nfs 172.22.2.76:/data/secondary /tmp/secondarymount cd /tmp/secondarymount wget http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-kvm.qcow2.bz2 /usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /tmp/secondarymount -f systemvm64template-4.4.0-6-kvm.qcow2.bz2 -h kvm -F |
系統虛擬機默認用戶名密碼:root/6m1ll10n
[root@cloud-server ~]# mkdir /tmp/secondarymount [root@cloud-server ~]# mount -t nfs 172.22.2.76:/data/secondary /tmp/secondarymount [root@cloud-server ~]# cd /tmp/secondarymount [root@cloud-server secondarymount]# rz rz waiting to receive. Starting zmodem transfer. Press Ctrl+C to cancel. 100% 296844 KB 6184 KB/s 00:00:48 0 Errorss2...
[root@cloud-server secondarymount]# pwd /tmp/secondarymount [root@cloud-server secondarymount]# [root@cloud-server secondarymount]# ll total 296848 -rw-r--r--. 1 root root 303968528 Sep 29 03:17 systemvm64template-4.4.0-6-kvm.qcow2.bz2 [root@cloud-server secondarymount]# /usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /tmp/secondarymount -f systemvm64template-4.4.0-6-kvm.qcow2.bz2 -h kvm -F Uncompressing to /usr/lib64/cloud/agent/scripts/storage/secondary/6e1d6d0d-8768-48b9-87af-44a182427c8c.qcow2.tmp (type bz2)...could take a long time Moving to /tmp/secondarymount/template/tmpl/1/3///6e1d6d0d-8768-48b9-87af-44a182427c8c.qcow2...could take a while Successfully installed system VM template systemvm64template-4.4.0-6-kvm.qcow2.bz2 to /tmp/secondarymount/template/tmpl/1/3/ [root@cloud-server secondarymount]# |
http://172.22.2.76:8080/client/
默認用戶名和密碼為admin, password
V4.4
V3.0
service cloudstack-management stop |
mysql>drop database cloud; mysql>drop database cloud_usage; mysql>drop database cloudbridge; mysql>\q |
詳見初始化CloudStack數據庫部分。
詳見導入虛擬機模板部分。
service cloudstack-management start |
這時,你再登陸就會發現一個全新的CloudStack啦。
以上是“CloudStack 4.4中如何安裝cloudstack-management”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。