How to upgrade Zabbix 2.4 in the production environment

Source: Internet
Author: User
Tags import database

How to upgrade Zabbix 2.4 in the production environment

Zabbix 3.0 has been officially launched. The biggest change is that the UI is more flat and better-looking. The company also requires an upgrade. Although this upgrade does not make much sense, we are not using the new features, but still follow the arrangement --!

The original environment is Zabbix 2.4.7, and more than 400 servers are monitored, such

Because the previous Zabbix Server was deployed on CentOS 5, many problems were encountered during the upgrade process, and finally changed to CentOS 7 and solved all the problems. The detailed operation steps are as follows:

1. The first thing is backup. Needless to say, the files to be backed up here are mainly database files and a zabbix. conf. php. The file is located in the conf directory of the home directory of the website. The database file can be exported using mysqldump.

Mysqldump-u root-p zabbix> zabbix. SQL

2. Install the LAMP environment on the new system. Note that the MySQL version must be the same as that of the previous system. PHP must be later than 5.5.

### Compile and install APACHE 2.4 and apr, apr-util
1. apr
./Configure -- prefix =/usr/local/apr
Make & make install
2. apr-util
./Configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr
Make & make install
3. apache2.4
. /Configure -- prefix =/usr/local/apache -- enable-so -- enable-rewrite -- enable-ssl -- enable-cgi -- enable-cgid -- enable-modules = most -- enable- mod-shared = most -- enable-mpms-shared = all -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util
Make & make install

### Install MYSQL 5.6 in binary mode
Cp-ar mysql-5.6.29-linux-glibc2.5-x86_64/usr/local/mysql-5.6
./Mysql_install_db -- basedir =/usr/local/mysql-5.6 -- datadir =/mysqldata -- user = mysql
Cp my-default.cnf/etc/my. cnf
Cp mysql. server/etc/init. d/mysqld


### Compile and install PHP 5.6
Yum install libjpeg-devel libpng-devel freetype-devel
./Configure -- prefix =/usr/local/php \
-- With-apxs2 =/usr/local/apache/bin/apxs \
-- With-zlib \
-- With-jpeg-dir \
-- With-png-dir \
-- With-zlib-dir \
-- With-mysql =/usr/local/mysql-5.6 \
-- Enable-sockets \
-- Enable-bcmath \
-- Enable-mbstring \
-- With-mysqli =/usr/local/mysql-5.6/bin/mysql_config \
-- With-gd \
-- With-freetype-dir \
-- With-gettext
Make & make install

3. Create a database on the new server

Create database zabbix;
Grant all privileges on zabbix. * to 'zabbix' @ 'localhost' identified by 'zabbix ';
Grant all privileges on zabbix. * to 'zabbix' @ '%' identified by 'zabbix ';
Flush privileges;

4. Install Zabbix 2.4 on the new server, but do not directly install Zabbix 3.0 because it is normal to import data to 2.4 first, so as to eliminate data problems.

./Configure -- prefix =/usr/local/zabbix -- enable-server -- enable-agent -- with-mysql -- with-net-snmp -- with-libcurl -- with-ssh2
Make & make install
Cp-ar/software/zabbix-2.4.7/frontends/php/*/usr/local/apache/htdocs/
Cp zabbix_server zabbix_agentd/etc/init. d/

### Import database structure files
Mysql-uroot-p zabbix <schema. SQL
Mysql-uroot-p zabbix <images. SQL
Mysql-uroot-p zabbix <data. SQL

5. If there is no unexpected situation after the previous step is completed, the Zabbix installation interface will appear when you access the webpage directly. We will install it once as usual. After the installation is complete, import the backup database file, I backed up more than 10 Gb of data, and it took a lot of time to import the data. After the import is successful, the data should be the same as the image before the first step.

Mysql-uroot-p zabbix <zabbix. SQL

6. Now we have started the formal upgrade step. Re-compile Zabbix 3.0. The compilation options are the same as before. After the compilation, We Will recompile the 3.0 web page file and the zabbix backed up previously. conf. copy the PHP file to the website directory to overwrite the previous file and then visit the website. The installation page of 3.0 appears unexpectedly.

Cp-ar frontends/php/*/usr/local/apache/htdocs/

Cp zabbix. conf. php/usr/local/apache/htdocs/conf. php

8. Refresh the page and check the data again. The upgrade is successful!

Some Zabbix Tutorials:

Compile and install Zabbix2.4.5 source code in Ubuntu 14.04

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy Zabbix in CentOS 6.3

Zabbix distributed monitoring system practice

Under CentOS 6.3, Zabbix monitors apache server-status

Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3

Install Zabbix 2.0.6 in 64-bit CentOS 6.2

ZABBIX details: click here
ZABBIX: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.