mysql master-master配置

同ubuntu下配置:(转自:http://archive.cnblogs.com/a/2214282/

Master 1 Config File:

 

#
# The MySQL database server configuration file.
#
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set = utf8

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#My Features
default-character-set = utf8
skip-name-resolve
default-storage-engine = InnoDB
default-table-type = InnoDB
innodb_flush_log_at_trx_commit=0
federated

#Master
server-id = 1
log-bin=mysql-bin
binlog-do-db=s3
binlog-ignore-db=mysql
sync_binlog=1
auto_increment_increment=2
auto_increment_offset=1

#Slave
skip-name-resolve
slave-skip-errors
log-slave-updates
master-user=sync
master-password=123456
master-port=3306
master-connect-retry=30
replicate-do-db=s3
relay-log=S3-DB-M-1-relay-bin
#
# * Basic Settings
#

user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1

log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

[mysqldump]
quick
quote-names
max_allowed_packet = 24M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Master 2 Config File:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set = utf8

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
default-character-set = utf8
skip-name-resolve
default-storage-engine = InnoDB
default-table-type = InnoDB
innodb_flush_log_at_trx_commit=0
federated

#master
server-id = 2
log-bin=mysql-bin
binlog-do-db=s3
binlog-ignore-db=mysql
sync_binlog=1
auto_increment_increment=2
auto_increment_offset=2

#Slave
skip-name-resolve
slave-skip-errors
log-slave-updates
master-user=sync
master-password=123456
master-port=3306
master-connect-retry=30 #断网后间隔30秒重连
replicate-do-db=s3
relay-log=S3-DB-M-2-relay-bin

#
# * Basic Settings
#

#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1

log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 24M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Centos
转自:http://whxhz.iteye.com/blog/1164662
 
 
不同os下,其实配置也一样,先单向建立master-slave,再逆向建立master-slave即可。

 

应用商店评论分析实战:Python逆向工程破解Google Play加密接口与NLP建模 在移动互联网时代,应用商店中的用户评论成为了开发者优化应用、提升用户体验的重要依据。然而,Google Play等应用商店对评论数据进行了加密处理,直接爬取难度较大。本文将介绍如何使用Python逆向工程破解Google Play的加密接口,实现对应用商店评论的实时采集,并结合NLP(自然语言处理)技术进行情感分析和主题建模,为开发者提供有价值的数据支持。 阅读详情

相关推荐

HP ProLiant DL360p Gen8 服务器 用户指南.pdf

HP ProLiant DL360p Gen8 服务器 用户指南.pdf

K8S安装笔记(一)—— master节点完整安装配置

一、基础环境配置 1.1 关闭防火墙 systemctl stop firewalld && systemctl disable firewalld 1.2 关闭selinux sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久 setenforce 0 # 临时 1.3 关闭swap swapoff -a # 临时 vi /etc/fstab # 永久 1.4 关设置主机名 hostname # 查看本机hostnam

gmHappy 3万+

MySQLMaster配置的方法详解

本篇文章是对MySQLMaster配置进行了详细的分析介绍,需要的朋友参考下

三.配置master系统网络 超详细步骤(学习过程)

虚拟机大数据集群环境搭建安装:准备3 配置master系统网络

2302_82179278的博客 346

【十七】MySQL-主从(Master/Slave)同步安装与配置详解

MySQL5.6 数据库主从(Master/Slave)同步安装与配置详解 一、安装环境 操作系统Red Hat 4.8.5-28 MySQL 版本:MySQL-5.6.45-1.el7.x86_64.rpm-bundle.tar 主节点 IP:192.168.1.49 从节点 IP:192.168.1.52 二、Master 配置 1、修改 Master配置文件 [root@localhost ~]# vi /etc/my.cnf # 在 [mysqld] 中增...

作者:大头兵(kit) 3587

bindchange 参数_MySQL主从复制(3)——Change Master参数详解

MySQL主从复制(3)——Change Master参数详解在进行MySQL主从复制配置时,change master 用于配置和改变 slave 服务器用于连接 master 服务器的参数,以便 slave服务器读取 master 服务器的 binlog 及 slave 服务器的 relay log。同时更新 master.info 及 relay-log.info信息。执行该语句之前从服务器...

weixin_36429993的博客 555

MySQL 集群 —— 一主一从

文章目录1、MySQL主从原理2、主从环境2.1、虚拟机准备2.2 、检查主从mysql服务是否正常3、主库实现步骤3.1、配置master主库服务器3.2、在master库上创建备份账户并授权4、从库实现步骤4.2、slave 的MySQL配置4.3、从库进行change master 设置4.4、其它相关命令:5、mysql主从同步测试5.1、在master主库上,你可以看到slave的I/...

猎人在吃肉 2001

mysql配置master_Mysql-Master与Slave配置

今天在ubuntu下进行了mysqlMaster和Slave的简单配置,基本上属于hello world的难度,但是看起来很简单,但真正做一遍,可不是那么的容易了。环境:在两台电脑上,开启mysql服务。原理:在slave端会有两个线程负责同步工作,一个IO线程,负责将master中的bin log读取过来转换为relay log;另一个是sql线程,根据relay log执行sql语句。首先说...

weixin_33179060的博客 410

mysql slave 详细配置_mysql slave,master配置

一个完整的mysql读写分离环境包括以下几个部分:应用程序clientdatabase proxydatabase集群在本次实战中,应用程序client基于c3p0连接后端的database proxy。database proxy负责管理client实际访问database的路由策略,采用开源框架amoeba。database集群采用mysqlmaster-slave的replication方...

weixin_29019241的博客 1593

MySQLMaster-Master配置

近期在测试MySQL双主多个slave架构,利用keepavlied实现自动切换Master。主要工作有: 1、MySQL Mater-Maste工作(前期) 2、Keepavlied搭建,还可以结合MySQL Proxy实现读写分离 3、处理Master-Mater-Slave之间的同步关系 首先,先搭建Mater-Master的环境。

闲云野鹤,悠然自得 749

mysql配置master_mysql配置master/slave模式

上文讲了安装mysql步骤,此时我们在两台虚拟机上安装同样的mysql192.168.153.129 master192.168.153.130 slave好了,现在开始配置master/slave一、在master上增加slave的账号创建backup账户,再设置REPLICATION权限GRANT USAGE ON *.* TO 'backup'@'192.168.%' IDENTIFIE...

weixin_35952290的博客 557

mysql+master+salve,mysql master slave 配置

给指定的ip 开启权限GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.25.131' IDENTIFIED BY 'root' WITH GRANT OPTION;mysql master slave 配置 1配置masterserver-id=1log-bin=mysql-binbinlog-ignore-db=information_schemab...

weixin_30391889的博客 135

Mysql配置master/slave同步

修改:sudo vim /var/lib/mysql/auto.cnf,修改server-uuid,两台服务器不一样即可。Mysql配置文件:sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf。若两台服务器是复制的(包括mysql),则mysql的uuid的可能会相同,需要改uuid。server-id=88 //唯一,不可与局域网内其他server-id重复。重启mysql:service mysql restart。Master服务器A:172.16.0.88。

longmenyizu的博客 270

MySQLMaster/Slave集群安装和配置

本文讲述MySQLMaster/Slave集群安装和配置,安装的版本是最新的稳定版本GA 5.6.19。 为了支持有限的HA,我们使用Master/Slave简单的读写分离集群。有限的HA是指当Master不可用时,数据不会丢失,但在Master宕机的情况下是不可写的,必须手工处理故障。如果要支持更高的可用性,可以使用两台Master来做热切换。 Master和Slave的MySQL

LinYueTong的专栏 795

2.Linux下配置Hadoop集群之主节点(master)网络配置

(1)点击虚拟机左上角编辑选中虚拟网络编辑器 (2)网络参数配置

ghw666666666的博客 3083

Docker——docker构建Mysq5.7集群环境

在大型的系统中数据库为整个系统的基础设施。在系统的设计中尤为重要,一般在大型的项目的中数据路的配置都不是单点的。一般设计为主从架构或者一主多从架构或者高可用集群架构等。如果在生产环境中构建一个的这样的架构采用原生的安装配置方式比较复杂,本博文使用docker的方式来是生产环境下的mysql主从、一主多从、高可用集群环境。帮助大家在生产环境中能够快速的获取mysql集群的一种方式。

庄小焱 2068

K8S入门-04-配置master节点

K8S入门-04-配置master节点

敦格 7467

MySQL 8.0主从(Master-Slave)配置

MySQL 主从复制的方式有多种,本文主要演示基于基于日志(binlog)的主从复制方式。 MySQL 主从复制(也称 A/B 复制) 的原理 Master将数据改变记录到二进制日志(binary log)中,也就是配置文件log-bin指定的文件, 这些记录叫做二进制日志事件(binary log events); Slave 通过 I/O 线程读取 Master 中的 binary log events 并写入到它的中继日志(relay log); Slave 重做中继日志中

baidu_37366055的博客 7030
上一篇: VirtualBox虚拟机网络设置
下一篇: crontab 标准输出
findingwork
博客等级 码龄17年 1粉丝 72原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值