一 問(wèn)題描述
共和ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書(shū)銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書(shū)合作)期待與您的合作!
今天把zabbix server和zabbix proxy升級(jí)到3.2.1。先停掉zabbix server然后挨個(gè)升級(jí)zabbix proxy最后再升級(jí)zabbix server。zabbix proxy升級(jí)的時(shí)候沒(méi)有錯(cuò)誤,可以順利進(jìn)行。但是升級(jí)zabbix server的時(shí)候報(bào)出以下錯(cuò)誤:
4250:20161010:001506.980 using configuration file: /opt/app/zabbix/conf/zabbix_server.conf 4250:20161010:001506.998 current database version (mandatory/optional): 03000000/03000000 4250:20161010:001506.998 required mandatory version: 03020000 4250:20161010:001506.998 starting automatic database upgrade 4250:20161010:001507.010 [Z3005] query failed: [1091] Can't DROP 'history_log_2'; check that column/key exists [drop index history_log_2 on history_log] 4250:20161010:001507.011 database upgrade failed
之前是對(duì)zabbix的數(shù)據(jù)庫(kù)做過(guò)表分區(qū)
二 問(wèn)題解決
查看zabbix問(wèn)題反饋是由于zabbix 3.2在升級(jí)的時(shí)候需要drop history_log_2這個(gè)索引,如果沒(méi)有就會(huì)報(bào)錯(cuò)。
DROP TABLE history_log; DROP TABLE history_text; CREATE TABLE `history_log` ( `id` BIGINT(20) UNSIGNED NOT NULL, `itemid` BIGINT(20) UNSIGNED NOT NULL, `clock` INT(11) NOT NULL DEFAULT '0', `timestamp` INT(11) NOT NULL DEFAULT '0', `source` VARCHAR(64) NOT NULL DEFAULT '' COLLATE 'utf8_bin', `severity` INT(11) NOT NULL DEFAULT '0', `value` TEXT NOT NULL COLLATE 'utf8_bin', `logeventid` INT(11) NOT NULL DEFAULT '0', `ns` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE INDEX `history_log_2` (`itemid`, `id`), INDEX `history_log_1` (`itemid`, `clock`) ) COLLATE='utf8_bin' ENGINE=InnoDB ; CREATE TABLE `history_text` ( `id` BIGINT(20) UNSIGNED NOT NULL, `itemid` BIGINT(20) UNSIGNED NOT NULL, `clock` INT(11) NOT NULL DEFAULT '0', `timestamp` INT(11) NOT NULL DEFAULT '0', `source` VARCHAR(64) NOT NULL DEFAULT '' COLLATE 'utf8_bin', `severity` INT(11) NOT NULL DEFAULT '0', `value` TEXT NOT NULL COLLATE 'utf8_bin', `logeventid` INT(11) NOT NULL DEFAULT '0', `ns` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE INDEX `history_text_2` (`itemid`, `id`), INDEX `history_text_1` (`itemid`, `clock`) ) COLLATE='utf8_bin' ENGINE=InnoDB ;
升級(jí)完成以后,由于history_text和history_log重新創(chuàng)建了,原來(lái)的分區(qū)腳本不能直接對(duì)這兩個(gè)表分區(qū)
需要先手動(dòng)分區(qū)后腳本才能使用
http://john88wang.blog.51cto.com/2165294/1771557
參考文檔:
http://john88wang.blog.51cto.com/2165294/1771082
https://zabbix.com/forum/showthread.php?p=189543
https://support.zabbix.com/browse/ZBX-11203