Top.Mail.Ru
Updating Operavix on Linux
CTRL+K

Updating Operavix on Linux

In this article
  • Updating Operavix on Linux
  • Verifying Current Settings
  • Creating Data Backups
  • Installing the Operavix Update
  • Performing a Rollback of the System

Before updating the server components of the system, it is recommended to verify their current startup parameters.

Verifying Current Settings

To obtain the list of running Docker services, execute the following command on the servers where the system components are installed:

$ docker service ls

Compare the service names (NAME column) and the current versions of the used images (IMAGE column).

For detailed information, execute the following command for each Docker service:

$ docker service inspect --pretty service_name

If the service was previously started by the same OS user, execute the following command to obtain an example of the last service startup commands:

$ history | grep 'docker service create'

To get the list of available Docker images in the system, execute the following command:

$ docker images

Creating Data Backups

Before upgrading, you must create backups of the system's server component data. Use your preferred backup methods, such as creating virtual machine snapshots.

Example of backing up Operavix and ClickHouse services:

  1. Stop the services on the servers using the following command:
    $ docker service rm operavix-app
    $ docker service rm operavix-clickhouse
  1. Create copies of the data.
    • Backing up Operavix service data:
        $ docker run -it --rm \
        --mount source=operavix-app-data,target=/app-data \
        -v /var/tmp:/target \
        operavix/operavix_app:VERSION \
        /bin/bash -c "tar -cvf /target/operavix-app-backup.tar /app-data"
      
      Where VERSION is the tag of the current Operavix version.
    • Backing up ClickHouse service data:
        $ docker run -it --rm \
        --mount source=operavix-clickhouse,target=/clickhouse-data \
        -v /var/tmp:/target \
        operavix/operavix-clickhouse:CH_VERSION \
        /bin/bash -c "tar -cvf /target/clickhouse-backup.tar /clickhouse-data"
      
      Where CH_VERSION is the tag of the current ClickHouse version.
    As a result, two archive files will be created in the /var/tmp directory on the host operating system. If needed, move them to a more secure location.

Installing the Operavix Update

To install the update:

  1. Download the image of the new Operavix version to the local Docker image repository.
    $ gunzip operavix_docker_app_d230101.tar.gz
    $ docker load < operavix_docker_app_d230101.tar
    
    Note: The version in the filename is for illustrative purposes only. Be sure to specify the file that matches the version you are installing.
  2. Start the ClickHouse service. The service startup command may vary slightly depending on the situation. Refer to the "Verifying Current Settings" section to restore the last startup command. If you are unable to find the previously used command, refer to the Operavix installation documentation to create the necessary service startup command. An example of the command to start the ClickHouse service:
    $ docker service create --name operavix-clickhouse \
    --secret operavix_app_user \
    --secret operavix_app_user_password_hash \
    --secret operavix_external_user \
    --secret operavix_external_user_password_hash \
    --secret operavix_clickhouse_dhparam.pem \
    --secret operavix_clickhouse.crt \
    --secret operavix_clickhouse.key \
    --publish published=8123,target=8123,mode=host \
    --mount type=volume,src=operavix-clickhouse,target=/var/lib/clickhouse/ \
    --mount type=volume,src=operavix-clickhouse-log,target=/var/log/clickhouse-server \
    --restart-max-attempts 5 \
    --restart-condition "on-failure" \
    --no-resolve-image \
    operavix/operavix-clickhouse:24.3.2.23
    
    Note: The image name with version is shown for example purposes only. Replace it with the version you are installing.
  3. Start the Operavix service using the Docker image of the new version. Refer to the "Verifying Current Settings" section to restore the last start command. An example of the command:
    $ docker service create --name operavix-app \
    --secret operavix_app_https_certificate \
    --secret operavix_app_https_certificate_password \
    --mount type=volume,src=operavix-app-data,target=/var/lib/operavix/data/ \
    --mount type=volume,src=operavix-app-log,target=/var/log/operavix/ \
    --publish published=8010,target=8010,mode=host \
    --restart-max-attempts 5 \
    --restart-condition "on-failure" \
    -e JVM_MAX_MEMORY='4G' \
    operavix/operavix_app:NEW_VERSION
    
    Where NEW_VERSION is the tag of the current Operavix version.
Advice

If necessary, the first service launch can be performed on a different network port to prevent the monitoring agents and users from accessing the server until you ensure that the system is working. To do this, replace the "published=" value with the desired port. For subsequent launches of the service on the production port, you will need to restart it with the specified working port.

The update has been installed. Check the operation of the system's web interface, test the connection to ClickHouse in the "Data storages" section. Check for errors in the Operavix logs by running the following command:

# docker service logs operavix-app 2>&1 | grep 'ERROR'

In case of critical issues with the operation of the update, perform the system rollback.

Performing a Rollback of the System

In case the system update resulted in critical errors preventing the system from functioning properly, perform a rollback according to the following instructions.

  1. Stop the Operavix and ClickHouse services on the servers where they are installed:
    • Stopping the Operavix service:
      $ docker service rm operavix-app
      
    • Stopping the ClickHouse service:
      $ docker service rm operavix-clickhouse
      
  2. As an additional precaution, make backups of the Docker volume files with data.
    • On the server where the Operavix service is installed:
      # tar -czv --same-permissions --same-owner -f operavix-app-volume-$(date -u +%d.%m.%Y).tar.gz /var/lib/docker/volumes/operavix-app-data/
      
    • On the server where the ClickHouse service is installed:
       # tar -czv --same-permissions --same-owner -f operavix-ch-volume-$(date -u +%d.%m.%Y).tar.gz /var/lib/docker/volumes/operavix-clickhouse/
      
  3. Remove and recreate the volume with data using the commands described below.
    • Remove and recreate the volume containing data on the Operavix service server:
      # docker volume rm operavix-app-data
      # docker volume create operavix-app-data
      
    • Remove and recreate the volume containing data on the ClickHouse service server:
      # docker volume rm operavix-clickhouse
      # docker volume create operavix-clickhouse
      
  4. Restore the Operavix service data on the server where the service was installed using the following command:
    • Restoring Operavix service data:
        $ docker run -it --rm \
        --mount source=operavix-app-data,target=/app-data \
        -v /var/tmp:/target \
        operavix/operavix_app:VERSION \
        /bin/bash -c "tar -xvf /target/operavix-app-backup.tar -C /"
      
    • Restoring ClickHouse service data:
        $ docker run -it --rm \
        --mount source=operavix-clickhouse,target=/clickhouse-data \
        -v /var/tmp:/target \
        operavix/operavix-clickhouse:24.3.2.23 \
        /bin/bash -c "tar -xvf /target/clickhouse-backup.tar -C /"
      
  5. Start the Operavix and ClickHouse services using the command that was previously used for this purpose.

Was the article helpful?

Yes
No
Previous
Updating Operavix on Windows
We use cookies to improve our website for you.