备份替换my.cnf配置文件
代码语言:javascript复制[root@slave02 etc]# mv my.cnf my.old.2015.12.09.backup
[root@slave02 etc]# mv mynew02.cnf my.cnf
[root@slave02 etc]# ll my*
-rw-r--r-- 1 root root 1928 Dec 8 21:18 my.cnf
-rw-r--r-- 1 root root 21146 Jul 4 2014 my.old.2015.12.09.backup
[root@slave02 etc]#
部分参数已经在新版本中不用,或更名,要进行替换
代码语言:javascript复制[testuser@slave01 etc]$ diff /tmp/old /tmp/new
11c11
< table_cache = 2048
---
> table_open_cache = 2048
18d17
< thread_concurrency = 8
22c21
< default_table_type = INNODB
---
> default_storage_engine = INNODB
23a23
> relay-log=relay-bin
31c31
< server-id = 123
---
> server-id = 321
41,42c41
< myisam_max_sort_file_size = 5G
< myisam_max_extra_sort_file_size = 5G
---
> myisam_max_sort_file_size = 1G
44c43
< myisam_recover
---
> myisam_recover_options
[testuser@slave01 etc]$
innodb_additional_mem_pool_size 也已经被弃用了,如果有要注释掉
将zabbit加入mysql组以方便监控
代码语言:javascript复制[root@new-master mysql]# vim /etc/group
[root@new-master mysql]# id zabbix
uid=496(zabbix) gid=493(zabbix) groups=493(zabbix),492(mysql)
[root@new-master mysql]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent: [ OK ]
Starting Zabbix agent: [ OK ]
[root@new-master mysql]#
----------
[root@zabbix-server ~]# zabbix_get -s new-master -p 10050 -k "mysql.slowlog[100,/var/lib/mysql/new-master-slow.log]"
2.98465
[root@zabbix-server ~]#