Lassan két hónapja, hogy megjelent a 7.0-s verzió, ám nekem csak tegnap volt időm elmélyedni a frissítési leírásokban.
Az általam használt környezet így néz ki:
- a legtöbb zabbix agentem 6.0-s verziójú, néhány darab régebbi (mivel nincs arra a rendszerre újabb kiadás, pl bizonyos appliance-k)
- a zabbix proxyk mind 6.0-s verzión állnak
- és természetesen a webes frontend és a zabbix szerver is mind 6.0-s verziójú
A frissítés menete:
- a lehető legfontosabb szabály, hogy leállított zabbix szerver mellett készítsünk mentést az adatbázisról!
- miután ez elkészült, írjuk át a frontend és a szerver verzióját a docker-compose.yml fájlban erről: image: zabbix/zabbix-server-mysql:alpine-6.0-latest erre: image: zabbix/zabbix-server-mysql:alpine-7.0-latest
- indítsuk el a konténereket:
sudo docker compose up -d
- előbb letölti a frontend és a szerver image-eket, majd elindítja őket, ha kellően gyorsan kiadjuk a
docker logs -f zabbix-server
parancsot, akkor ehhez hasonlót fogtok látni:
Starting Zabbix Server. Zabbix 7.0.1 (revision 0543fbe).
Press Ctrl+C to exit.
1:20240727:210955.013 Starting Zabbix Server. Zabbix 7.0.1 (revision 0543fbe).
1:20240727:210955.013 ****** Enabled features ******
1:20240727:210955.013 SNMP monitoring: YES
1:20240727:210955.013 IPMI monitoring: YES
1:20240727:210955.013 Web monitoring: YES
1:20240727:210955.013 VMware monitoring: YES
1:20240727:210955.013 SMTP authentication: YES
1:20240727:210955.013 ODBC: YES
1:20240727:210955.013 SSH support: YES
1:20240727:210955.013 IPv6 support: YES
1:20240727:210955.013 TLS support: YES
1:20240727:210955.013 ******************************
1:20240727:210955.013 using configuration file: /etc/zabbix/zabbix_server.conf
1:20240727:210955.061 current database version (mandatory/optional): 06000000/06000045
1:20240727:210955.061 required mandatory version: 07000000
1:20240727:210955.061 mandatory patches were found
1:20240727:210955.077 starting automatic database upgrade
1:20240727:210955.113 completed 0% of database upgrade
1:20240727:210955.408 completed 1% of database upgrade
1:20240727:210955.482 completed 2% of database upgrade
1:20240727:210955.513 completed 3% of database upgrade
1:20240727:210955.550 completed 4% of database upgrade
1:20240727:210955.656 completed 5% of database upgrade
1:20240727:210955.696 completed 6% of database upgrade
1:20240727:210955.731 completed 7% of database upgrade
1:20240727:210955.756 completed 8% of database upgrade
1:20240727:210955.795 completed 9% of database upgrade
1:20240727:210955.832 completed 10% of database upgrade
1:20240727:210955.863 completed 11% of database upgrade
1:20240727:210955.895 completed 12% of database upgrade
1:20240727:210956.331 completed 13% of database upgrade
1:20240727:210956.862 completed 14% of database upgrade
1:20240727:210956.989 completed 15% of database upgrade
1:20240727:210957.123 completed 16% of database upgrade
1:20240727:210957.146 completed 17% of database upgrade
1:20240727:210957.199 completed 18% of database upgrade
1:20240727:210957.235 completed 19% of database upgrade
1:20240727:210957.263 completed 20% of database upgrade
1:20240727:210957.287 completed 21% of database upgrade
1:20240727:210957.310 completed 22% of database upgrade
1:20240727:210957.354 completed 23% of database upgrade
1:20240727:210957.430 completed 24% of database upgrade
1:20240727:210957.476 completed 25% of database upgrade
1:20240727:210957.515 completed 26% of database upgrade
1:20240727:210957.559 completed 27% of database upgrade
1:20240727:210957.574 hosts_name_upper_update trigger for table "hosts" already exists, skipping patch of adding "name_upper" column to "hosts" table
1:20240727:210957.578 hosts_name_upper_update trigger for table "hosts" already exists, skipping patch of adding index to "name_upper" column
1:20240727:210957.580 hosts_name_upper_update trigger for table "hosts" already exists, skipping patch of updating "name_upper" column
1:20240727:210957.581 completed 28% of database upgrade
1:20240727:210957.583 hosts_name_upper_insert trigger for table "hosts" already exists, skipping patch of adding it to "hosts" table
1:20240727:210957.589 hosts_name_upper_update trigger for table "hosts" already exists, skipping patch of adding it to "hosts" table
1:20240727:210957.592 items_name_upper_update trigger for table "items" already exists, skipping patch of adding "name_upper" column to "items" table
1:20240727:210957.595 items_name_upper_update trigger for table "items" already exists, skipping patch of adding index to "name_upper" column
1:20240727:210957.598 items_name_upper_update trigger for table "items" already exists, skipping patch of updating "name_upper" column
1:20240727:210957.599 completed 29% of database upgrade
1:20240727:210957.601 items_name_upper_insert trigger for table "items" already exists, skipping patch of adding it to "items" table
1:20240727:210957.604 items_name_upper_update trigger for table "items" already exists, skipping patch of adding it to "items" table
1:20240727:210957.658 completed 30% of database upgrade
1:20240727:210957.722 completed 31% of database upgrade
1:20240727:210957.758 completed 32% of database upgrade
1:20240727:210957.795 completed 33% of database upgrade
1:20240727:210957.835 completed 34% of database upgrade
1:20240727:210957.892 completed 35% of database upgrade
1:20240727:210957.927 completed 36% of database upgrade
1:20240727:210957.988 completed 37% of database upgrade
1:20240727:210958.035 completed 38% of database upgrade
1:20240727:210958.071 completed 39% of database upgrade
1:20240727:210958.106 completed 40% of database upgrade
1:20240727:210958.150 completed 41% of database upgrade
1:20240727:210958.178 completed 42% of database upgrade
1:20240727:210958.205 completed 43% of database upgrade
1:20240727:210958.250 completed 44% of database upgrade
1:20240727:210958.276 completed 45% of database upgrade
1:20240727:210958.305 completed 46% of database upgrade
1:20240727:210958.373 completed 47% of database upgrade
1:20240727:210958.401 completed 48% of database upgrade
1:20240727:210958.472 completed 49% of database upgrade
1:20240727:210958.491 completed 50% of database upgrade
1:20240727:210958.523 completed 51% of database upgrade
1:20240727:210958.553 completed 52% of database upgrade
1:20240727:210958.575 completed 53% of database upgrade
1:20240727:210958.597 completed 54% of database upgrade
1:20240727:210958.642 completed 55% of database upgrade
1:20240727:210958.676 completed 56% of database upgrade
1:20240727:210958.719 completed 57% of database upgrade
1:20240727:210958.744 completed 58% of database upgrade
1:20240727:210958.760 completed 59% of database upgrade
1:20240727:210958.767 completed 60% of database upgrade
1:20240727:210958.772 completed 61% of database upgrade
1:20240727:210958.778 completed 62% of database upgrade
1:20240727:210958.792 completed 63% of database upgrade
1:20240727:210958.813 completed 64% of database upgrade
1:20240727:210958.843 completed 65% of database upgrade
1:20240727:210958.886 completed 66% of database upgrade
1:20240727:210959.055 completed 67% of database upgrade
1:20240727:210959.080 completed 68% of database upgrade
1:20240727:210959.099 completed 69% of database upgrade
1:20240727:210959.113 completed 70% of database upgrade
1:20240727:210959.126 completed 71% of database upgrade
1:20240727:210959.144 completed 72% of database upgrade
1:20240727:210959.360 completed 73% of database upgrade
1:20240727:210959.453 completed 74% of database upgrade
1:20240727:210959.469 completed 75% of database upgrade
1:20240727:210959.492 completed 76% of database upgrade
1:20240727:210959.500 completed 77% of database upgrade
1:20240727:210959.528 completed 78% of database upgrade
1:20240727:210959.601 completed 79% of database upgrade
1:20240727:210959.656 completed 80% of database upgrade
1:20240727:210959.689 completed 81% of database upgrade
1:20240727:210959.745 completed 82% of database upgrade
1:20240727:210959.765 completed 83% of database upgrade
1:20240727:210959.789 completed 84% of database upgrade
1:20240727:210959.824 completed 85% of database upgrade
1:20240727:210959.865 completed 86% of database upgrade
1:20240727:210959.926 completed 87% of database upgrade
1:20240727:210959.962 completed 88% of database upgrade
1:20240727:210959.994 completed 89% of database upgrade
1:20240727:211000.193 completed 90% of database upgrade
1:20240727:211000.229 completed 91% of database upgrade
1:20240727:211000.253 completed 92% of database upgrade
1:20240727:211000.287 completed 93% of database upgrade
1:20240727:211000.321 completed 94% of database upgrade
1:20240727:211000.422 completed 95% of database upgrade
1:20240727:211000.448 completed 96% of database upgrade
1:20240727:211000.486 completed 97% of database upgrade
1:20240727:211000.507 completed 98% of database upgrade
1:20240727:211000.518 completed 99% of database upgrade
1:20240727:211000.523 completed 100% of database upgrade
1:20240727:211000.555 database upgrade fully completed
1:20240727:211000.565 database could be upgraded to use primary keys in history tables
205:20240727:211000.568 starting HA manager
205:20240727:211000.583 HA manager started in active mode
1:20240727:211000.584 server #0 started [main process]
206:20240727:211000.585 server #1 started [service manager #1]
207:20240727:211000.586 server #2 started [configuration syncer #1]
208:20240727:211000.842 server #3 started [alert manager #1]
210:20240727:211000.853 server #5 started [alerter #2]
209:20240727:211000.853 server #4 started [alerter #1]
211:20240727:211000.861 server #6 started [alerter #3]
212:20240727:211000.865 server #7 started [preprocessing manager #1]
213:20240727:211000.873 server #8 started [lld manager #1]
215:20240727:211000.897 server #10 started [lld worker #2]
216:20240727:211000.898 server #11 started [housekeeper #1]
217:20240727:211000.899 server #12 started [timer #1]
218:20240727:211000.900 server #13 started [http poller #1]
219:20240727:211000.901 server #14 started [browser poller #1]
214:20240727:211000.914 server #9 started [lld worker #1]
220:20240727:211000.931 server #15 started [discovery manager #1]
221:20240727:211000.936 server #16 started [history syncer #1]
222:20240727:211000.939 server #17 started [history syncer #2]
223:20240727:211000.940 server #18 started [history syncer #3]
224:20240727:211000.950 server #19 started [history syncer #4]
225:20240727:211000.958 server #20 started [escalator #1]
226:20240727:211000.981 server #21 started [proxy poller #1]
227:20240727:211000.996 server #22 started [self-monitoring #1]
228:20240727:211001.012 server #23 started [task manager #1]
229:20240727:211001.021 server #24 started [poller #1]
230:20240727:211001.049 server #25 started [poller #2]
231:20240727:211001.065 server #26 started [poller #3]
232:20240727:211001.080 server #27 started [poller #4]
233:20240727:211001.100 server #28 started [poller #5]
234:20240727:211001.141 server #29 started [unreachable poller #1]
235:20240727:211001.178 server #30 started [trapper #1]
236:20240727:211001.223 server #31 started [trapper #2]
237:20240727:211001.265 server #32 started [trapper #3]
238:20240727:211001.299 server #33 started [trapper #4]
212:20240727:211001.304 [1] thread started [preprocessing worker #1]
212:20240727:211001.304 [2] thread started [preprocessing worker #2]
212:20240727:211001.304 [3] thread started [preprocessing worker #3]
242:20240727:211001.338 server #34 started [trapper #5]
243:20240727:211001.383 server #35 started [icmp pinger #1]
220:20240727:211001.407 thread started [discovery worker #1]
220:20240727:211001.407 thread started [discovery worker #2]
220:20240727:211001.407 thread started [discovery worker #3]
220:20240727:211001.407 thread started [discovery worker #4]
220:20240727:211001.407 thread started [discovery worker #5]
249:20240727:211001.421 server #36 started [icmp pinger #2]
236:20240727:211001.428 Proxy "nas" version 6.0.32 is outdated, only data collection and remote execution is available with server version 7.0.1.
250:20240727:211001.433 server #37 started [icmp pinger #3]
237:20240727:211001.448 Proxy "demoproxy" version 6.0.32 is outdated, only data collection and remote execution is available with server version 7.0.1.
251:20240727:211001.458 server #38 started [alert syncer #1]
253:20240727:211001.483 server #39 started [history poller #1]
254:20240727:211001.522 server #40 started [history poller #2]
255:20240727:211001.559 server #41 started [history poller #3]
258:20240727:211001.597 server #42 started [history poller #4]
259:20240727:211001.601 server #43 started [history poller #5]
260:20240727:211001.639 server #44 started [availability manager #1]
261:20240727:211001.655 server #45 started [trigger housekeeper #1]
262:20240727:211001.673 server #46 started [odbc poller #1]
263:20240727:211001.704 server #47 started [http agent poller #1]
264:20240727:211001.716 server #48 started [agent poller #1]
265:20240727:211001.718 server #49 started [snmp poller #1]
263:20240727:211001.724 thread started
267:20240727:211001.736 server #50 started [configuration syncer worker #1]
264:20240727:211001.737 thread started
265:20240727:211001.740 thread started
270:20240727:211001.747 server #51 started [internal poller #1]
271:20240727:211001.756 server #52 started [proxy group manager #1]
271:20240727:211001.790 Proxy "nas" changed state from unknown to online
271:20240727:211001.790 Proxy "demoproxy" changed state from unknown to online
221:20240727:211002.779 item "nas:zabbix[process,discoverer,avg,busy]" became not supported: Invalid second parameter.
224:20240727:211004.077 error reason for "nas:mysql.status[Com_update]" changed: Preprocessing failed for: Com_update.91309
1. Failed: cannot calculate delta (speed per second) for value of type "none": cannot convert value to numeric type
236:20240727:211028.909 configuration update is disabled for this version of proxy "demoproxy" at "192.168.5.227": proxy and server major versions do not match
A frissítés időtartama az adatbázisotok méretétől függ, nálam alig volt több, mint fél perc.
Jöhet a proxy(k) frissítése
Ha valami „igazi” SQL motort használsz a proxyhoz, akkor nincs más teendőd, mint az új verziójú proxyt feltelepíteni és elindítani. A logokban ott is hasonlót fogsz látni. Ebben az esetben nem lesz adatvesztésed sem, legfeljebb pár másodperc, amíg frissül az adatbázis séma.
Ám én az egyszerűség kedvéért itthon sqlite3 motort használok. Ennek a sémáját nem lehet frissíteni újabb verzióra, ilyenkor egyszerűen törli a régi fájlt a proxy, és csinál magának újat, majd elkéri a szervertől a rá vonatkozó feladatokat. A dolog egyetlen hátránya, hogy elvesztettem kb 5 percnyi mérési adatot 🙂 Mivel nem kritikus alkalmazás a zabbix, nekem ennyi bőven belefér. Megjegyzem, ez még a munkahelyemen se lenne probléma, tavaly felsőbb utasításra közel két hónapig nem futhatott a zabbixunk, mégis túlélte a cég 😉
Nem meglepő módon, nálam a zabbix proxy is dockerben fut, így itt is csak módosítani kell a verzió számot 6.0-ról 7.0-ra. Persze ne felejtsük el újraindítani a konténert: sudo docker compose up -d
Részlet a frissítési logból:
...
1:20240728:105320.262 The proxy does not match Zabbix database. Current database version (mandatory/optional): 06000000/06000044.
Required mandatory version: 07000000.
1:20240728:105320.262 Zabbix does not support SQLite3 database upgrade.
1:20240728:105320.262 removing database file: "/var/lib/zabbix/db_data/demoproxy.sqlite"
1:20240728:105320.263 cannot open database file "/var/lib/zabbix/db_data/demoproxy.sqlite": [2] No such file or directory
1:20240728:105320.263 creating database ...
1:20240728:105326.577 current database version (mandatory/optional): 07000000/07000002
1:20240728:105326.577 required mandatory version: 07000000
...
Utolsó lépés: frissíthetjük a zabbix agenteket
Ennek már nem írom le a menetét, mert ahány operációs rendszer, annyi féle képen kell csinálni. Az appliance-ekre tipikusan nincs agent, vagy ha van is, régi verzió, ezzel nincs mit tenni, a Windowsokra kézzel teszem fel (itthon csak a gyerek gépén van), az összes többi hosztom Linuxos. Ahhoz pedig annó írtam egy ansible playbookot.
Kész vagyunk! Egy apróságot a végére hagytam
Van egy kompatibilitási mátrix a zabbix weboldalán, ami lényegében azt mondja, hogy ha a 7.0-s verziót használod, és csak az LTS kiadásokat használod, akkor az egyel régebbi kiadással (6.0) még együtt tud működni a zabbix, persze bizonyos limitációkkal. Mutatok erre egy példát, a játszós proxymat direkt nem frissítettem be, hogy meg tudjam mutatni:
A sárga i betű alatt ez látható:
Ami nagyjából ezt jelenti: „A proxy verzió elavult, a 7.0.1-es szerververzióval csak adatgyűjtés és távoli végrehajtás érhető el.”