首页服务器Web服务器 centos7 mariadb主从复制配置搭建详解步骤

centos7 mariadb主从复制配置搭建详解步骤

花了小一天的时间,终于实现了centos7 mariadb主从复制配置搭建,下面记录一下过程 环境: 虚拟机:vm8; centos7 版本:7.2.1511; mariadb 版本:centos7.2内置的 主库服务器: 10.69.…

花了小一天的时间,终于实现了centos7 mariadb主从复制配置搭建,下面记录一下过程

环境:

虚拟机:vm8; centos7 版本:7.2.1511; mariadb 版本:centos7.2内置的

主库服务器: 10.69.5.200,CentOS 7,MariaDB 10已安装,有数据。

从库服务器1: 10.69.5.201,CentOS 7,MariaDB 10已安装,无应用数据。

主服务器配置

以下操作在主服务器192.168.71.151的/etc/my.cnf上进行。

1.修改配置文件,命令:vim /etc/my.cnf,输入下列代码:

[root@localhost ~]# cat /etc/my.cnf[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sock`# 新添加的部分# 配置主从时需要添加以下信息 startinnodb_file_per_table=NOlog-bin=/var/lib/mysql/master-bin #log-bin没指定存储目录,则是默认datadir指向的目录binlog_format=mixedserver-id=200 #每个服务器都需要添加server_id配置,各个服务器的server_id需要保证唯一性,实践中通常设置为服务器IP地址的最后一位#配置主从时需要添加以下信息 end `# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group,# customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemd[mysqld_safe]log-error=/var/log/mariadb/mariadb.logpid-file=/var/run/mariadb/mariadb.pid## include all files from the config directory#!includedir /etc/my.cnf.d
本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/fwq/web/5751.html
上一篇CentOS 7下修改默认网卡名为eth0的两种方法
下一篇 centOS7下mysql插入中文字符报错问题解决方法
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部