Apache CloudStack Deployment on Ubuntu Server: Difference between revisions
From WikiMLT
Line 100: | Line 100: | ||
wget http://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.0-kvm.qcow2.bz2 | wget http://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.0-kvm.qcow2.bz2 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{collapse/begin | {{collapse/begin}} | ||
<syntaxhighlight lang="shell" line="1"> | <syntaxhighlight lang="shell" line="1"> | ||
sudo /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \ | sudo /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \ | ||
Line 107: | Line 107: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{collapse/div|#Output}} | {{collapse/div|#Output}} | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash" class="mlw-collapsed-first-element"> | ||
mysql: [Warning] Using a password on the command line interface can be insecure. | mysql: [Warning] Using a password on the command line interface can be insecure. | ||
mysql: [Warning] Using a password on the command line interface can be insecure. | mysql: [Warning] Using a password on the command line interface can be insecure. |
Revision as of 12:08, 2 August 2022
OS Preparation
- Apache CloudStack Docs » Package Repository
- TechnologyRSS Step#02: Download required package for setup Apache Cloud Stack
- Apache CloudStack Docs » Java Version Requirement
echo deb http://download.cloudstack.org/ubuntu focal 4.15 | sudo tee -a /etc/apt/sources.list.d/cloudstack.list
wget -O - http://download.cloudstack.org/release.asc | sudo apt-key add -
sudo apt update
sudo update-alternatives --config java
# 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
Install the Management Server
- Apache CloudStack Docs » Install the Management Server on the First Host
- Rohit Yadav » Apache CloudStack on RaspberryPi4 with Ubuntu 20.04 and KVM
sudo apt install cloudstack-management cloudstack-agent cloudstack-usage
sudo systemctl stop cloudstack-agent.service cloudstack-management.service cloudstack-usage.service
sudo nano /etc/mysql/mysql.conf.d/cloudstack.cnf # cat /etc/mysql/mysql.conf.d/cloudstack.cnf
#Output
[mysqld]
server-id=1
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION"
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=1000
log-bin=mysql-bin
binlog-format = 'ROW'
default-authentication-plugin=mysql_native_password
sudo systemctl restart mysql.service
sudo cloudstack-setup-databases cloudStackUser:'secret007@CL0Ud'@localhost \
--deploy-as=root -m 'secret007' -k 'secret007' -i 127.0.0.1
#Output
Mysql user name:cloudStackUser [ OK ]
Mysql user password:****** [ OK ]
Mysql server ip:localhost [ OK ]
Mysql server port:3306 [ OK ]
Mysql root user name:root [ OK ]
Mysql root user password:****** [ OK ]
Using specified cluster management server node IP 127.0.0.1 [ OK ]
Checking Cloud database files ... [ OK ]
Checking local machine hostname ... [ OK ]
Checking SELinux setup ... [ OK ]
Preparing /etc/cloudstack/management/db.properties [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/server-setup.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/templates.sql [ OK ]
Processing encryption ... [ OK ]
Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloudstack/management/db.properties
sudo cloudstack-setup-management
#Output
Starting to configure CloudStack Management Server:
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!
Please ensure the following ports are open for the management server to function properly:
8080 8250 8443 9090
Prepare the System VM Template
sudo mkdir /mnt/vm-data-256GB/secondary /mnt/vm-data-256GB/primary
cd ~/Downloads
wget http://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.0-kvm.qcow2.bz2
sudo /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /mnt/vm-data-256GB/secondary -f systemvmtemplate-4.15.0-kvm.qcow2.bz2 \
-h kvm -o localhost -r cloudStackUser -d 'secret007@CL0Ud' -s 'secret007'
#Output
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Uncompressing to /usr/share/cloudstack-common/scripts/storage/secondary/65552f61-5ba7-4f6b-8f53-f2b25a6df676.qcow2.tmp (type bz2)...could take a long time
Moving to /mnt/vm-data-256GB/secondary/template/tmpl/1/3///65552f61-5ba7-4f6b-8f53-f2b25a6df676.qcow2...could take a while
Successfully installed system VM template systemvmtemplate-4.15.0-kvm.qcow2.bz2 and template.properties to /mnt/vm-data-256GB/secondary/template/tmpl/1/3/
Run 'cloudstack-setup-management'
# change the default port from 8080 to 8081
sudo nano /etc/cloudstack/management/server.properties
# open the port
sudo iptables -I INPUT 16 -p tcp -m tcp --dport 8081 -j ACCEPT
# run the management server
cloudstack-setup-managemen
Conclusion
Менаджерът тръгва, но има още много работа да се свърши по конфигурирането. Като например да се настрои Зона . За момента проекта е спрян и всичко направено до тук е разчистено чрез следните команди.
sudo apt remove --purge cloudstack-management cloudstack-agent cloudstack-usage
sudo rm -R /var/log/cloudstack/usage /var/log/cloudstack/management /var/lib/cloudstack/management
sudo rm -R /etc/cloudstack/management /var/log/cloudstack/agent /usr/share/cloudstack-agent /etc/cloudstack
sudo rm -R /usr/share/cloudstack-common /mnt/vm-data-256GB/primary /mnt/vm-data-256GB/secondary
update
sudo rm /etc/apt/sources.list.d/cloudstack.list