1.停服zabbix2,停服数据库
/etc/init.d/zabbix_server stop
/etc/init.d/mysqld stop

1.停服zabbix2,停服数据库
/etc/init.d/zabbix_server stop
/etc/init.d/mysqld stop

zabbix2升级zabbix3,zabbix2zabbix3

1.停服zabbix2,停服数据库
/etc/init.d/zabbix_server stop
/etc/init.d/mysqld stop
2.大体备份数据库
cd /var/lib/mysql/
tar -zcvf /tmp/data_zabbix2_20170306.tar.gz *
3.设置依赖包
yum -y install net-snmp-devel libxml2-devel libcurl-devel php-gd
mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-mysql php-bcmath
php-mbstring php-xml
4.下载zabbix3源码包
wget

5.解压并设置
tar -xf zabbix-3.0.7.tar.gz
cd zabbix-3.0.7
mkdir -p /usr/local/zabbix/
./configure –prefix=/usr/local/zabbix/ –enable-server –enable-agent
–with-mysql –with-net-snmp –with-libcurl –with-libxml2
6.替换zabbix3开首脚本以及配置文件
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix3_agentd
cp misc/init.d/tru64/zabbix_server /etc/init.d/zabbix3_server
sed -i
‘s/\(DAEMON=\/usr\/local\/\)\(sbin\/zabbix_server\)/\1zabbix\/\zabbix2升级zabbix3。2/g’
/etc/init.d/zabbix3_server
7.拷贝前端文件
\cp /root/zabbix-3.0.7/frontends/php/* /var/www/html/zabbix3/ -rp
8.陈设前端文件

或者
cp /var/www/html/zabbix/conf/zabbix.conf.php
/var/www/html/zabbix3/conf/zabbix.conf.php
9.启动mysql
10.启动zabbix3
/etc/init.d/zabbix3_server start
/etc/init.d/zabbix3_agentd start
11.查看zabbix_server日志中数据库的电动升级速度

1.停服zabbix2,停服数据库 /etc/init.d/zabbix_server stop
/etc/init.d/mysqld stop 2.大体备份数据库 cd /var/lib/mysql/ tar
-zcvf…

1. 关闭selinux,防火墙

2.大体备份数据库
cd /var/lib/mysql/
tar -zcvf /tmp/data_zabbix2_20170306.tar.gz *

2.物理备份数据库
cd /var/lib/mysql/
tar -zcvf /tmp/data_zabbix2_20170306.tar.gz *

[root@localhost /]# sed -i
“s#SELINUX=enforcing#SELINUX=disabled#g” /etc/selinux/config # 
                                                                                                                                    重启生效[root@localhost
/]# setenforce 0 #临时关门

[root@localhost /]#service iptables stop 

3.设置重视包
yum -y install net-snmp-devel libxml2-devel libcurl-devel php-gd
mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-mysql php-bcmath
php-mbstring php-xml

3.安装信赖包
yum -y install net-snmp-devel libxml2-devel libcurl-devel php-gd
mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-mysql php-bcmath
php-mbstring php-xml

2. 安装PHP,Apache

4.下载zabbix3源码包
wget

4.下载zabbix3源码包
wget

[root@localhost /]# rpm -ivh

[root@localhost /]# yum -y install httpd php56w php56w-gd
php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap

#配置php文件

[root@localhost /]# vim /etc/php.ini

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = Asia/Shanghai

always_populate_raw_post_data = -1

#配置apache

[root@localhost /]# vim /etc/httpd/conf/httpd.conf 

DirectoryIndex index.html index.html.var index.php

5.解压并安装
tar -xf zabbix-3.0.7.tar.gz
cd zabbix-3.0.7
mkdir -p /usr/local/zabbix/
./configure –prefix=/usr/local/zabbix/ –enable-server –enable-agent
–with-mysql –with-net-snmp –with-libcurl –with-libxml2

5.解压并安装
tar -xf zabbix-3.0.7.tar.gz
cd zabbix-3.0.7
mkdir -p /usr/local/zabbix/
./configure –prefix=/usr/local/zabbix/ –enable-server –enable-agent
–with-mysql –with-net-snmp –with-libcurl –with-libxml2

3. 安装MySQL

6.替换zabbix3起动脚本以及配备文件
cd zabbix-3.0.7
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix3_agentd
cp misc/init.d/tru64/zabbix_server /etc/init.d/zabbix3_server
sed -i
‘s/\(DAEMON=\/usr\/local\/\)\(sbin\/zabbix_server\)/\1zabbix\/\2/g’
/etc/init.d/zabbix3_server

6.替换zabbix3开行脚本以及配置文件
cd zabbix-3.0.7
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix3_agentd
cp misc/init.d/tru64/zabbix_server /etc/init.d/zabbix3_server
sed -i
‘s/\(DAEMON=\/usr\/local\/\)\(sbin\/zabbix_server\澳门金沙国际 ,)/\1zabbix\/\2/g’
/etc/init.d/zabbix3_server

[root@localhost /]# rpm -ivh

[root@localhost /]# yum -y install mysql-server

[root@localhost /]# /etc/init.d/mysqld start

[root@localhost /]# mysql -u root -p123456

mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

               Query OK, 1 row affected (0.06 sec)

mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost
IDENTIFIED BY ‘zabbix’;             Query OK, 0 rows affected (0.02
sec)

mysql> show databases;

|information_schema|

| mysql |

| performance_schema |

| zabbix | 

7.拷贝前端文件
\cp /root/zabbix-3.0.7/frontends/php/* /var/www/html/zabbix3/ -rp

7.拷贝前端文件
\cp /root/zabbix-3.0.7/frontends/php/* /var/www/html/zabbix3/ -rp

4. 设置配置Zabbix

8.配备前端文件

或者
cp /var/www/html/zabbix/conf/zabbix.conf.php
/var/www/html/zabbix3/conf/zabbix.conf.php

8.安顿前端文件

或者
cp /var/www/html/zabbix/conf/zabbix.conf.php
/var/www/html/zabbix3/conf/zabbix.conf.php

#创办用户

[root@localhost /]# groupadd zabbix

[root@localhost /]# useradd -g zabbix zabbix

安装依赖包

[root@localhost mysql]# yum -y install gcc mysql-community-devel
libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel
libssh2-devel OpenIPMI-devel openssl-devel openldap-devel

#下载安装zabbix

[root@localhost /]# wget

[root@localhost /]# tar -zxvf zabbix-3.0.4.tar.gz

#导入数据库文件

[root@localhost /]# cd /zabbix-3.0.4/database/mysql/

[root@localhost mysql]#  mysql -uzabbix  -p123456 zabbix  <
schema.sql

[root@localhost mysql]#  mysql -uzabbix -p223456 zabbix  <
images.sql

[root@localhost mysql]#  mysql -uzabbix  -p123456 zabbix  <
data.sql

#安装zabbix

[root@localhost mysql]# cd /zabbix-3.0.4

[root@localhost zabbix-3.0.4]# ./configure –enable-server
–enable-agent –with-mysql –enable-ipv6 –with-net-snmp
–with-libcurl –with-libxml2 –with-unixodbc –with-ssh2
–with-openipmi –with-openssl –prefix=/usr/local/zabbix

[root@localhost zabbix-3.0.4]#make && make i#nsta#ll

#配置zabbix

[root@localhost etc]# vim /usr/local/zabbix/etc/zabbix_server.conf

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

#配置zabbix-web

[root@localhost conf]# mkdir /var/www/html/zabbix 

[root@localhost php]# cp -r zabbix-3.0.4/frontends/php/* 
 /var/www/html/zabbix/

[root@localhost php]# chown -R apache:apache /var/www/html/zabbix

#布局运转脚本

[root@localhost] # cp
/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_server 
/etc/init.d/zabbix_server

[root@localhost ]# cp
/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_agentd 
/etc/init.d/zabbix_agentd

 #变动下路径

[root@localhost php]# vim /etc/init.d/zabbix_server

BASEDIR=/usr/local/zabbix   #更改下路径

[root@localhost php]# vim /etc/init.d/zabbix_agent

BASEDIR=/usr/local/zabbix #变更下路径

#加上为系统服务

 [root@localhost php]# chkconfig –add /etc/init.d/zabbix_server

[root@localhost php]# chkconfig –add /etc/init.d/zabbix_agentd

[root@localhost php]# chkconfig httpd on

[root@localhost php]# chkconfig mysqld on

[root@localhost php]# chkconfig zabbix_server on

[root@localhost php]# chkconfig zabbix_agentd on

9.启动mysql

9.启动mysql

5. 运转服务

10.启动zabbix3
/etc/init.d/zabbix3_server start
/etc/init.d/zabbix3_agentd start

10.启动zabbix3
/etc/init.d/zabbix3_server start
/etc/init.d/zabbix3_agentd start

[root@localhost php]# /etc/init.d/zabbix_server start

[root@localhost php]# /etc/init.d/zabbix_agent start

[root@localhost php]#service  httpd  start

[root@localhost php]# service mysqld start

11.查看zabbix_server日志中数据库的机关升级速度

11.查看zabbix_server日志中数据库的全自动升级速度

澳门金沙国际 1

澳门金沙国际 2

用户:Admin,密码:zabbix

澳门金沙国际 3

澳门金沙国际 4

OK

相关文章