MongoDB 异常掉电后的数据打捞
背景
当异常掉电后,实例启动会报类似如下错误,属于文件级别的损坏,这时候常规的修复方案是没用的,可以使用 wt 进行数据打捞。
123452019-07-10T21:06:05.725-0500 E STORAGE [initandlisten] WiredTiger (0) [1454119565:724960][1745:0x7f2ac9534bc0], file:WiredTiger.wt, cursor.next: read checksum error for 4096B block at offset 6799360: block header checksum of 1769173605 doesnt match expected checksum of 41760847832019-07-10T21:06:05.725-0500 E STORAGE [initandlisten] WiredTiger (0) [1454119565:725067][1745:0x7f2ac9534bc0], file:WiredTiger.wt, cursor.next: Wir ...
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 ...