centos7 xtrabackup mysql 基本测试(6)主从简单测试
mysql -u etc -p
1234aA~1
参考:
centos7 时区设置 时间同步
https://blog.youkuaiyun.com/wowocpp/article/details/135931129
Mysql数据库:主从复制与读写分离
https://blog.youkuaiyun.com/m0_71815887/article/details/137112591
CentOS7-MySQL-主从
https://blog.youkuaiyun.com/super_lixiang/article/details/82595001
MySQL-主从架构的搭建
https://developer.aliyun.com/article/1409013
centos7搭建mysql主从
https://www.jianshu.com/p/cbfbee2a662b
如何在centos7中搭建传统的mysql主从
https://jingyan.baidu.com/article/380abd0aacb63d5c90192cad.html
MySQL主从复制《主库已经有数据的解决方案》《几种复制模式》
https://blog.youkuaiyun.com/weixin_41309035/article/details/136157363
需要两台 虚拟机
G:\centos7_mini_1810_server_zhu 192.168.99.40
G:\centos7_mini_1810_server_cong 192.168.99.172
mysql 版本
Server version: 5.7.44 MySQL Community Server (GPL)
时间 同步
timedatectl
centos7 时区设置 时间同步
timedatectl
sudo yum install chrony -y
sudo systemctl enable chronyd
sudo systemctl start chronyd
sudo systemctl status chronyd
对于较旧版本的CentOS系统,没有安装chrony,可以使用ntpdate来完成时间同步。
date // 查看当前时间
timedatectl set-timezone Asia/Shanghai // 设置时区为上海
主服务器设置
ip addr 查看 网卡,有时候 同一个网卡上面 会有两个ip地址。
原因可能是
/etc/sysconfig/network-scripts/ifcfg-ens33
设置 固定的ip地址 192.168.99.40
对 ifcfg-ens33 文件做备份的时候
不要 命名为ifcfg-ens33.bak ,而是要 命名为bak_ifcfg-ens33
ifcfg-ens33.bak 也会被解析,执行。给网卡增加了 第二地址。
查看mysql 数据库 的data地址
mysql -u etc -p
1234aA~1
show variables like '%dir' ;
datadir | /opt/datadir/mysql/
/opt/datadir/mysql
sudo cat my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join