Converting from Single Server to Multi-Server Installation
The following guide may be used to convert a single-server installation to a multi-server installation of the same version. Administrators should familiarize themselves with the standard Multi-Server installation process prior to starting process. It is recommended to fully read through the instructions prior to starting.
This guide is written specifically to Workspaces version 1.14.0 but should be easily adaptable to other releases by referencing the most up to date installation/upgrade instructions where referenced.
Instructions
1. Database Backup
From a console / ssh session on the Kasm Workspaces single server, conduct a database backup: Reference
Stop the services
sudo /opt/kasm/bin/stop
Execute the backup utility (substitute the version number if appropriate)
sudo mkdir -p /opt/kasm/backups/ sudo bash /opt/kasm/1.14.0/bin/utils/db_backup -f /opt/kasm/backups/kasm_db_backup.tar -p /opt/kasm/1.14.0/
Verify the presence of the backup:
sudo ls -al /opt/kasm/backups/kasm_db_backup.tar
Get the existing database and redis passwords
sudo grep " password" /opt/kasm/1.14.0/conf/app/api.app.config.yaml sudo grep "redis_password" /opt/kasm/1.14.0/conf/app/api.app.config.yaml
2. Copy the database backup file to the new database host
Create the directory “/opt/kasm/backups” on the server designated to become the new kasm database host.
Copy the database backup from the single server host (ie: “kasm_db_backup.tar”) to the kasm database host.
Place the backup file “kasm_db_backup.tar” in the directory “/opt/kasm/backups”.
Verify the presence of the backup on the database host:
sudo ls -al /opt/kasm/backups/kasm_db_backup.tar
3. Multi-Server Database Install and Restore
On a new server, conduct the Multi-Server database role installation. These steps are very similar to the existing multi-server database upgrade path, except we will not run the upgrade utility: Reference:
Download and extract the Workspaces installation media (substitute the installation media from your existing version)
cd /tmp/ curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.14.0.3a7abb.tar.gz tar -xf kasm_release_*.tar.gz
Perform a clean install passing in the database and redis password from the previous step
sudo bash kasm_release/install.sh -S db -D -Q <DATABASE_PASSWORD> -R <REDIS_PASSWORD>
Stop the services and perform a restore of the previous database backup. You will need to copy over the database backup prior to this step
sudo /opt/kasm/bin/stop sudo /opt/kasm/1.14.0/bin/utils/db_restore -f /opt/kasm/backups/kasm_db_backup.tar -p /opt/kasm/1.14.0/
Start the database services
sudo /opt/kasm/bin/start
4. Install a Multi-Server WebApp Role
Follow the existing product instructions to install the Web App Role Server(s).
Only one webapp is needed to continue to the next step. However at least two webapps are recommended per our n+1 redundancy recommendations.
If you are installing multiple webapp servers it is recommended to place a load balancer in front of the webapps so that the load balancer is the front facing IP (or domain) and the webapps are connect as the backend. After the webapps are installed the Kasm web UI can be reached by going to
https://[load-balancer-hostname]/#/staticlogin
orhttps://[webapp-hostname]/#/staticlogin
.Instructions for install the Web App Role server:
When installing the WebApp role the Kasm installation command will require a reference to the database server.
Example:
sudo bash kasm_release/install.sh --role app --db-hostname [DATABASE_HOSTNAME] --db-password [DATABASE_PASSWORD] --redis-password [REDIS_PASSWORD] --database-user [DATABASE_USERNAME] --database-name [DATABASE_NAME]
DATABASE_HOSTNAME - Typically the static private IP of the database. Can also be a public IP or FQDN name. Network connectivity from the webapp to the database must be allowed on to destination ports 5432 and 6379. Reference Ports and Protocols (Multi Server Installation — Kasm 1.16.1 documentation ).
DB Postgres Connectivity Check run from the webapp:
nc -vz -w 3 [DATABASE_HOSTNAME] 5432 2>&1
DB Redis Connectivity Check run from the webapp:
nc -vz -w 3 [DATABASE_HOSTNAME] 6379 2>&1
DATABASE_PASSWORD - The postgres password of the source database.
REDIS_PASSWORD - The redis password of the source redis database.
DATABASE_USERNAME - (Optional) The database username of the source database. Defaults to “
kasmapp
“.DATABASE_NAME - (Optional) The database name of the source database. Defaults to “
kasm
".
5. Update the SSL certificate
Kasm will create a self-sign SSL certificate at installation.
If you are using a Load Balancer (or Reverse Proxy) in front of the Kasm webapps:
You will need to provide a valid SSL certificate to the Load Balancer.
You will not need to provide the custom SSL certificate to the webapps.
If you are not using a Load Balancer (or Reverse Proxy):
You can optionally continue to use the self-sign SSL certificate created during installation.
If you are using a custom SSL certificate each webapp needs a copy of the SSL public and private key.
Reference: Replacing SSL certificates
On each webapp save your custom SSL private key to overwrite the file
/opt/kasm/current/certs/kasm_nginx.key
.On each webapp save your custom SSL public key to overwrite the file
/opt/kasm/current/certs/kasm_nginx.crt
.Stop and restart the kasm services on each webapp.
sudo /opt/kasm/bin/stop sudo /opt/kasm/bin/start
6. Deploy Cleanup
Once at least one webapp role server is installed, log into the deployment via the UI via the webapp. The webapp
Record the Existing Docker Agent configurations
From the Admin panel, expand Infrastructure and select Docker Agents.
Find the Agent named “proxy” and edit it.
Under the “Edit” shadow tab record the values for the following fields for later reference:
Automatically Prune Images
Cores Override
GPU Override
Memory Override
Remove the Existing Docker Agent
From the Admin panel, expand Infrastructure and select Docker Agents.
Find the Agent named “proxy” and delete it.
Remove the existing Connection Proxy
From the Admin panel, expand Infrastructure and select Connection Proxies.
Find the Connection Proxy named “proxy” and delete it.
Remove the old Manager
From the Admin panel, expand Infrastructure and select Managers
Identify the old manager (it will have a Last Reported Time that is old)
Adjust the Zone Settings
From the Admin panel, expand Infrastructure and select Zones
Click Edit next to the Zone named default
Update the Upstream Auth Address field to
$request_host$
and click Save.
7. Install a Multi-Server Agent Role
Follow the existing product instructions to install the Agent Role Server(s).
Note: The Manager Token can be retrieved from the Global Settings within the Admin UI
Enable the Kasm Docker Agent.
From the Admin panel, expand Infrastructure and select Docker Agents
Edit the agent
Enable the “Enable” checkbox and click Save.
Use the values recorded from the original “proxy” agent to replace the values for the following fields: (WARNING: The “Cores Override”, “GPU Override”, and “Memory Override” were set based on the instance resources available to your single server. If your new Kasm Agent has a different resource configuration than your original single server (ie: CPU, GPU, and Memory) you will need to reevaluate the override values to fit the new server’s performance capabilities.)
Automatically Prune Images
Cores Override
GPU Override
Memory Override
8. (Optional) Install a Multi-Server Connection Proxy (Guac) Role
If desired, install the Connection Proxy Role using the existing product instructions.
Note: The Service Registration Token (labeled: “Component Registration Token”) can be retrieved from the Global Settings within the Admin UI:
9. Complete
The system should now be converted.
Related Docs:
https://kasmweb.com/docs/develop/install/multi_server_install.html
https://kasmweb.com/docs/develop/upgrade/multi_server_upgrade.html
https://kasmweb.com/docs/latest/how_to/sizing_operations.html#redundancy
Related articles