您的位置:网站首页 > 行业资讯 > 行业动态 > 正文

申博现金网网址_申博现金网网址【授权官网】

  2016-01-21 22:18  中国润滑油信息网
申博现金网网址_申博现金网网址【授权官网】 平日给予replication slave,replication client

+--------------------+

#在主节点授权具有仿制权限用户

sync_binlog=on#在营业提交时,当即把bin-log缓存区中的工作当即刷写到磁盘到的二进制日志区上,确保从办事器尽早同步数据

| file| position | binlog_do_db | binlog_ignore_db |

relay-bin.relay-bin.relay-bin.index

+------+

mariadb [(none)]> use helloit;

[mysqld]

| rpl_semi_sync_master_tx_wait_time| 18407 |

| it|

last_sql_error:

mariadb [helloit]> select * from test;

主1

replicate_ignore_server_ids:

| variable_name| value |

last_io_error:

|2 |

connect_retry: 60

socket=/var/lib/mysql/mysql.sock

master_ssl_allowed: no

skip_counter: 0

| rpl_semi_sync_master_no_times| 0|

+------+

#主1上的二进制日志和中继日志

#log-bin=/data/binlogs/bin-log

innodb_file_per_table=on

+------+

mariadb [(none)]> show global status like '%semi%';

-- change master to master_log_file='master-bin.', master_log_pos=245;

#上面的措施,是从数据库从0起头同步主的数据,很简单就没有贴试验

| mba|

datadir=/data/mydata

|1 |

datadir=/data/mydata

| mysql|

last_sql_errno: 0

mariadb [test]> use helloit;

auto_increment_offset=1

并没有it这个新创立的数据库

申博现金网网址_申博现金网网址【授权官网】

replicate_do_table:

+--------------------------------------------+-------+

| mysql|

datadir=/data/mydata

把稳:

+--------------------+

mariadb [(none)]> grant replication slave,replication client on *.* to "test"@"10.0.0.88" identifiedby "test";

| rpl_semi_sync_master_clients| 1|

seconds_behind_master: 0

| rpl_semi_sync_master_timefunc_failures| 0|

+--------------------------------------------+-------+

|3 |

+------+

datadir=/data/mydata

5 rows in set (0.00 sec)

+--------------------+

log-bin=/data/binlogs/master-bin

| mysql|

在主上刺进数据

+--------------------+

mariadb [mba]> show databases;

[root@centos7-4 data]# ls /data/binlogs/

until_log_file:

+---------------------------------+-------+

read_only=on

+------+

5 rows in set (0.02 sec)

mariadb [test]> show databases;

query ok, 1 row affected (0.00 sec)

#在从节点上装配从的半同步插件

mariadb [mba]> show tables;

socket=/var/lib/mysql/mysql.sock

在从上反省

+------------------------------------+-------+

[mysqld]

innodb_flush_log_at_trx_commit=on#当运用innodb引擎,在营业提交时,把内存中跟营业有关的数据当即写到营业日志中

mariadb [(none)]> change master to master_host="10.0.0.88",master_user="test",master_password="test",master_log_file="bin-log.",master_log_pos=671;

+-------------------+----------+--------------+------------------+

socket=/var/lib/mysql/mysql.sock

| performance_schema |

| database|

mariadb [(none)]> start slave;

mariadb [(none)]> flush privileges;

replicate_wild_ignore_table=

主设置设备摆设文件

#log-bin=/data/binlogs/bin-log

|2 |

slave_sql_running: yes

datadir=/data/mydata

半同步

| database|

| test|

| information_schema |

| rpl_semi_sync_master_no_tx| 0|

|2 |

mariadb [(none)]> change master to master_host="10.0.0.41",master_user="test",master_password="test",master_log_file="master-bin.",master_log_pos=413;

+---------------+

|2 |

| performance_schema |

#在主2上连主1

mariadb [helloit]> insert into test values (1),(2),(3);

query ok, 0 rows affected (0.00 sec)

| rpl_semi_sync_master_clients| 1|

# log-bin=/data/binlogs/bin-log

mariadb [(none)]> show global variables like "%semi%";

| rpl_semi_sync_master_wait_pos_backtraverse | 0|

mariadb [helloit]> insert into test values (4),(5),(6);

#在主上反省是不是有从节点参加

| mysql|

+--------------------+

1 row in set (0.00 sec)

| database|

server-id=7

| file| position | binlog_do_db | binlog_ignore_db |

replicate_ignore_table=#表的黑名单

master_ssl_verify_server_cert: no

#并没有 helloit这个

|3 |

| test|

| test|

+---------------+

| rpl_semi_sync_master_net_wait_time| 17434 |

