1.停止zabbix,php服务
2.备份zabbix数据库,忽略history,trends相关表
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 | gzip > zabbix_`date +'%Y%m%d%H%M%S'`.sql.gz
或者直接mysqldump -uzabbix -pzabbix zabbix >zabbix.sql
3.升级php到5.6
(1)service php-fpm stop
(2)mv /usr/local/php /usr/local/php5.3
(3)下载5.6版本,编译安装(注:always_populate_raw_post_data = -1,修改session.auto_start = 0,如果session报错,查看下session保存目录是否具有权限)
tar zvxf php-5.6.29.tar.gz
cd php-5.6.29/
mkdir /usr/local/php
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/ --with-zlib-dir=/usr/local/zlib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype
make ZEND_EXTRA_LIBS='-liconv' && make install
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm -r
chmod a+x /etc/rc.d/init.d/php-fpm
cp /usr/local/php5.3/etc/php.ini /usr/local/php/etc -f
cp /usr/local/php5.3/etc/php-fpm.conf /usr/local/php/etc -f
service php-fpm restart
4.升级libcurl到7.47
rpm -ivh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm
yum upgrade libcurl
rpm -e city-fan.org-release
然后通过curl -V验证是否是7.47版本
5.升级zabbix3.0
(1)pkill zabbix
(2)mv /usr/local/zabbix /usr/local/zabbix2
(3)tar zvxf zabbix-3.0.4.tar.gz
(4)安装3.0
cd zabbix-3.0.4
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-net-snmp --with-libcurl --enable-proxy --with-mysql=/usr/bin/mysql_config
make &&make install
(5)替换旧的web目录
mv /data/zabbixdir /data/zabbixdir2.0
mkdir /data/zabbixdir
cd /usr/local/zabbix/
cp -rf zabbix-3.0.4/frontends/php/* /data/zabbixdir/(自己设定的web目录)
cp -f /data/zabbixdir2.0/conf/zabbix.conf.php /data/zabbixdir/conf/zabbix.conf.php
(6)配置文件修改并启动
cp /usr/local/zabbix2/etc/zabbix_server.conf /usr/local/zabbix/etc/
/usr/local/zabbix/sbin/zabbix_server
/usr/local/zabbix/sbin/zabbix_agentd
zabbix2.0升级到zabbix3.0
原创
©著作权归作者所有:来自51CTO博客作者luoguo的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章