upgrade_zabbix
Differences
This shows you the differences between two versions of the page.
| upgrade_zabbix [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | upgrade_zabbix [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Upgrade Zabbix ====== | ||
| - | ===== Upgrade PostgreSQL ===== | ||
| - | ==== Checando o PostgreSQL Atual ==== | ||
| - | <file bash> | ||
| - | $ sudo su - postgres | ||
| - | $ psql | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | # select version(); | ||
| - | | ||
| - | --------------------------------------------------------------------------------------------------------- | ||
| - | | ||
| - | (1 row) | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | # \db+ | ||
| - | List of tablespaces | ||
| - | Name | Owner | ||
| - | ------------+----------+---------------+-------------------+---------+--------+------------- | ||
| - | | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | # \l+ | ||
| - | List of databases | ||
| - | | ||
| - | -----------+----------+----------+-------------+-------------+-----------------------+---------+------------+-------------------------------------------- | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | (4 rows) | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | # \du+ | ||
| - | List of roles | ||
| - | Role name | | ||
| - | -----------+------------------------------------------------------------+-----------+------------- | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ==== Fazendo upgrade do PostgreSQL ==== | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf install postgresql14-server postgresql14-contrib timescaledb-2-postgresql-14 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo postgresql-14-setup initdb | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | #port = 5432 # (change requires restart) | ||
| - | port = 5433 # (change requires restart) | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl start postgresql-14 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo su - postgres | ||
| - | $ psql -p 5433 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | # select version(); | ||
| - | | ||
| - | --------------------------------------------------------------------------------------------------------- | ||
| - | | ||
| - | (1 row) | ||
| - | |||
| - | postgres=# show port; | ||
| - | port | ||
| - | ------ | ||
| - | 5433 | ||
| - | (1 row) | ||
| - | |||
| - | postgres=# \l | ||
| - | List of databases | ||
| - | | ||
| - | -----------+----------+----------+-------------+-------------+----------------------- | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | (3 rows) | ||
| - | |||
| - | postgres=# \du | ||
| - | List of roles | ||
| - | Role name | | ||
| - | -----------+------------------------------------------------------------+----------- | ||
| - | | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | postgres=# \q | ||
| - | $ ps -ef | grep postmaster | ||
| - | postgres | ||
| - | postgres | ||
| - | postgres | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | pg_ctl: server is running (PID: 6869) | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | pg_ctl: server is running (PID: 10188) | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | waiting for server to shut down.... done | ||
| - | server stopped | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | waiting for server to shut down.... done | ||
| - | server stopped | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | pg_upgrade upgrades a PostgreSQL cluster to a different major version. | ||
| - | |||
| - | Usage: | ||
| - | pg_upgrade [OPTION]... | ||
| - | |||
| - | Options: | ||
| - | -b, --old-bindir=BINDIR | ||
| - | -B, --new-bindir=BINDIR | ||
| - | same directory as pg_upgrade) | ||
| - | -c, --check | ||
| - | -d, --old-datadir=DATADIR | ||
| - | -D, --new-datadir=DATADIR | ||
| - | -j, --jobs=NUM | ||
| - | -k, --link | ||
| - | -o, --old-options=OPTIONS | ||
| - | -O, --new-options=OPTIONS | ||
| - | -p, --old-port=PORT | ||
| - | -P, --new-port=PORT | ||
| - | -r, --retain | ||
| - | -s, --socketdir=DIR | ||
| - | -U, --username=NAME | ||
| - | -v, --verbose | ||
| - | -V, --version | ||
| - | --clone | ||
| - | -?, --help | ||
| - | |||
| - | Before running pg_upgrade you must: | ||
| - | create a new database cluster (using the new version of initdb) | ||
| - | shutdown the postmaster servicing the old cluster | ||
| - | shutdown the postmaster servicing the new cluster | ||
| - | |||
| - | When you run pg_upgrade, you must provide the following information: | ||
| - | the data directory for the old cluster | ||
| - | the data directory for the new cluster | ||
| - | the " | ||
| - | the " | ||
| - | |||
| - | For example: | ||
| - | pg_upgrade -d oldCluster/ | ||
| - | or | ||
| - | $ export PGDATAOLD=oldCluster/ | ||
| - | $ export PGDATANEW=newCluster/ | ||
| - | $ export PGBINOLD=oldCluster/ | ||
| - | $ export PGBINNEW=newCluster/ | ||
| - | $ pg_upgrade | ||
| - | |||
| - | Report bugs to < | ||
| - | PostgreSQL home page: < | ||
| - | </ | ||
| - | |||
| - | ===== Upgrade do timescaledb ===== | ||
| - | |||
| - | <file bash> | ||
| - | $ timescaledb-tune --pg-config=/ | ||
| - | Using postgresql.conf at this path: | ||
| - | / | ||
| - | |||
| - | Is this correct? [(y)es/ | ||
| - | Writing backup to: | ||
| - | / | ||
| - | |||
| - | shared_preload_libraries needs to be updated | ||
| - | Current: | ||
| - | # | ||
| - | Recommended: | ||
| - | shared_preload_libraries = ' | ||
| - | Is this okay? [(y)es/ | ||
| - | success: shared_preload_libraries will be updated | ||
| - | |||
| - | Tune memory/ | ||
| - | Recommendations based on 3.56 GB of available memory and 2 CPUs for PostgreSQL 14 | ||
| - | |||
| - | Memory settings recommendations | ||
| - | Current: | ||
| - | shared_buffers = 128MB | ||
| - | # | ||
| - | # | ||
| - | #work_mem = 4MB | ||
| - | Recommended: | ||
| - | shared_buffers = 932008kB | ||
| - | effective_cache_size = 2730MB | ||
| - | maintenance_work_mem = 466004kB | ||
| - | work_mem = 9320kB | ||
| - | Is this okay? [(y)es/ | ||
| - | success: memory settings will be updated | ||
| - | |||
| - | Parallelism settings recommendations | ||
| - | Current: | ||
| - | missing: timescaledb.max_background_workers | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | Recommended: | ||
| - | timescaledb.max_background_workers = 8 | ||
| - | max_worker_processes = 13 | ||
| - | max_parallel_workers_per_gather = 1 | ||
| - | max_parallel_workers = 2 | ||
| - | Is this okay? [(y)es/ | ||
| - | success: parallelism settings will be updated | ||
| - | |||
| - | WAL settings recommendations | ||
| - | Current: | ||
| - | # | ||
| - | min_wal_size = 80MB | ||
| - | Recommended: | ||
| - | wal_buffers = 16MB | ||
| - | min_wal_size = 512MB | ||
| - | Is this okay? [(y)es/ | ||
| - | success: WAL settings will be updated | ||
| - | |||
| - | Miscellaneous settings recommendations | ||
| - | Current: | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | max_connections = 100 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | Recommended: | ||
| - | default_statistics_target = 500 | ||
| - | random_page_cost = 1.1 | ||
| - | checkpoint_completion_target = 0.9 | ||
| - | max_connections = 50 | ||
| - | max_locks_per_transaction = 64 | ||
| - | autovacuum_max_workers = 10 | ||
| - | autovacuum_naptime = 10 | ||
| - | effective_io_concurrency = 256 | ||
| - | Is this okay? [(y)es/ | ||
| - | success: miscellaneous settings will be updated | ||
| - | Saving changes to: / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | Performing Consistency Checks | ||
| - | ----------------------------- | ||
| - | Checking cluster versions | ||
| - | Checking database user is the install user ok | ||
| - | Checking database connection settings | ||
| - | Checking for prepared transactions | ||
| - | Checking for system-defined composite types in user tables | ||
| - | Checking for reg* data types in user tables | ||
| - | Checking for contrib/isn with bigint-passing mismatch | ||
| - | Checking for user-defined encoding conversions | ||
| - | Checking for user-defined postfix operators | ||
| - | Creating dump of global objects | ||
| - | Creating dump of database schemas | ||
| - | ok | ||
| - | Checking for presence of required libraries | ||
| - | Checking database user is the install user ok | ||
| - | Checking for prepared transactions | ||
| - | Checking for new cluster tablespace directories | ||
| - | |||
| - | If pg_upgrade fails after this point, you must re-initdb the | ||
| - | new cluster before continuing. | ||
| - | |||
| - | Performing Upgrade | ||
| - | ------------------ | ||
| - | Analyzing all rows in the new cluster | ||
| - | Freezing all rows in the new cluster | ||
| - | Deleting files from new pg_xact | ||
| - | Copying old pg_xact to new server | ||
| - | Setting oldest XID for new cluster | ||
| - | Setting next transaction ID and epoch for new cluster | ||
| - | Deleting files from new pg_multixact/ | ||
| - | Copying old pg_multixact/ | ||
| - | Deleting files from new pg_multixact/ | ||
| - | Copying old pg_multixact/ | ||
| - | Setting next multixact ID and offset for new cluster | ||
| - | Resetting WAL archives | ||
| - | Setting frozenxid and minmxid counters in new cluster | ||
| - | Restoring global objects in the new cluster | ||
| - | Restoring database schemas in the new cluster | ||
| - | ok | ||
| - | Copying user relation files | ||
| - | ok | ||
| - | Setting next OID for new cluster | ||
| - | Sync data directory to disk ok | ||
| - | Creating script to delete old cluster | ||
| - | Checking for extension updates | ||
| - | |||
| - | Upgrade Complete | ||
| - | ---------------- | ||
| - | Optimizer statistics are not transferred by pg_upgrade. | ||
| - | Once you start the new server, consider running: | ||
| - | / | ||
| - | |||
| - | Running this script will delete the old cluster' | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ vim 14/ | ||
| - | [...] | ||
| - | port = 5432 # (change requires restart) | ||
| - | #port = 5433 # (change requires restart) | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | waiting for server to start....2022-07-19 12: | ||
| - | 2022-07-19 12: | ||
| - | done | ||
| - | server started | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ psql | ||
| - | psql (14.4) | ||
| - | Type " | ||
| - | |||
| - | postgres=# select version(); | ||
| - | | ||
| - | --------------------------------------------------------------------------------------------------------- | ||
| - | | ||
| - | (1 row) | ||
| - | |||
| - | postgres=# \l+ | ||
| - | List of databases | ||
| - | | ||
| - | -----------+----------+----------+-------------+-------------+-----------------------+---------+------------+-------------------------------------------- | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | (4 rows) | ||
| - | |||
| - | postgres=# \db+ | ||
| - | List of tablespaces | ||
| - | Name | Owner | ||
| - | ------------+----------+---------------+-------------------+---------+--------+------------- | ||
| - | | ||
| - | | ||
| - | | ||
| - | (3 rows) | ||
| - | |||
| - | postgres=# \du+ | ||
| - | List of roles | ||
| - | Role name | | ||
| - | -----------+------------------------------------------------------------+-----------+------------- | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ===== Atualizando o acesso do zabbix ===== | ||
| - | <file bash> | ||
| - | $ vim / | ||
| - | [...] | ||
| - | # Acesso Zabbix | ||
| - | host zabbix | ||
| - | host zabbix | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ vim / | ||
| - | [...] | ||
| - | listen_addresses = ' | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ exit | ||
| - | $ sudo systemctl start postgresql-14 | ||
| - | $ sudo systemctl enable postgresql-14 | ||
| - | $ sudo systemctl disable postgresql-13 | ||
| - | </ | ||
| - | |||
| - | ===== Upgrade do zabbix server ===== | ||
| - | <file bash> | ||
| - | $ sudo systemctl stop zabbix-server | ||
| - | $ sudo systemctl stop zabbix-agent2 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo rpm -Uvh https:// | ||
| - | Retrieving https:// | ||
| - | Verifying... | ||
| - | Preparing... | ||
| - | Updating / installing... | ||
| - | | ||
| - | Cleaning up / removing... | ||
| - | | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf clean all | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf upgrade zabbix-server-pgsql zabbix-agent2 zabbix-selinux-policy zabbix-sql-scripts | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl start zabbix-server | ||
| - | $ sudo systemctl start zabbix-agent2 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ cat / | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ===== Upgrade zabbix web ===== | ||
| - | <file bash> | ||
| - | $ sudo rpm -Uvh https:// | ||
| - | Retrieving https:// | ||
| - | Verifying... | ||
| - | Preparing... | ||
| - | Updating / installing... | ||
| - | | ||
| - | Cleaning up / removing... | ||
| - | | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf clean all | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf upgrade zabbix-web-pgsql zabbix-apache-conf zabbix-agent2 zabbix-selinux-policy | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl restart httpd | ||
| - | </ | ||
| - | |||
| - | ===== Referências ===== | ||
| - | - [[https:// | ||
| - | - [[https:// | ||
upgrade_zabbix.1753560544.txt.gz · Last modified: by wikiadm