#现已有一个备用节点参加

mariadb [(none)]> show master status;

| database|

| hellodb|

slave_io_state: waiting for master to send event

mariadb [helloit]> select * from test;

replicate_wild_do_table:

master-bin.master-bin.index

relay_master_log_file: master-bin.

[mysqld]

|1 |

#反省主从能同步后,封闭主从状况,参加半同步插件

replicate_do_db=mba#只容许仿制mba

4、各自界说主动增添键为奇数和偶数

mariadb [(none)]> change master to master_host='10.0.0.41',master_user='test',master_password='test';

replicate_do_db=#白名单,只仿制某个数据库

relay_log_space: 1688

[mysqld]

#从设置设备摆设文件

+--------------------+

| database|

[root@centos7-4 data]# ls binlogs/

+--------------------+

replicate_do_db:

| hellodb|

| master-bin. |1115 |||

6 rows in set (0.00 sec)

+--------------------+

log-bin=/data/binlogs/master-bin

+--------------------+

#在主1上连主2

query ok, 0 rows affected (0.00 sec)

innodb_file_per_table=on

+------+

+--------------------------------------------+-------+

mariadb [mba]> insert into hello values (1),(2),(3);

| id|

| test|

| test|

innodb_file_per_table=on

#在主2上反省是不是同步

mariadb [helloit]> show tables;

| rpl_11108com资料semi_sync_master_trace_level| 32|

| tables_in_mba |

mariadb [(none)]> source /root/all.sql;

+--------------------+

last_errno: 0

|4 |

2、在主从节点分袂设置sync_master_info=on、sync_relay_log=on、sync_relay_log_info=on会下降i/o功能

#完结半同步进程需求1.8s摆布

#在从上毗连主数据库

在主上刺进其余库数据

| rpl_semi_sync_master_wait_no_slave | on|

| mysql|

#再次在主数据库刺进数据

| tables_in_helloit |

| rpl_semi_sync_master_status| on|

+------+

主设置设备摆设文件

until_condition: none

#在主上创立新数据,测验感化

mariadb [mba]> create table hello (id int);

+------------------------------------+-------+

#在从办事器上毗连到主

| database|

datadir=/data/mydata

| rpl_semi_sync_slave_trace_level | 32|

innodb_file_per_table=on

#验证试验成果

| hello|

| mysql|

+-------------------+----------+--------------+------------------+

仿制过滤器

在从数据库上反省

注:可用参数

+--------------------+

| rpl_semi_sync_master_no_tx| 0|

mariadb [(none)]> grant replication slave,replication client on *.* to "test"@"10.0.0.41" identifiedby "test";

until_log_pos: 0

| rpl_semi_sync_master_tx_avg_wait_time| 0|

[root@centos7-4 ~]# less all.sql

+--------------------+

#在备节点上

master-bin.master-bin.index

master_port: 3306

|4 |

mariadb [(none)]> set global rpl_semi_sync_slave_enabled=1;

[mysqld]

[root@centos7-4 ~]# mysqldump --all-databases --flush-logs --master-data=2 --lock-all-tables >all.sql

+------+

|1 |

mariadb [mba]> show databases;

mariadb [(none)]> set global rpl_semi_sync_master_enabled=1;

mariadb [(none)]> install plugin rpl_semi_sync_slave soname 'semisync_slave.so';

| performance_schema |

+-------------------+

#主2上的二进制日志和中继日志

| database|

[root@centos7-4 data]# ls relogs/

+--------------------+

socket=/var/lib/mysql/mysql.sock

master_host: 10.0.0.41

+--------------------+

query ok, 3 rows affected (0.02 sec)

|3 |

| rpl_semi_sync_slave_enabled| on|

+-------------------+

奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫 1. row 奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫

master_ssl_key:

|1 |

[root@mariadb data]# ls relogs/

|3 |

+------+

| rpl_semi_sync_master_status| on|

mariadb [helloit]> create table test (id int);

#在主节点上装配主的半同步插件

从数据库设置设备摆设文件

#主设置设备摆设文件

socket=/var/lib/mysql/mysql.sock

| rpl_semi_sync_master_net_waits| 0|

mariadb [hellodb]> show databases;

query ok, 3 rows affected (0.02 sec)

master_user: test

mariadb [test]> start slave;

| it|

+---------------------------------+-------+

2、从办事器sql_thread在replay中继日志中的工作时,仅读取与特定命据库(特定表)有关的工作并利用于本地

#这时再实檀越从同步

replicate_ignore_db=#黑名单

让从节点仅仿制指定命据库,或指定命据库的指定表

#下面是先做彻底回覆再起后再从工作某方位同步主数据

