Koozali.org: home of the SME Server
Obsolete Releases => SME 8.x Contribs => Topic started by: Jáder on January 15, 2014, 10:46:50 PM
-
Daniel (and others),
I used to have Zabbix 1.x running... later an upgrade started to consume all my CPU (HP N40L) and getting high LA ... so I disabled it.
From time to time, as time allow I try to get it back online.
Now I updated using fws repository and when tried to start, see this on log:
32069:20140115:184240.189 using configuration file: /etc/zabbix/zabbix_server.conf
32069:20140115:184240.200 current database version (mandatory/optional): 02010013/02010013
32069:20140115:184240.200 required mandatory version: 02020000
32069:20140115:184240.200 starting automatic database upgrade
32069:20140115:184240.201 [Z3005] query failed: [1091] Can't DROP 'httptest_2'; check that column/key exists [drop index httptest_2 on httptest]
32069:20140115:184240.201 database upgrade failed
Note: I did nothing but run "yum update --enablerepo=fw zabbix*"
and try to start it with "/etc/init.d/zabbix-server start"
-
try searching google with "[Z3005]+query+failed%3A+[1091]+Can%27t+DROP" key
HTH :wink:
(https://www.google.it/#q=[Z3005)
-
Looks like you was running 1.6.X or 1.8.X
The latest Zabbix in fws repo is 2.2.1, which will try to upgrade the database automatically, but only supports upgrade from 2.0.X. If you were running an older version, you should either:
- manually upgrade your database (look at the scripts in /usr/share/doc/zabbix-server-2.2.1/dbpatches/)
- drop the database and start from scratch ;-)
-
Daniel
I´m sure I was running a 2.0 version... but I hda problems with it... it was hogging CPU cycles. It was working ... for sure!
Anyways, I can do upgrade manually... just a doubt: there are any chances to loose data on database ?
Jáder
-
There's no manual upgrade path for 2.0 -> 2.2. Zabbix-server daemon is responsible for this upgrade, and if if cannot make it, it means your 2.0 database wasn't consistent. Maybe you forgot to run the 1.8 -> 2.0 upgrade script (see /usr/share/doc/zabbix-server-2.2.1/dbpatches/2.0/mysql/upgrade) ?
-
Daniel
I´ve done a backup of my zabbixdb database with
[root@leopardo mysql]# mysqlhotcopy zabbixdb> /tmp/ZabbixDB_AntesJM.sql
[root@leopardo mysql]# ls
and then:
[root@leopardo mysql]# ./upgrade zabbixdb
WARNING: backup your database before performing upgrade
This is an UNSUPPORTED Zabbix upgrade script from 1.8 to 2.0 for MySQL
It does the following things:
1. Updates indexes that might require changes;
2. Patches the database from 1.8 schema to 2.0 schema;
3. Adds 'Disabled' and 'Debug' usergroup if any missing;
4. Checks for hosts not belonging to any group and adds them to one if any found.
Usage: pass required MySQL parameters to this script (like database, user, password etc).
Continue ? (y/n) y
Patching the database
ERROR 1060 (42S21) at line 54: Duplicate column name 'listen_ip'
Failed to patch Zabbix database. Restore from backup
So I presume my DB is 2.0 already.
A test I could to do is change config to a new db (zabbix2db) and recreate it and try.
It´s possible recovery data from old DB to new ... later ... if this works ?
Jáder
-
Looks like your database is already messed up. Don't know what's wrong, but you'd better start from scratch. Recovering from this damaged database is probably quite hard
-
Daniel
Can I downgrade to 2.0 (it was running) ; export some tables (pictures, maps, ...) and try start from ZERO with a new db ?
Jáder
-
Daniel
Can I downgrade to 2.0 (it was running) ; export some tables (pictures, maps, ...) and try start from ZERO with a new db ?
If you can find the RPM from your cache (/var/cache/yum), you can try. But:
- FWS repo do not have 2.0.X rpm anymore, only 2.2
- Your database is probably already messed up, even for 2.0.X (which is probably why you have a high CPU usage)
- You cannot export tables from MySQL, as you would be able to import it back on the new 2.2.X schema, all you could do is export a few things from Zabbix interface (XML export) and import it back
-
Daniel
I think I´ve cleaned up yum cache just yesterday because of one problem! :$
Anyways: What I´d like to keep: Hosts configs, maps, images / pictures , sme templates I´ve cleaned up a little / changed frequency ...I have no interest in historical data from hosts and alarms.
Could I export that directly from DB and import again using phpmyadmin for example?
Otherwise I´ll have to start over on Zabbix... not THAT bad but time consuming.
Jáder
-
No, you cannot export and re-import directly from MySQL because of schema changes between 2.0.x and 2.2.x