枫狐狸 发表于 2017-10-19 16:51:16

zabbix3.2.9升级到3.4.3

zabbix3.2.9升级到3.4.3
3.2.9环境安装参考 https://www.iyunv.com/thread-197623-1-1.html

比较懒的可参考:http://www.cnblogs.com/unchch/p/7495256.html

升级步骤:
1、安装系统支持包:
        3.4.X多加了三个支持包libevent-doc-2.0.21-4.el7.noarch,libevent-2.0.21-4.el7.x86_64,libevent-devel-2.0.21-4.el7.x86_64
        执行yum install libevent*
       
2、备份3.2.9版文件
    service zabbix_server stop
        service zabbix_agentd stop
        tar -cvf /tmp/zabbix3.2.9.tar /home/zabbix /etc/init.d/zabbix_server /etc/init.d/zabbix_agentd /var/www/html
        cp /var/www/html/conf/zabbix.conf.php /tmp/zabbix.conf.php
       
3、清理安装目录
    rm -rf /home/zabbix/*
    rm -f /etc/init.d/zabbix_*
        rm -rf /var/www/html/*
       
4、下载3.4.3,并安装
        wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.3/zabbix-3.4.3.tar.gz
        tar xzvf zabbix-3.4.3.tar.gz
        cd zabbix-3.4.3
        ./configure --prefix=/home/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-java --with-unixodbc --with-ssh2 --with-openipmi
        make install

5、更新服务文件
    cp /home/zabbix-3.4.3/misc/init.d/fedora/core5/zabbix* /etc/init.d/
        修改zabbix_server和zabbix_agentd中内容
        ZABBIX_BIN="/usr/local/sbin/zabbix_server" 改为你的实际地址,本例为ZABBIX_BIN="/home/zabbix/sbin/zabbix_server"

6、更新前端文件(web端)
    cp -R /home/zabbix-3.4.3/frontends/php/* /var/www/html/
        cp /tmp/zabbix.conf.php /var/www/html/conf/zabbix.conf.php#把数据库配置文件恢复回来,如果没有在第一次访问时也会再建一个,但要将/var/www/html/conf目录权限改为777。
        数据库备份此处省略
       
7、重启服务
        service httpd restart
        因/etc/init.d/目录下的zabbix文件已更改,需重新载入:systemctl daemon-reload
        service zabbix_server start
        service zabbix_agentd start
       
8、打开网页查看是否更新成功
        1、如果遇到版本不符的提示,如下:
           8673:20161117:104750.259 current database version (mandatory/optional): 03040000/03020001
           8673:20161117:104750.259 required mandatory version: 03040000
          
           登录zabbix库执行
           MariaDB > update dbversion set mandatory=3040000;
           Query OK, 1 row affected (0.01 sec)
           Rows matched: 1Changed: 1Warnings: 0

           MariaDB > flush privileges;
           Query OK, 0 rows affected (0.00 sec)
        2、server日志中报错如下:
           connection to database 'zabbix' failed: Access denied for user 'zabbix'@'localhost' (using password: NO)
           修改/etc/my.cnf文件,在段最后添加skip-grant-tables,然后重启数据库。升级完成后可再把这名去掉。
           如下显示为server正在升级数据库字段及表
          13214:20171019:154702.167 connection to database 'zabbix' failed: Access denied for user 'zabbix'@'localhost' (using password: NO)
                13214:20171019:154702.168 database is down: reconnecting in 10 seconds
                13214:20171019:154712.178 database connection re-established
                13214:20171019:154712.182 current database version (mandatory/optional): 03040000/03020001
                13214:20171019:154712.182 required mandatory version: 03040000
                13214:20171019:154712.182 optional patches were found
                13214:20171019:154712.182 starting automatic database upgrade
                13214:20171019:154712.188 completed 0% of database upgrade
                13214:20171019:154713.833 completed 1% of database upgrade
                13214:20171019:154713.859 completed 2% of database upgrade
                。。。。。。。略
                。。。。。。。略
                13214:20171019:154737.481 completed 97% of database upgrade
                13214:20171019:154737.507 completed 98% of database upgrade
                13214:20171019:154737.534 completed 99% of database upgrade
                13214:20171019:154737.557 completed 100% of database upgrade
                13214:20171019:154737.557 database upgrade fully completed
        3、内存溢出
                13214:20171019:154738.183 zbx_mem_malloc(): out of memory (requested 256 bytes)
                13214:20171019:154738.183 zbx_mem_malloc(): please increase CacheSize configuration parameter
                修改zabbix_server.conf文件中的CacheSize=8G,重启服务。
        4、zabbix_server.conf及zabbix_agentd.conf可参考原来版本的文件修改。
       
       


看雪 发表于 2017-10-20 09:25:39

路过帮顶!!!
页: [1]
查看完整版本: zabbix3.2.9升级到3.4.3