| information_schema |

#在从上发动sql和io线程

|2 |

| information_schema |

relay_log_file: relay-bin.

last_error:

mariadb [(none)]> stop slave;

auto_increment_offset=2

mariadb [mba]> create database it;

mariadb [(none)]> change master to master_host="10.0.0.41",master_user="test",master_password="test",master_log_file="master-bin.",master_log_pos=671;

replicate_wild_ignore_table:

|3 |

+------+

| rpl_semi_sync_master_tx_wait_time| 0|

master_ssl_cipher:

| test|

|6 |

| variable_name| value |

| variable_name| value |

records: 3duplicates: 0warnings: 0

mariadb [(none)]> grant replication slave,replication client on *.* to "test"@"10.0.0.88" identifiedby "test";

6 rows in set (0.00 sec)

| hellodb|

| test|

+----------------+----------+--------------+------------------+

| performance_schema |

2、都发动binary log 和relay_log

+------+

server-id=1

| rpl_semi_sync_master_timeout| 10000 |

| information_schema |

| rpl_semi_sync_master_enabled| on|

| variable_name| value |

slave_io_running: yes

| master-bin. |671 |||

+-------------------+----------+--------------+------------------+

| helloit|

+-------------------+----------+--------------+------------------+

relay-log=/data/relogs/relay-bin

| file| position | binlog_do_db | binlog_ignore_db |

mariadb [(none)]> create database helloit;

relay_log=/data/relogs/relay-bin

socket=/var/lib/mysql/mysql.sock

主主仿制

mariadb [(none)]> start slave;

relay_log_pos: 1400

| hellodb|

|5 |

master_ssl_ca_file:

+--------------------+

innodb_file_per_table=on

mariadb [helloit]> select * from test;

为了便利,我这儿给的权限异常大年夜,出产情况不主张这么搞

| id|

|2 |

#先导入彻底备份的数据

|5 |

mariadb [(none)]> grant all on *.* to "test"@"10.0.0.%" identified by "test";

+------+

#分袂发动从形式

| rpl_semi_sync_master_net_avg_wait_time| 17434 |

relay-log=/data/relogs/relay-bin

设置设备摆设进程:

mariadb [(none)]> create database mba;

mariadb [(none)]> show global variables like "%semi%";

[mysqld]

mariadb [helloit]> select * from test;

+----------------+----------+--------------+------------------+

+--------------------+

mariadb [(none)]> source /root/hellodb.sql

2 rows in set51hupai.org (0.00 sec)

| performance_schema |

+------+

replicate_wild_do_table=#表的通配表达,白名单

master_ssl_ca_path:

5、均把对方指定为主节点,并发动仿制线程

| database|

+--------------------+

|6 |

| rpl_semi_sync_master_tx_waits| 0|

innodb_support_xa=on#innodb支撑散播式营业

mariadb [(none)]> start slave;

+-------------------+----------+--------------+------------------+

mariadb [hellodb]> show databases;

replicate_ignore_table:

| bin-log. |671 |||

log-bin=/data/binlogs/master-bin

mariadb [mba]> select * from hello;

| id|

+------+

mariadb [(none)]> install plugin rpl_semi_sync_master soname 'semisync_master.so';

| information_schema |

在从办事器设置设备摆设参数过滤,只仿制mba之个库

#在主2上创立一个数据库

#主上创立具有仿制权限的帐号

| it|

server-id=7

| rpl_semi_sync_master_net_waits| 1|

| mba|

server-id=1

| rpl_semi_sync_master_wait_sessions| 0|

mariadb [(none)]> flush privileges;

mariadb [test]> show databases;

有2种措施:

| information_schema |

server-id=7

+--------------------+

start slave

mariadb [(none)]> flush privileges;

log-bin=/data/binlogs/bin-log

+--------------------+

| test|

+--------------------+

#在从数据库上反省成果

server-id=1

| id|

|1 |

| hellodb|

+--------------------+

master_server_id: 1

| rpl_semi_sync_master_wait_pos_backtraverse | 0|

| rpl_semi_sync_master_net_avg_wait_time| 0|

mariadb [mba]> select * from hello;

master_ssl_cert:

+----------------+----------+--------------+------------------+

bin-log.bin-log.bin-log.bin-log.index

+--------------------------------------------+-------+

records: 3duplicates: 0warnings: 0

relay-bin.relay-bin.relay-bin.index

mariadb [helloit]> show master status;

mariadb [(none)]> flush tables with read lock;

1、从办事器该当为只读形式,在设置设备摆设文件里设置read_only=on,可是关于超级解决用户无效,需求从终端施加读锁,不停在后台运转:

| rpl_semi_sync_master_tx_avg_wait_time| 18407 |

+--------------------+

master_log_file: master-bin.

| rpl_semi_sync_master_yes_tx| 1|

|3 |

1、主理事器仅向二进制日志中纪录与特定命据库(特定表)有关的工作,不主张运用,因为无法完成时候回覆再起

从设置设备摆设文件

+------+

+------------------------------------+-------+

| test|

| rpl_semi_sync_master_yes_tx| 0|

mariadb [(none)]> show master status;

+--------------------------------------------+-------+

+---------------------------------+-------+

mariadb [(none)]> show databases;

exec_master_log_pos: 1115

skip_slave_start=on #第1次发动start slave后,重启从mysql后,默许slave主动发动,该当封闭主动发动

auto_increment_increment=2

last_io_errno: 0

| rpl_semi_sync_master_timefunc_failures| 0|

| rpl_semi_sync_master_tx_waits| 1|

| id|

| mysql|

innodb_file_per_table=on

| information_schema |

relay-log=/data/binlogs/relay-bin

+-------------------+

+---------------+

| rpl_semi_sync_master_no_times| 0|

1、各个节点运用一个仅有的server_id

现已双主同步

server-id=7

socket=/var/lib/mysql/mysql.sock

+------+

read_master_log_pos: 1115

| rpl_semi_sync_master_wait_sessions| 0|

6 rows in set (0.02 sec)

各自创立授权帐号

1 row in set (0.00 sec)

mariadb [helloit]> grant replication slave,replication client on *.* to "test"@"10.0.0.88" identifiedby "test";

replicate_do_table=#表的白名单

| id|

+------+

| mysql|

| performance_schema |

[root@mariadb data]# ls binlogs/

mariadb [(none)]> show global status like '%semi%';

| performance_schema |

#在主1上反省

| information_schema |

innodb_file_per_table=on

replicate_ignore_db:

+--------------------------------------------+-------+

[mysqld]

| performance_schema |

主2

| hellodb|

|1 |

auto_increment_increment=2

#在主1上刺进一些数据

+------+

从设置设备摆设文件

mariadb [test]> change master to master_host="10.0.0.41",master_user="test",master_password="test",master_log_file="master-bin.",master_log_pos=245;

[root@centos7-4 ~]# scp all.sql 10.0.0.41:/root/

+--------------------+

mariadb [helloit]> show slave status\g;

| rpl_semi_sync_master_net_wait_time| 0|

+--------------------+

mariadb [(none)]> show databases;

datadir=/data/mydata

relay-log=/data/relogs/relay-bin

+-------------------+----------+--------------+------------------+

3、创立具有仿制权限的用户帐号

  本文系中国润滑油信息网(www.sinolub.com)原创作品,若需转载务必以超链接的形式注明出处,转载时严禁任何有悖原文的文字修改;本网有权对所有侵权行为进行责任追究。

分享到: QQ空间 新浪微博 人人网 开心网 腾讯微博 更多

相关新闻

友情提醒

本信息真实性未经中国润滑油信息网证实,仅供您参考。未经许可,请勿转载。已经本网授权使用的,应在授权范围内使用,并注明“来源:中国润滑油信息网”。

本网部分文章转载自其它媒体,转载目的在于传递更多行业信息,并不代表本网赞同其观点和对其真实性负责。在本网论坛上发表言论者,文责自负,本网有权在网站内转载或引用,论坛的言论不代表本网观点。本网所提供的信息,如需使用,请与原作者联系,版权归原作者所有。如果涉及版权需要同本网联系的,请在15日内进行。

官方微博

热点招商

奥吉星润滑油全国招商

奥吉星润滑油(天泰集团化工控股有限公司 股票代码:GTS)是由天泰控股的专业润滑油生产企业。 全国招商热线:400-0635-789

Gulf海湾石油面向全国招商

海湾石油(中国)有限公司是Gulf Oil International 在国内的唯一子公司。 现诚招经销商。 招商热线:0535-2161171

埃尼润滑油面向全国招商

埃尼是一家综合性能源企业,业务遍及83个国家,拥有84,000名员工,从事石油和天然气勘探、生产、运输、转化和营销活动,业务涉及化工、油田服务、建筑和工程领域。

关于我们|本网动态|广告服务|联系方式|免责声明|版权信息|法律顾问
CopyRight©2015-2016 Sinolub.Com All Rights Reserved 九鼎公司 版权所有
《中华人民共和国增值电信业务经营许可证》编号:粤B2-20050302
服务热线:0754-88650988 在线服务QQ:619128006 润滑油商机信息群:③:50693127 ④:65958932