.. title:: Multi Server Upgrade Multi Server Upgrade ================================ Manually ######## Please read through the entire process before getting started. Issues can be reported on the `Kasm Workspaces Issues Page `_ .. include:: /install/offline_install_note.rst .. include:: image_warning.rst * Stop all Kasm Services on all Servers .. code-block:: Bash sudo /opt/kasm/bin/stop Upgrade Database Server Role ------------------------------- Create a Database Backup * Stop existing Kasm Services .. code-block:: Bash sudo /opt/kasm/bin/stop * Execute the database backup utility .. parsed-literal:: sudo mkdir -p /opt/kasm/backups/ sudo bash /opt/kasm/|previous_release|/bin/utils/db_backup -f /opt/kasm/backups/kasm_db_backup.tar -p /opt/kasm/|previous_release|/ * Verify the presence and location of the database backup .. code-block:: Bash sudo ls -al /opt/kasm/backups/kasm_db_backup.tar * Download and extract the new installation media .. parsed-literal:: cd /tmp/ curl -O |release_url| tar -xf kasm_release_*.tar.gz .. note:: If you are performing an offline upgrade please ensure that you have downloaded and installed versions of docker and docker compose that meet the updated system requirements see :doc:`System Requirements <../install/system_requirements>` for details. * Get the existing database password for use in the subsequent commands. .. parsed-literal:: sudo grep " password" /opt/kasm/|previous_release|/conf/app/api.app.config.yaml * Get the existing redis password for use in the subsequent commands. .. parsed-literal:: sudo grep "redis_password" /opt/kasm/|previous_release|/conf/app/api.app.config.yaml **Perform a clean install** Perform a clean install of the Database Role Services * Install kasm from the release media downloaded in the prior steps. * When performing an offline update add these flags ``-w -s `` .. code-block:: Bash sudo bash kasm_release/install.sh -S db -D -Q -R Restore and upgrade the database --------------------------------- Restore and update the database from the prior version * Ensure all Kasm services are stopped .. code-block:: Bash sudo /opt/kasm/bin/stop * Execute the database restore command .. parsed-literal:: sudo /opt/kasm/|release|/bin/utils/db_restore -f /opt/kasm/backups/kasm_db_backup.tar -p /opt/kasm/|release|/ * Perform an upgrade of the database schema .. parsed-literal:: sudo /opt/kasm/|release|/bin/utils/db_upgrade -p /opt/kasm/|release| * **Advanced**: Review the contents of the existing configs to ensure any custom docker settings are migrated to the new configuration. .. parsed-literal:: diff /opt/kasm/|previous_release|/docker/docker-compose.yaml /opt/kasm/|release|/docker/docker-compose.yaml * Install The Kasm |release| Default Images for your platform * If doing an offline upgrade first extract the default image seed data from the workspace images tar For x86 (amd64) platforms: .. parsed-literal:: tar xf --strip-components=1 -C /opt/kasm/|release|/conf/database/seed_data/ workspace_images/default_images_amd64.yaml For ARM (arm64) platforms: .. parsed-literal:: tar xf --strip-components=1 -C /opt/kasm/|release|/conf/database/seed_data/ workspace_images/default_images_arm64.yaml For x86 (amd64) platforms: .. parsed-literal:: sudo /opt/kasm/|release|/bin/utils/db_init -s /opt/kasm/|release|/conf/database/seed_data/default_images_amd64.yaml For ARM (arm64) platforms: .. parsed-literal:: sudo /opt/kasm/|release|/bin/utils/db_init -s /opt/kasm/|release|/conf/database/seed_data/default_images_arm64.yaml * Start the Kasm services .. code-block:: Bash sudo /opt/kasm/bin/start Upgrade Web App Server Role ------------------------------- * Stop existing Kasm Services .. code-block:: Bash sudo /opt/kasm/bin/stop * Download and extract the new installation media .. code-block:: Bash cd /tmp/ curl -O |release_url| tar -xf kasm_release_*.tar.gz .. note:: If you are performing an offline upgrade please ensure that you have downloaded and installed versions of docker and docker compose that meet the updated system requirements see :doc:`System Requirements <../install/system_requirements>` for details. * Install kasm from the release media downloaded in the prior steps. * When performing an offline update add this flag ``-s `` .. code-block:: Bash sudo bash kasm_release/install.sh -S app -D -q -Q -R [REDIS_PASSWORD] * Copy **manager_id** and **server_hostname** from the old configuration into the new .. parsed-literal:: grep manager_id /opt/kasm/|previous_release|/conf/app/api.app.config.yaml grep server_hostname /opt/kasm/|previous_release|/conf/app/api.app.config.yaml sudo vi /opt/kasm/|release|/conf/app/api.app.config.yaml * **Advanced**: Review the contents of the existing configs to ensure any custom docker settings are migrated to the new configuration. .. parsed-literal:: diff /opt/kasm/|previous_release|/docker/docker-compose.yaml /opt/kasm/|release|/docker/docker-compose.yaml * Start the Kasm services .. code-block:: Bash sudo /opt/kasm/bin/start Upgrade Agent Server Role -------------------------- * Ensure all Kasm services are stopped .. code-block:: Bash sudo /opt/kasm/bin/stop * Download and extract the new installation media .. parsed-literal:: cd /tmp/ curl -O |release_url| tar -xf kasm_release_*.tar.gz * Get the existing manager token for use in the subsequent commands. .. parsed-literal:: sudo grep "token" /opt/kasm/|previous_release|/conf/app/agent.app.config.yaml .. note:: If you are performing an offline upgrade please ensure that you have downloaded and installed versions of docker and docker compose that meet the updated system requirements see :doc:`System Requirements <../install/system_requirements>` for details. * Install kasm from the release media downloaded in the prior steps. * When performing an offline update add these flags ``-w -s `` .. code-block:: Bash sudo bash kasm_release/install.sh -S agent -D -p -m -M * Copy the server_id and the public_hostname properties from the old agent to the new .. parsed-literal:: grep server_id /opt/kasm/|previous_release|/conf/app/agent.app.config.yaml grep public_hostname /opt/kasm/|previous_release|/conf/app/agent.app.config.yaml sudo vi /opt/kasm/|release|/conf/app/agent.app.config.yaml * Copy the auto-generated nginx configs for any sessions that may exists on the Agent .. parsed-literal:: sudo cp /opt/kasm/|previous_release|/conf/nginx/containers.d/* /opt/kasm/|release|/conf/nginx/containers.d/ * **Advanced**: Review the contents of the existing configs to ensure any custom docker settings are migrated to the new configuration. .. parsed-literal:: diff /opt/kasm/|previous_release|/docker/docker-compose.yaml /opt/kasm/|release|/docker/docker-compose.yaml diff /opt/kasm/|previous_release|/conf/app/agent.app.config.yaml /opt/kasm/|release|/conf/app/agent.app.config.yaml * Start the Kasm services .. code-block:: Bash sudo /opt/kasm/bin/start * Verify the Agent Service is properly checking into the Manager Service. Log into the UI as an Administrator. Select **Agents** and verify the Agent is listed with a **Last Reported** time of less than 1 minute. If the agent has not checked in, it likely can’t resolve or connect to [AGENT_HOSTNAME]:443 . Inspect the logs for details. .. code-block:: bash sudo tail -f /opt/kasm/current/log/agent.log .. include:: upgrade_images.rst :start-line: 2 Upgrade Script ############## Since Kasm Workspaces version 1.11.0 an upgrade script is included with the installation package under kasm_release/upgrade.sh. .. note:: This script is compatible with multi server installations as long as the databases used for the deployment are Kasm Workspaces containers. It will not function with in house or cloud based PostgreSQL/Redis deployments. The upgrade script can be found in the installation package under kasm_release/upgrade.sh. These instructions assume there are 3 servers with the app, db, and agent roles. Login to your db server and execute: .. code-block:: Bash sudo bash kasm_release/upgrade.sh --role db Login to your agent server and execute: .. code-block:: Bash sudo bash kasm_release/upgrade.sh --role agent Login to your aapp server and execute: .. code-block:: Bash sudo bash kasm_release/upgrade.sh --role app You can also handle basic image management functions using the helper flags during the upgrade process: .. code-block:: text Flag Description ------------------------------------------------------------------------------------ | -h|--help | Display this help menu | | -L|--proxy-port | Default Proxy Listening Port | | -I|--no-images | Don't seed or pull default Workspaces Images | | -U|--upgrade-images | Upgrade Images to current set purging previous images | | -K|--add-images | Ingest the latest images keeping old images in place | | -w|--offline-workspaces | Path to the tar.gz workspace images offline installer | | -s|--offline-service | Path to the tar.gz service images offline installer | | -S|--role | Role to Upgrade: [app|db|agent] | ------------------------------------------------------------------------------------