| Sv translation | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
Обновление СУБД PostgreSQL с версии 9.4 до версии 9.6 будет вестись в консоли обновляемого сервера.
Подготовка к обновлениюservice nagios3
Предупреждение | | ||||||||||
|
| Информация | ||
|---|---|---|
| ||
Также эту проверку можно произвести с рабочих станций под управлением Windows. Для этого используйте программу pgAdmin. |
Удаление бэкапа старой БД
Если использовался режим обновления BACKUP, системой создан бэкап старой БД.
| Информация | ||
|---|---|---|
| ||
Перед удалением необходимо проверить работоспособность новой версии: убедиться в том, что события загружаются в БД, а также работает поиск по событиям. |
Удаление будет вестись в консоли сервера БД. Чтобы удалить бэкап старой БД выполните команды:
- Введите команду для перехода в нужную директорию:
cd /var/log/infowatch/update/postgres<версия_2>postgres96_update_дата
где<версия_2>- новая версия СУБД, дата - дата обновления.
В нашем примере:cd /var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06 - Для запуска скрипта удаления выполните команду:
bash ./delete_old_cluster.sh - Процесс удаления не будет отображаться в консоли и будет успешно завершен, если не выведено сообщение об ошибке.
| Предупреждение | ||
|---|---|---|
| ||
После удаления бэкапа нельзя будет откатиться к старой версии. |
Откат обновления
| Информация | ||
|---|---|---|
| ||
Откат СУБД используется только для повторного обновления, если в процессе возникла ошибка. |
Откат обновления возможен, если:
- Обновление проводилось в режиме BACKUP.
- Перед обновлением в режиме LINK был создан бэкап вручную.
Откат обновления будет вестись в консоли сервера БД. Для отката обновления необходимо:
- Если обновление проводилось в режиме BACKUP:
- Введите команду для перехода в нужную директорию:
cd /opt/iw/tm5/csw/postgres/scripts/update_from_<версия_1>_to_<версия_2>
где<версия_1>- старая версия СУБД,<версия_2>- новая версия СУБД.
В нашем примере:cd /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6 - Для запуска скрипта отката обновления введите команду:
bash ./update_from_<версия_1>_to_<версия_2>.sh rollbackВ нашем примере:bash ./update_from_9.4_to_9.6.sh rollback
- Введите команду для перехода в нужную директорию:
- Если обновление проводилось в режиме LINK:
Для остановки сервисов
postgresqlиpgagentстарой и новой версий введите команды:service pgagent-9.4 stopservice pgagent-9.6 stopservice postgresql-9.4 stopservice postgresql-9.6 stop- Замените обновленные файлы и директории БД на созданные в результате резервного копирования.
Для запуска сервисов
postgresqlиpgagentстарой версии введите команды:service pgagent-9.4 startservice postgresql-9.4 start
Действия при ошибках
Если возникает ошибка, соберите логи и отправьте их в службу технической поддержки.
Если ошибка возникла:
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.
| Информация | ||
|---|---|---|
| ||
If you connect remotely via SSH, it is recommended using the Screen utility. Thus you can avoid problems in case of 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 DBMS. Basic commands:
|
Preparations for update
a. Enter the command to open the file manager:
mcb. Go to
/opt/iw/tm5/csw/postgres/scripts/update_from_version 1_to_version_2 directory, where
version 1 - DBMS old version, version 2 - 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.shd. 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:
exita. For Traffic Monitor All-in-one installation:
service iwtm stopservice iwtm-php-fpm stopservice nags stopb. For Traffic Monitor distributed installation:
i. On Traffic Monitor server:
service iwtm stop service iwtm-php-fpm stop service nags stop ii. On DB server: service iwtm stopUpdate
- 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 DBMS version,<version_2>- new DBMS version.
Example:cd /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6 - 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 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 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Информация title Note: 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.).
- Follow the System updates instructions.
An old DB backup removal
If BACKUP update mode is used, the System creates an old DB backup.
| Информация | ||
|---|---|---|
| ||
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:
- Enter the command to go to the required directory:
cd /var/log/infowatch/update/postgres<version_2>_update_дата
где<version_2>- DBSM new version, date - update date.
Example:cd /var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06 - Set up the removal script. For this purpose enter the command:
bash ./delete_old_cluster.sh Removal process cannot be displayed within the console and is successful in case there is no error message.
Предупреждение title Important! Once backup is removed, back to remain is impossible.
Update fallback
| Информация | ||
|---|---|---|
| ||
DBMS update fallback is used only in case of repeated update, once the error occured. |
- 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:
cd /opt/iw/tm5/csw/postgres/scripts/update_from_<version_1>_to_<version_2>where
<version_1> - and old DBMS version, <version_2> - new DBMS version.Example:
cd /opt/iw/tm5/csw/postgres/scripts/update_from_9.4_to_9.6bash ./update_from_<version_1>_to_<version_2>.sh rollbackExample:
bash .
- В процессе обновления или при запуске сервисов после обновления:
- Логи из папки обновления.
В нашем примере:/var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06 - Все логи из папок
/u01/postgres*/pg_log.
- Логи из папки обновления.
- В процессе отката обновления:
- Файл с имененм rollback.log из папки логов обновления.
В нашем примере:/var/log/infowatch/update/postgres96_update_2018-01-29_15:37:06 - Все логи из папок
/u01/postgres*/pg_log.
- Файл с имененм rollback.log из папки логов обновления.
| language | en |
|---|
/
- If the update was performed in LINK mode:
- To stop
postgresqlandpgagentservices of old and new versions, enter the commands:service pgagent-9.4 stopservice pgagent-9.6 stopservice postgresql-9.4 stopservice postgresql-9.6 stop - Replace the updated files and DB directories with the ones that were created as the reserved copies.
- To start
postgresqlandpgagentservices of old version, enter the commands:service pgagent-9.4 startservice 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 foldersu01/postgres*/pg_log.


