zabbix2 4版本公升級到3 2版本

2021-09-26 16:05:11 字數 3624 閱讀 9000

zabbix3.2版本原始碼安裝完畢,目前將2.4版本公升級到3.2版本操作,只需要將2.4的資料庫備份匯出,然後將其匯入3.2版本的資料庫即可。

1、停止zabbix相關服務

service zabbix_server stop

service zabbix_agentd stop 

service mysqld stop

service php-fpm stop

2、zabbix2.4版資料庫備份

mysqldump --opt -r -uzabbix -p zabbix --ignore-table=zabbix.history --ignore-table=zabbix.history_log --ignore-table=zabbix.history_str --ignore-table=zabbix.history_text --ignore-table=zabbix.history_uint --ignore-table=zabbix.trends --ignore-table=zabbix.trends_uint > zabbix.sql

注釋:–opt:此mysqldump命令引數是可選的,如果帶上這個選項代表啟用了mysqldump命令的quick,add-drop-table,add-locks,extended-insert,lock-tables引數,也就是通過–opt引數在使用mysqldump匯出my

sql資料庫

資訊時不需要再附加上述這些引數。

--ignore-table:不匯出制定**,此項可根據具體情況新增,由於歷史資料太多,只將重要的zabbix資訊匯出了,節省時間。

3、將資料庫備份匯入zabbix3.2版本的資料庫

service mysqld start

mysql -uzabbix -p zabbix < zabbix.sql

4、啟動伺服器

service php-fpm start

service zabbix_agentd start

service zabbix_server start

但是,這樣匯入資料庫是起不來的會報錯,具體問題具體分析,去看下zabbix_server.log日誌,查詢一下原因。我碰到的問題是zabbix-server在自檢公升級資料庫時,提示有一些**是已經存在,導致啟動失敗,既然存在造成的就刪掉好了。

下列是我刪掉的**:

set foreign_key_checks = 0;

drop table opinventory;

drop table opinventory;

drop table sysmap_user;

drop table sysmap_usrgrp;

drop table screen_user;

drop table screen_usrgrp;

drop table slideshow_user;

drop table slideshow_usrgrp;

drop table trigger_tag;

drop table event_tag;

drop table problem;

drop table event_recovery;

drop table problem_tag;

drop table correlation;

drop table corr_condition;

drop table corr_condition_tag;

drop table corr_condition_group;

drop table corr_condition_tagpair;

drop table corr_condition_ta**alue;

drop table corr_operation;

drop table task;

drop table task_close_problem;

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

;

注釋:set foreign_key_checks = 0;#是關閉外來鍵檢查,不關閉,上述**刪不掉。

service zabbix_server start

應該就可以起來了,具體問題需要結合日誌去排查,每個環境問題可能不一樣,所以要有針對性的去解決。

linux glibc公升級到2 15版本

tar xvf glibc ports 2.15.tar.gz mv glibc ports 2.15 glibc 2.15 ports cd glibc 2.15 mkdir build 名字不能變 cd build configure prefix usr local glibc 2.15 配置...

magento2 3公升級到2 4版本公升級步驟

一 首先是伺服器環境要支援magento2.4的安裝要求 yum y update 檢視系統版本 cat etc redhat release centos linux release 7.6.1810 core 公升級到最新 php版本要用7.3 7.4 mysql版本 mysql v mysql...

QTestWare公升級到1 1版本了!

今天是8.1建軍節,在這個特殊的日子裡,qtestware 1.1版本發布了!相比 qtestware1.0 qtestware1.1 對.net 控制項的支援更加完善,並且增加了對流行的 net 第三方控制項 componentone 的支援,包括 c1flexgrid c1truedbgrid ...