摘要:
提醒:1.不建议生产环境使用单机模式2.切换需要停机时间(需要移除复制参数)3.切换前建议关闭应用,避免有写操作生产环境是一个三节点的复制集 [ { "_id" : 0, "name" : "node01:27017", "stateStr" : "PRIMARY" }, { "_id" : 1, 阅读全文
随笔档案-2023年02月
MySQL在已有数据的情况下添加新的自增主键字段
2023-02-23 14:57 by abce, 191 阅读, 收藏, 编辑
摘要:
alter table `tabname` add `id` bigint not null auto_increment first, add primary key (`id`); 备注:这条语句需要一次完全 阅读全文
debain关闭numa、ipv6和transparent_hugepage
2023-02-15 17:45 by abce, 406 阅读, 收藏, 编辑
摘要:
关闭numa、ipv6和transparent_hugepage $ sudo vi /etc/default/grub 添加 GRUB_CMDLINE_LINUX_DEFAULT="quiet numa=off transparent_hugepage=never ipv6.disable=1" 阅读全文
MongoDB连接字符串的URI格式
2023-02-15 13:27 by abce, 979 阅读, 收藏, 编辑
摘要:
两种的连接字符串格式 1.标准的连接格式 mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]] (1)单机连接格式 mongodb://username:password@ 阅读全文
如何修复'The storage engine for the table doesn't support repair'问题
2023-02-09 13:33 by abce, 2902 阅读, 收藏, 编辑
摘要:
当你修复mysql表的时候,可能会遇到'The storage engine for the table doesn't support repair'错误。 这个错误通常发生在尝试修复innodb表的时候。因为innodb存储引擎不支持repair操作。 可以使用以下命令查看表是哪种存储引擎: 阅读全文
MongoDB性能监控调优
2023-02-07 18:03 by abce, 194 阅读, 收藏, 编辑
摘要:
1.分析锁 > db.serverStatus().globalLock { "totalTime" : NumberLong("5011164491000"), "currentQueue" : { "total" : 0, "readers" : 0, "writers" : 0 }, "act 阅读全文
mongodb对内存的使用
2023-02-07 13:16 by abce, 163 阅读, 收藏, 编辑
摘要:
1.默认的分配策略 Starting in 3.4, the WiredTiger internal cache, by default, will use the larger of either: 50% of RAM minus 1 GB, or 256 MB. 即(总内存×50%-1GB)和 阅读全文