Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMIG and version 6.10

...

Sv translation
languageen

The update is to be held within the console of the server to be updated.

The update process can be performed in two modes:

  • BACKUP - in this mode entire DB is being copied, including all the IWTM DB scheme tablespaces. The disk, where IWTM DB scheme tablespaces are located should contain as much free space as they have already taken;
  • LINK - in this mode DB files are not being copied and the hard links are created from new folders instead of long-time DB. Once the new version is installed and launched, the old one doesn't operate. That's why before updating the DB in the LINK mode it is required totally backing up the previous DB including all the tablespaces. In this mode you may require up to 100 Mb free space.
Информация
titleNote:

If you connect remotely via SSH, it is recommended using the Screen utility. Thus you can avoid problems in case of loosing lost connection with updating server. When disconnecting from the utility, all the prcocesses started are not to be interrupted and you may safely continue the System update.

Important! Using Screen is highly recommended when working with DB and updating SMDBDBMS.

Basic commands:

  • screen - start the utility;
  • Ctrl+a d - disconnect from screen (to be input within the screen window);
  • screen -ls - display the list of screen running;
  • screen -r - connect to screen again;
  • screen -r name - connect to specific screen with «name»;
  • exit - exit screen (to be input within the screen window).

Preparations for update 

 

  1. Before updating the SMDBDBMS, Traffic Monitor packages are required updating up to actual version, new version PostgreSQL packages are to be installed along with it.
  2. Set up the update script. For this purpose:
    a. Enter the command to open the file manager:
    mc
    b. Go to /opt/iw/tm5/csw/postgres/scripts/update_from_version 1_to_version_2 directory, where 
    version 1 - SMDB DBMS old version, version 2 - SMDB DBMS new version.
    Example: /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6
    c. Select the file pdate_from_версия 1_to_версия 2.sh and press F4 to edit it.

    Example:
    update_from_9.4_to_9.6.sh

    d. Depending on the mode you've selected replace the value of UPDATEMODE parameter with BACKUP or LINK (by default - BACKUP).
    e. Set the value of PARALLEL_DEGREE parameter equal to the number of   DB server CPU cores (by default - 8). This parameter influences the update processing speed.
    f. Press F2.
    g. In the opened ensure saving the file by clicking Save.
    h. Press  F10.
    i. Press F3 and make sure the file is correct, then press F3 again to close the file.
    j. Enter the command to close file manager:
    exit
  3. Before updating the SMDB all DBMS all Traffic Monitor services should be stopped. Enter the commands for this purpose:
    a. For Traffic Monitor All-in-one installation:
    service iwtm stop
    service iwtm-php-fpm stop
    service nags stop
    b. For Traffic Monitor distributed installation:
        i. On Traffic Monitor server:
    service    service iwtm stop
       service iwtm-php-fpm stop
       service nags stop
     ii. On DB server:
       service iwtm stop

Update

  1. Enter the command to go to the required directory:
    cd /opt/iw/tm5/csw/postgres/scripts/update_from_<version_1>_to_<version_2>
    where  <version_1> - old SMBD DBMS version, <version_2> - new SMBD new DBMS version.
    Example:
    cd /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6
  2. Set up the update script. For this purpose enter the command:
    bash ./update_from_<version_1>_to_<version_2>.sh
    Example:
    bash ./update_from_9.4_to_9.6.sh
  3. Once the update process is over, connect to DB and check its working capacity:
    a. To connect to DB server from console, enter the command:
      su - iwtm
      psql postgres iwtm -p 5433

    b. To verify the version of SMDB installed DBSM installed enter the command:
      select version();
    c. Then enter the commands:
      select* from version;
      explain (analyze, buffers) select * from object_comment;

    The commands should be entered with no mistakes.
    d. To exit enter the command:
      \q
    e. Enter the command:
      exit

    Информация
    titleNote:

    Also, this check can be performed on Windows managed computers. pgAdmin should be used for this purpose.

    The check is to be performed using the same commands (steps b. and c.).

  4. Follow the System updates instructions.

An old DB backup removal

If BACKUP update mode is used, the System creates an old DB backup.

Информация
titleNote:

Before removing the new version, working capacity should be checked: make sure the events are loaded into DB and the events search is active. Few days are required for this purpose.

Removing is to be performed within the DB server console. To remove old DB backup, enter the command:

  1. Enter the command to go to the required directory:
    cd /var/log/infowatch/update/postgres<version_2>_update_дата
    где  <version_2> - SMDB new DBSM new version, date - update date.
    Example:
    cd /var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06
  2. Set up the removal script. For this purpose enter the command:
    bash ./delete_old_cluster.sh
  3. Removal process cannot be displayed within the console and is successful in case there is no error message.

    Предупреждение
    titleImportant!

    Once backup is removed, back to remain is impossible.

Update fallback

Информация
titleNote:

SMDB DBMS update fallback is used only in case of repeated update, once the error occured.


The update fallback is possible, when:

  • The update was performed in BACKUP mode;
  • Before the update backup was manually created in LINK mode.

The update fallback is to be preformed within the DB console. To fallback it is required:

  • If the update was performed in BACKUP mode:
  1. Enter the command to go to the required directory: 
    cd /opt/iw/tm5/csw/postgres/scripts/update_from_<version_1>_to_<version_2>
    where  <version_1> - and old SMDB DBMS version, <version_2> - new SMDB DBMS version.
    Example:
    cd /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6
  2. To run the update fallback script, enter the command:
    bash ./update_from_<version_1>_to_<version_2>.sh rollback
    Example:
    bash ./update_from_9.4_to_9.6.sh rollback
  • If the update was performed in LINK mode:
  1. To stop  postgresql and pgagent services of old and new versions, enter the commands:
    service pgagent-9.4 stop
    service pgagent-9.6 stop
    service postgresql-9.4 stop
    service postgresql-9.6 stop
  2. Replace the updated files and DB directories with the ones that were created as the reserved copies.
  3. To start  postgresql and pgagent services of old version, enter the commands:
    service pgagent-9.4 start
    service postgresql-9.4 start

Error alert

 

If an error occurs, the logs should be collected and sent to Service Desk.

If an error occurred:

  • During the update or when the update services were started:
    1. Logs from the update folder.
    Example: /var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06
    2. All the logs from folders /u01/postgres*/pg_log.

  • During the update fallback:
    1. File named rollback.log from updates lost folder.
    Example: /var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06
    2. All the logs from folders u01/postgres*/pg_log.