/
Converting from Single Server to Multi-Server Installation

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

  1. Stop the services

    1. sudo /opt/kasm/bin/stop

       

  2. Execute the backup utility (substitute the version number if appropriate)

    1. 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/

       

  3. Verify the presence of the backup:

    1. sudo ls -al /opt/kasm/backups/kasm_db_backup.tar

       

  4. Get the existing database and redis passwords

    1. 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

  1. Create the directory “/opt/kasm/backups” on the server designated to become the new kasm database host.

  2. Copy the database backup from the single server host (ie: “kasm_db_backup.tar”) to the kasm database host.

  3. Place the backup file “kasm_db_backup.tar” in the directory “/opt/kasm/backups”.

  4. Verify the presence of the backup on the database host:

    1. 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:

  1. Download and extract the Workspaces installation media (substitute the installation media from your existing version)

    1. 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

       

  2. Perform a clean install passing in the database and redis password from the previous step

    1. sudo bash kasm_release/install.sh -S db -D -Q <DATABASE_PASSWORD> -R <REDIS_PASSWORD>

       

  3. 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

    1. 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/

       

  4. Start the database services

    1. sudo /opt/kasm/bin/start

 

4. Install a Multi-Server WebApp Role

  1. Follow the existing product instructions to install the Web App Role Server(s).

    1. Only one webapp is needed to continue to the next step. However at least two webapps are recommended per our n+1 redundancy recommendations.

    2. 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 or https://[webapp-hostname]/#/staticlogin.

    3. Instructions for install the Web App Role server:

      1. https://kasmweb.com/docs/latest/install/multi_server_install.html#install-web-app-role

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

  1. Record the Existing Docker Agent configurations

    1. From the Admin panel, expand Infrastructure and select Docker Agents.

    2. Find the Agent named “proxy” and edit it.

    3. Under the “Edit” shadow tab record the values for the following fields for later reference:

      1. Automatically Prune Images

      2. Cores Override

      3. GPU Override

      4. Memory Override

image-20240201-213407.png
  1. Remove the Existing Docker Agent

    1. From the Admin panel, expand Infrastructure and select Docker Agents.

    2. Find the Agent named “proxy” and delete it.

      image-20240131-235934.png

       

  2. Remove the existing Connection Proxy

    1. From the Admin panel, expand Infrastructure and select Connection Proxies.

    2. Find the Connection Proxy named “proxy” and delete it.

      image-20240201-000100.png

       

  3. Remove the old Manager

    1. From the Admin panel, expand Infrastructure and select Managers

    2. Identify the old manager (it will have a Last Reported Time that is old)

      image-20240201-000408.png
  4. Adjust the Zone Settings

    1. From the Admin panel, expand Infrastructure and select Zones

    2. Click Edit next to the Zone named default

    3. Update the Upstream Auth Address field to $request_host$ and click Save.

      1. image-20240201-000902.png

 

7. Install a Multi-Server Agent Role

  1. 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

image-20240201-001247.png
  1. Enable the Kasm Docker Agent.

    1. From the Admin panel, expand Infrastructure and select Docker Agents

    2. Edit the agent

    3. Enable the “Enable” checkbox and click Save.

    4. 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.)

      1. Automatically Prune Images

      2. Cores Override

      3. GPU Override

      4. Memory Override

 

8. (Optional) Install a Multi-Server Connection Proxy (Guac) Role

If desired, install the Connection Proxy Role using the existing product instructions.

https://kasmweb.com/docs/latest/install/multi_server_install.html#optional-install-connection-proxy-guac-role-s


Note: The Service Registration Token (labeled: “Component Registration Token”) can be retrieved from the Global Settings within the Admin UI:

image-20240201-004950.png

 

9. Complete

The system should now be converted.


Related Docs:

 Related articles

 

Related content