MARIADB主从复制

  • 准备2台虚拟机
    IP地址分别为
    192.168.118.6
    192.168.118.66
[root@localhost ~]# ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.118.6  netmask 255.255.255.0  broadcast 192.168.118.255
        inet6 fe80::29a4:1493:e6cd:c703  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:fa:2c:d4  txqueuelen 1000  (Ethernet)
        RX packets 135  bytes 25778 (25.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 147  bytes 17086 (16.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.118.66  netmask 255.255.255.0  broadcast 192.168.118.255
        inet6 fe80::5221:1a2c:46e2:7026  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::29a4:1493:e6cd:c703  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:ba:af:d8  txqueuelen 1000  (Ethernet)
        RX packets 100  bytes 16269 (15.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 104  bytes 12148 (11.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  1. 修改主机名
[root@m ~]# ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.118.6
[root@m ~]# vim /etc/hostname
m.zzq.org
[root@m ~]# vim /etc/hosts
192.168.118.6   m       m.zzq.org
192.168.118.66  s       s.zzq.org
[root@m ~]# vim /etc/selinux/config
SELINUX=permissive
[root@m ~]# reboot
[root@m ~]# hostname
m.zzq.org
  • 另一个同理
[root@s ~]# ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.118.66
[root@s ~]# vim /etc/hostname
s.zzq.org
192.168.118.6   m       m.zzq.org
192.168.118.66  s       s.zzq.org
[root@m ~]# vim /etc/selinux/config
SELINUX=permissive
[root@s ~]# reboot
[root@s ~]# hostname
s.zzq.org
[root@s ~]# ping m.zzq.org 
PING m (192.168.118.6) 56(84) bytes of data.
64 bytes from m 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值