Apache CloudStack Deployment on Ubuntu Server: Difference between revisions

From WikiMLT
mNo edit summary
m (Стадий: 6 [Фаза:Утвърждаване, Статус:Утвърден]; Категория:Linux Server)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{ContentArticleHeader/Linux_Server}}</noinclude>
==OS Preparation==
==OS Preparation==
* [https://docs.cloudstack.apache.org/en/latest/installguide/overview/index.html#minimum-system-requirements Apache CloudStack Docs » Package Repository]
*[https://technologyrss.com/how-to-install-apache-cloud-stack-management-server-on-ubuntu-20-04/ TechnologyRSS Step#02: Download required package for setup Apache Cloud Stack]
*[https://docs.cloudstack.apache.org/en/latest/upgrading/upgrade/_java_version.html?highlight=cloudstack-agent#java-version-requirement Apache CloudStack Docs » Java Version Requirement]
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
echo deb http://download.cloudstack.org/ubuntu focal 4.15 | sudo tee -a /etc/apt/sources.list.d/cloudstack.list
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 -
wget -O - http://download.cloudstack.org/release.asc | sudo apt-key add -
sudo apt update
sudo apt update
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
sudo update-alternatives --config java
sudo update-alternatives --config java
Line 16: Line 13:


==Install the Management Server==
==Install the Management Server==
*[https://docs.cloudstack.apache.org/en/latest/installguide/management-server/index.html#install-the-management-server-on-the-first-host Apache CloudStack Docs » Install the Management Server on the First Host]
*[https://docs.cloudstack.apache.org/en/latest/installguide/management-server/index.html#install-the-management-server-on-the-first-host Apache CloudStack Docs » Install the Management Server on the First Host]
*[https://rohityadav.cloud/blog/cloudstack-rpi4-kvm/ Rohit Yadav » Apache CloudStack on RaspberryPi4 with Ubuntu 20.04 and KVM]
*[https://rohityadav.cloud/blog/cloudstack-rpi4-kvm/ Rohit Yadav » Apache CloudStack on RaspberryPi4 with Ubuntu 20.04 and KVM]
Line 28: Line 24:
</syntaxhighlight>
</syntaxhighlight>
{{collapse/div|#Output}}
{{collapse/div|#Output}}
<syntaxhighlight lang="bash">
<syntaxhighlight lang="yaml" line="1" class="mlw-collapsed-first-element">
[mysqld]
[mysqld]
server-id=1
server-id=1
Line 43: Line 39:
</syntaxhighlight>
</syntaxhighlight>
{{collapse/end}}
{{collapse/end}}
 
{{Collapse/begin}}
{{Collapse/begin|false}}<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
sudo cloudstack-setup-databases cloudStackUser:'secret007@CL0Ud'@localhost \
sudo cloudstack-setup-databases cloudStackUser:'secret007@CL0Ud'@localhost \
--deploy-as=root -m 'secret007' -k 'secret007' -i 127.0.0.1
--deploy-as=root -m 'secret007' -k 'secret007' -i 127.0.0.1
</syntaxhighlight>
</syntaxhighlight>
{{Collapse/div|#Output}}<syntaxhighlight lang="bash" lines="1">
{{Collapse/div|#Output}}
<syntaxhighlight lang="bash"class="mlw-collapsed-first-element">
Mysql user name:cloudStackUser                                                  [ OK ]
Mysql user name:cloudStackUser                                                  [ OK ]
Mysql user password:******                                                      [ OK ]
Mysql user password:******                                                      [ OK ]
Line 72: Line 69:
</syntaxhighlight>
</syntaxhighlight>
{{collapse/end}}
{{collapse/end}}
{{collapse/begin|false}}
{{collapse/begin}}
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
sudo cloudstack-setup-management
sudo cloudstack-setup-management
</syntaxhighlight>
</syntaxhighlight>
{{collapse/div|#Output}}
{{collapse/div|#Output}}
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash" class="mlw-collapsed-first-element">
Starting to configure CloudStack Management Server:
Starting to configure CloudStack Management Server:
Configure CloudStack Management Server ...[OK]
Configure CloudStack Management Server ...[OK]
Line 85: Line 82:
</syntaxhighlight>
</syntaxhighlight>
{{collapse/end}}
{{collapse/end}}
==Prepare the System VM Template==
==Prepare the System VM Template==
*[https://docs.cloudstack.apache.org/en/latest/installguide/management-server/index.html#prepare-the-system-vm-template Apache CloudStack Docs » Prepare the System VM Template]
*[https://docs.cloudstack.apache.org/en/latest/installguide/management-server/index.html#prepare-the-system-vm-template Apache CloudStack Docs » Prepare the System VM Template]
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
Line 96: Line 91:
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|false}}
{{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 103: Line 98:
</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.
Line 110: Line 105:
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/
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/
</syntaxhighlight>{{collapse/end}}
</syntaxhighlight>{{collapse/end}}
==Run 'cloudstack-setup-management'==
==Run 'cloudstack-setup-management'==
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
Line 122: Line 116:
cloudstack-setup-managemen
cloudstack-setup-managemen
</syntaxhighlight>
</syntaxhighlight>
 
==Remove CloudStack==
==Conclusion==
<syntaxhighlight lang="shell" line="1">
Менаджерът тръгва, но има още много работа да се свърши по конфигурирането. Като например да се настрои [https://rohityadav.cloud/blog/cloudstack-rpi4-kvm/ Зона] . За момента проекта е спрян и всичко направено до тук е разчистено чрез следните команди.<syntaxhighlight lang="shell" line="1">
sudo apt remove --purge cloudstack-management cloudstack-agent cloudstack-usage
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 /var/log/cloudstack/usage /var/log/cloudstack/management /var/lib/cloudstack/management  
Line 133: Line 126:
</syntaxhighlight>
</syntaxhighlight>


[[Category:Cloud Services]]
== References ==
* [https://docs.cloudstack.apache.org/en/latest/installguide/overview/index.html#minimum-system-requirements Apache CloudStack Docs » Package Repository]
*[https://technologyrss.com/how-to-install-apache-cloud-stack-management-server-on-ubuntu-20-04/ TechnologyRSS Step#02: Download required package for setup Apache Cloud Stack]
*[https://docs.cloudstack.apache.org/en/latest/upgrading/upgrade/_java_version.html?highlight=cloudstack-agent#java-version-requirement Apache CloudStack Docs » Java Version Requirement]
* [https://rohityadav.cloud/blog/cloudstack-rpi4-kvm/ Apache CloudStack on RaspberryPi4 with Ubuntu 20.04 and KVM] (Setup Zones)
 
<noinclude>
<div id='devStage'>
{{devStage
| Прндл  = Linux Server
| Стадий = 6
| Фаза  = Утвърждаване
| Статус = Утвърден
| ИдтПт  = Spas
| РзбПт  = Spas
| АвтПт  = Spas
| УтвПт  = {{REVISIONUSER}}
| ИдтДт  = 2.08.2022
| РзбДт  = 2.08.2022
| АвтДт  = 2.08.2022
| УтвДт  = {{Today}}
| ИдтРв  = [[Special:Permalink/29756|29756]]
| РзбРв  = [[Special:Permalink/29784|29784]]
| АвтРв  = [[Special:Permalink/29785|29785]]
| РзАРв  = [[Special:Permalink/29771|29771]]
| УтвРв  = {{REVISIONID}}
| РзУРв  = [[Special:Permalink/29774|29774]]
}}
</div>
</noinclude>

Latest revision as of 14:44, 2 August 2022

OS Prepa­ra­tion

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

In­stall the Man­age­ment Serv­er

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
#Out­put
[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
#Out­put
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
#Out­put
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

Pre­pare the Sys­tem VM Tem­plate

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'
#Out­put
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 'cloud­stack-set­up-man­age­ment'

# 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

Re­move Cloud­Stack

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

Ref­er­ences