zabbix 迁移

回复 收藏
1、停止旧上所以关于zabbix的服务进程
service zabbix_agentd stop
service zabbix_server stop
killall  nginx
killall  php-fpm


备份数据库
[root@localhost ~]# mysqldump zabbix > /home/ahzabbixfull.sql


2、在新机器上面操作

a.进入mysql 删除原来的zabbix库,并从新创建(因为这是全量备份,所以表结构都是覆盖过来
[root@cmah-zabbix-server ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 44616
Server version: 5.6.19-log Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


删除zabbix库,并创建

mysql> drop database zabbix;
Query OK, 103 rows affected (0.20 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> create database zabbix;
Query OK, 1 row affected (0.00 sec




赋予权限 ,并刷新
mysql> grant all on zabbix.* to zabbix@localhost identified by '123';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)


3、等待数据库的备份完成,并将他从老服务器copy到新服务器上,然后导入。


[root@localhost ~]# scp -P 65522 /home/ahzabbixfull.sql jiank@1x0.xx0.xxx.xx:/home/jiank/




[root@cmah-zabbix-server jiank]# /etc/init.d/zabbix_server stop
[root@cmah-zabbix-server jiank]# chown root.root /home/jiank/ahzabbixfull.sql


[root@cmah-zabbix-server jiank]# mysql zabbix < /home/jiank/ahzabbixfull.sql


启动服务,验证服务。




2016-01-11 22:42 举报
已邀请:
0

拉卡

赞同来自:

学习!感谢分享!
0

prospect

赞同来自:

拉卡 发表于 2016-1-11 22:52
学习!感谢分享!

不用感谢,大家好才是真的好{:4_95:}
0

malong

赞同来自:

学习了

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: