Migration Zabbix monitoring of Zabbix

zabbix monitoring is sometimes needed to be zabbix server migration, migration zabbix is ​​very simple, because all the front-end operations zabbix are present zabbix database. So zabbix migrate only to zabbix library corresponding tables can be exported into the guide.

zabbix migration can be carried out separately for whether to migrate historical data, if required historical data is not lost, you need to migrate the entire library zabbix, if historical data is not required, so you can only migrate configuration information, after all, historical data occupies a lot of space .

1. Export zabbix database

[root@zhu2 ~]# mysqldump -uroot -p123456 --opt  zabbix > zabbix.sql

2. Send sql files to the new server (the new server environment should build a good basic)

[root@zhu2 ~]# scp zabbix.sql [email protected]:/tmp

3. Import the sql file on the new server

[zhu1 the root @ ~] # MySQL -uroot--p123456 ZABBIX <zabbix.sql  
#zabbix new library can be a library, may be already existing database, file before importing Because sql, it will look at the table exists, if table presence will delete reintroduced


4. Modify the page file

[root @ zhu1 ~] # vim /var/www/html/conf/zabbix.conf.php  
<PHP?  
// the GUI of ZABBIX the Configuration File 
, Ltd. Free Join $ DB;  
$ DB [ 'the TYPE'] = 'MYSQL';  
$ DB [ 'SERVER'] = 'localhost';  
$ DB [ 'PORT'] = '0';  
$ DB [ 'dATABASE'] = 'zabbix';  
$ DB [ 'the USER'] = 'the root'; # connection zabbix database user  
$ DB [ 'pASSWORD'] = '123456'; zabbix connected database user password #  
// Relevant only for the IBM_DB2 iS SCHEMA database  
$ DB [ 'SCHEMA'] = '';  
$ ZBX_SERVER = 'localhost';  
$ ZBX_SERVER_PORT = '10051';  
$ ZBX_SERVER_NAME = '';  
$ IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;  
?>  
~

5.前端访问,

#此时需要使用的便是老的zabbix的用户密码,为了防止迁移不出意外,新的服务器上搭建的环境,以及zabbix server的配置文件应尽量和老的配置文件保持一致




zabbix3.2升级3.4报错Database error


zabbix3.2版本升级到zabbix3.4版本后打开页面报错,报错内容如下

Database error 
The frontend does not match Zabbix database. Current database version (mandatory/optional): 3020000/3020000. Required mandatory version: 3040000. Contact your system administrator.

解决办法:

郑州同济医院:http://jbk.39.net/yiyuanzaixian/zztjyy/

进入数据库 

mysql> show databases;
mysql> use zabbix;
mysql> update dbversion set mandatory=3040000;
mysql> flush privileges;


Guess you like

Origin blog.51cto.com/14478010/2427765