MySQL 无损复制
The rpl_semi_sync_master_wait_point system variable controls the point at which a semisynchronous replication master waits for slave acknowledgment of transaction receipt before returning a status to the client that committed the transaction. These values are permitted:
AFTER_SYNC (the default): The master writes each transaction to its binary log and the slave, and syncs the binary log to disk. The master waits for slave acknowledgment of transaction receipt after the sync. Upon receiving ackn ...
MongoDB 认证机制升级
早上某php开发反映新搭建的 mongodb 副本集连不上,后发现是认证问题导致的。
具体的报错信息如下:
1232019-07-11T10:31:38.142+0800 I ACCESS [conn1913292] authenticate db: bch_gn_xxx_com { authenticate: 1, user: "gn_bch_user", nonce: "xxx", key: "xxx" }2019-07-11T10:31:38.143+0800 I ACCESS [conn1913292] Failed to authenticate gn_bch_user@bch_gn_xxx_com with mechanism MONGODB-CR: AuthenticationFailed: MONGODB-CR credentials missing in the user document=
此环境的 mongodb 版本是 3.2 ,mongodb 3.* 有两种认证方 ...
mysqld got signal 11问题定位
昨天搭建的一个从库今天一直报警,看了下日志,直接报了个 mysqld got signal 11,
具体日志如下:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859602019-01-08T14:33:02.917330+08:00 14 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000549' at position 6759798, relay log './relay-log.001654' position: 42019-01-08T14:33:02.917776+08:00 13 [Note] Slave I/O thread for channel '': connected to mast ...
MySQL-based HA solutions
9 0. 0 0 0 % (36 days) MySQL Replication9 9. 9 0 0 % (8 hours) Linux Heartbeat with DRBD (Obsolete DRBD)9 9. 9 0 0 % (8 hours) RHCS with Shared Storage (Active/Passive)9 9. 9 9 0 % (52 minutes) MHA/Orchestrator with at least three nodes9 9. 9 9 0 % (52 minutes) DRBD and Replication (Obsolete DRBD)9 9 .9 9 5 % (26 minutes) Multi-Master (Galera replication) 3 node minimum9 9. 9 9 9 % (5 minutes) MySQL Cluster
MongoDB Could not find host matching read preference { mode primary } for set repl_shard1
最近在测试 MongoDB 4.0 分片集群 ,搭建好所有节点后,往mongos添加分片的时候,一直报错 Could not find host matching read preference { mode: \“primary\“ } for set ,如下
123456789101112131415mongos> sh.addShard( "repl_shard2/10.204.11.124:29017");{ "ok" : 0, "errmsg" : "Could not find host matching read preference { mode: \"primary\" } for set repl_shard1", "code" : 133, "codeName" : "FailedToSatisfyReadPreference ...
MongoDB 4.0 配置文件解读
Core Options 4.0 新增
cloud Options +
mongos-only Options +
去掉
Text Search Options
systemLog OptionssystemLog:
verbosity:
quiet:
traceAllExceptions:
syslogFacility:
path:
logAppend:
logRotate:
destination:
timeStampFormat:
component:
accessControl:
verbosity:
command:
verbosity:
# COMMENT additional component verbosity settings om ...
Replica Set Member States
最近写MongoDB监控脚本,要判断节点状态,这里整理了所有的节点状态值,对应 命令 rs.status().members 中的 state 和 stateStr 字段,如:
“state” : 3,“stateStr” : “RECOVERING”
| 0 | STARTUP | Not yet an active member of any set. All members start up in this state. The mongod parses the replica set configuration document while in STARTUP. || 1 | PRIMARY | The member in state primary is the only member that can accept write operations. Eligible to vote. || 2 | SECONDARY | A member in state secondary is replicating the data store. Eligible to ...
MongoDB 副本集 成员节点 RECOVERING 状态处理
这两天遇到好几个MongoDB集群故障,其中一种就是节点长期处于 RECOVERING 状态,并且不能主动追上 primary 节点,需要手动干预。首先 rs.status()查看实例状态,发现有的节点处于 RECOVERING 状态。
查看此节点 log 发现如下报错:
123456782018-07-17T19:04:27.343+0800 I REPL [ReplicationExecutor] syncing from: 10.204.11.48:93032018-07-17T19:04:27.347+0800 W REPL [rsBackgroundSync] we are too stale to use 10.204.11.48:9303 as a sync source2018-07-17T19:04:27.347+0800 I REPL [ReplicationExecutor] could not find member to sync from2018-07-17T19:04:27.347+0800 E REPL [rsBack ...
Torvalds says he has no strong opinions on systemd
Linux creator Linus Torvalds is well-known for his strong opinions on many technical things. But when it comes to systemd, the init system that has caused a fair degree of angst in the Linux world, Torvalds is neutral.
“When it comes to systemd, you may expect me to have lots of colourful opinions, and I just don’t,” Torvalds told iTWire in an interview. “I don’t personally mind systemd, and in fact my main desktop and laptop both run it.
In a reference to a spat he had with Kay Sievers, one of ...
数据库解耦案例
随着业务越来越复杂,数据量越来越大,并发量越来越大,数据库的性能越来越低。好不容易找运维申请了两台机器,让DBA部署了几个实例,想把一些业务库拆分出来,却发现拆不出来,扩不了容,尴尬!
因为数据库强关联在一起,无法通过增加数据库实例扩容,就是一个耦合的典型案例。
场景还原
有一个公共用户数据库DB_USER,里面table_user存放了通用的用户数据:
table_user (uid, name, passwd, …)
在数据量比较小,并发量比较小,业务还没有这么复杂的时候,为了提高资源利用率(程序员才没有考虑什么资源利用率,更多的是图方便),业务A把用户个性化的数据也放在这个库里:
table_A(uid, A业务的个性化属性)
业务A有一个需求,即要展现用户公共属性,又要展现业务A个性化属性,程序员经常这么实现的:
select * from table_user, table_A
_ where table_user.uid = table_A.uid_
_ and table_user.uid = $uid_
初期关联查询没有任何问题, ...