Keepalive实现mysql双主热备
环境描述:
OS: CentoOS6.6_X64
Node1:172.16.10.1
Node2:172.16.10.2
VIP:172.16.10.10
1、配置主机互信
Node1:
1
2
3
4
5
6
7
8
9
|
[root@node1~]
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:11:21:56
inet addr:172.16.100.1 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr:fe80::20c:29ff:fe11:2156
/64
Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:144 errors:0 dropped:0overruns:0 frame:0
TX packets:114 errors:0 dropped:0overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14467 (14.1 KiB) TX bytes:11961 (11.6 KiB)
|
向ntp服务器同步时间
1
2
|
[root@node1~]
# ntpdate 172.16.100.30
25 Jul11:34:52 ntpdate[2123]: step
time
server 172.16.100.30 offset -28852.934223 sec
|
创建同步时间任务计划
[root@node1~]# crontab -e
1
|
15 5 * * *
/usr/sbin/ntpdate
172.16.100.30
|
修改主机名称