编辑/etc/security/limits.conf
文件,添加或修改相应的行来增加限制。例如:
1 | * soft nproc 65535 |
编辑/etc/security/limits.conf
文件,添加或修改相应的行来增加限制。例如:
1 | * soft nproc 65535 |
Iot GateWay Agent依赖JRE1.8环境,需要配置JRE环境后,IOT GateWay配置的Agent才会生效和有效!
Iot GateWay Agent依赖JRE1.8环境,需要配置JRE环境后,IOT GateWay配置的Agent才会生效和有效!
Iot GateWay Agent依赖JRE1.8环境,需要配置JRE环境后,IOT GateWay配置的Agent才会生效和有效!日志信息 KEPServerEX\IoT Gateway IoT Gateway using JRE at [C:\Program Files (x86)\Java\jre-1.8].
日志信息 KEPServerEX\IoT Gateway IoT Gateway using JRE at [C:\Program Files (x86)\Java\jre-1.8].
日志信息 KEPServerEX\IoT Gateway IoT Gateway using JRE at [C:\Program Files (x86)\Java\jre-1.8].
1 | 日期 时间 级别 源 事件 |
C:\Program Files (x86)\Java\jre-1.8\jre
】配置到jre目录,不要到bin
目录时间限制破解版
1 | 1、把 KEPServerEX V6.x Crack.exe 放在 C:\Program Files\Kepware\KEPServerEX *\ 文件夹中 |
1 | 1:把 KEPServerEX V5.xV6.x Crack.exe 放在 C:\Program Files (x86)\Kepware\KEPServerEX 6 |
MongoDB
的副本集(Replica Set)
是一种提供数据冗余和高可用性的架构。它是由多个维护相同数据集的mongod
进程(即数据库实例)组成的一个集合,这些实例分布在不同的服务器上。
副本集的设计目标是为了确保在单个服务器发生故障时,数据库服务依然可以继续运作,从而提高了系统的可靠性和容错能力。
副本集有两种类型三种角色
一台机器上部署三个mongodb节点
IP地址 | 端口 | 角色 |
---|---|---|
192.168.0.245 | 27017 | 主节点 |
192.168.0.246 | 27018 | 副本节点 |
192.168.0.247 | 27019 | 仲裁节点 |
1 | sudo /opt/data/mongodb-27017/bin/mongod -f /opt/data/mongodb-27017/mongod-27017.yaml |
配置 MongoDB 副本集时,启用了认证(authorization
),但没有指定密钥文件(keyFile
)。在 MongoDB
副本集中,如果启用了认证功能,密钥文件是必需的,用于成员之间的身份验证。
密钥文件必须具有适当的权限,以防止未经授权的访问。
1 | openssl rand -base64 756 > /opt/data/mongodb-27017/keyfile |
1 | # Where and how to store data. |
mongod-27017.yaml
)vim /opt/data/mongodb-27017/mongod-27017.yaml
1 | systemLog: |
System 服务命令
1 | [Unit] |
mongod-27018.yaml
)vim /opt/data/mongodb-27018/mongod-27018.yaml
1 | systemLog: |
System 服务命令
1 | [Unit] |
mongod-27019.yaml
)vim /opt/data/mongodb-27019/mongod-27019.yaml
1 | systemLog: |
System 服务命令
1 | [Unit] |
rs.initiate()
1 | rs.initiate({ |
1 | test> show dbs; |
rs.config()
1 | replicaset [direct: primary] test> rs.config() |
rs.status()
1 | replicaset [direct: primary] test> rs.status() |
rs.add("192.168.0.204:27018")
可以看到是 (not reachable/healthy) ,说明添加的副本节点是有问题的,正常的应该是 SECONDARY ,查看日志
1 | rs.add("192.168.0.204:27018") |
rs.remove("192.168.0.204:27018")
1 | rs.remove("192.168.0.204:27018") |
rs.addArb("192.168.0.204:27019")
1 | rs.addArb("192.168.0.204:27019") |
1 | 1. Reconfig attempted to install a config that would change the implicit default write concern. Use the setDefaultRWConcern command to set a cluster-wide write concern and try the reconfig again. |
在 MongoDB 中,
db.adminCommand
是一个用于执行管理命令的方法,而你提到的命令:
1 | db.adminCommand({ |
是用于设置默认的写关注(Write Concern)配置的命令。以下是详细解释:
setDefaultRWConcern
: 这是一个管理命令,用于设置默认的读写关注(Read/Write Concern)配置。1
表示启用此功能。defaultWriteConcern
: 这是设置默认的写关注配置。w: 2
表示写操作需要在至少两个节点上成功确认后才返回成功。写关注(Write Concern)定义了写操作需要在多少个节点上成功确认后才返回成功。它主要用于控制数据的持久性和一致性。
w: 1
: 默认值,表示写操作只需在主节点上成功即可。w: 2
: 表示写操作需要在主节点和至少一个从节点上成功确认。w: "majority"
: 表示写操作需要在大多数节点上成功确认。在 MongoDB 集群(如副本集或分片集群)中,写关注配置非常重要,因为它直接影响数据的持久性和性能:
w: 2
或 w: "majority"
)可以确保数据在多个节点上持久化,从而提高数据的可用性和一致性。1 | use admin |
配置 MongoDB 副本集时,启用了认证(authorization
),但没有指定密钥文件(keyFile
)。在 MongoDB
副本集中,如果启用了认证功能,密钥文件是必需的,用于成员之间的身份验证。
密钥文件必须具有适当的权限,以防止未经授权的访问。
1 | openssl rand -base64 756 > /opt/data/mongodb-27017/keyfile |
keyfile are too open
1 | {"t":{"$date":"2025-05-27T03:01:21.276+00:00"},"s":"I", "c":"ACCESS", "id":20254, "ctx":"main","msg":"Read security file failed","attr":{"error":{"code":30,"codeName":"InvalidPath","errmsg":"permissions on /opt/data/mongodb-27017/keyfile are too open"}}} |
这个错误信息表明 MongoDB 无法启动,因为密钥文件 /opt/data/mongodb-27017/keyfile
的权限设置不正确。MongoDB
要求密钥文件的权限必须严格限制,以确保只有 MongoDB 进程可以访问它。
Read security file failed
**:MongoDB 无法读取密钥文件。permissions on /opt/data/mongodb-27017/keyfile are too open
**:密钥文件的权限设置过于宽松,MongoDB 不允许这种情况。你需要确保密钥文件的权限正确设置,具体步骤如下:
运行以下命令查看密钥文件的当前权限:
1 | ls -l /opt/data/mongodb-27017/keyfile |
你可能会看到类似以下的输出:
1 | -rw-r--r-- 1 mongodb mongodb 756 May 27 03:00 /opt/data/mongodb-27017/keyfile |
这表示当前权限是 644
(所有者可读写,组可读,其他用户也可读)。
MongoDB 要求密钥文件的权限必须是 600
(只有所有者可以读写,其他用户无权限)。运行以下命令设置正确的权限:
sudo chmod 600 /opt/data/mongodb-27017/keyfile
再次运行 ls -l
命令,确保权限已正确设置:
无密码模式
1 | spring.data.mongodb.uri=mongodb://192.168.0.204:27017,192.168.0.204:27018,192.168.0.204:27019/my-app?replicaSet=replicaset |
有密码模式
1 | spring.data.mongodb.uri=mongodb://db_manager:db_manager@192.168.0.204:27017,192.168.0.204:27018,192.168.0.204:27019/my-app?replicaSet=replicaset&authSource=admin |
rs.status()
name: ‘192.168.0.204:27017’ stateStr: ‘PRIMARY’
name: ‘192.168.0.204:27018’ stateStr: ‘SECONDARY’
name: ‘192.168.0.204:27019’ stateStr: ‘ARBITER’
rs.stepDown(600)
)primary直接降级在600s内不会把自己选为primary可以通过设置优先级(priority)来设置额外票数。优先级即权重,取值为0-1000,相当于增加0-1000的票数,优先级的值越大,就越可能获得多数成员的投票(votes)数。指定较高的值可使成员更有资格成员主要成员,更低的值可使成员更不符合条件。
一旦触发选举,就要根据一定规则来选主节点。
票数最高,且获得了“大多数”成员的投票支持的节点获胜。
“大多数”的定义为:假设复制集内投票成员数量为N,则大多数为 N/2 +
1。例如:3个投票成员,则大多数的值是2。当复制集内存活成员数量不足大多数时,整个复制集将无法选举出Primary,复制集将无法提供写服务,处于只读状态。
若票数相同,且都获得了“大多数”成员的投票支持的,数据新的节点获胜。数据的新旧是通过操作日志oplog来对比的。
在获得票数的时候,优先级(priority)参数影响重大。可以通过设置优先级(priority)来设置额外票数。优先级即权重,取值为0-1000,相当于可额外增加0-1000的票数,优先级的值越大,就越可能获得多数成员的投票(votes)数。指定较高的值可使成员更有资格成为主要成员,更低的值可使成员更不符合条件。默认情况下,优先级的值是1
可以看出,主节点和副本节点的优先级各为1,即,默认可以认为都已经有了一票。但选举节点,优先
级是0,(选举节点的优先级必须是0,不能是别的值。即不具备选举权,但具有投票权)
提升主节点的优先级
关闭27018副本节点,主节点和仲裁节点对27018的心跳失败。因为主节点还在,因此,没有触发投票选举。
在主节点写入数据
db.comment.insert({})
再启动从节点,会发现,主节点写入的数据,会自动同步给从节点。
如果此时,在主节点写入数据。
关闭27017节点后发现,从节点和仲裁节点对27017的心跳失败,当失败超过10秒,此时因为没有主节点了,会自动发起投票。
而副本节点只有27018,因此,候选人只有一个就是27018,开始投票。27019向27018投了一票,27018本身自带一票,因此共两票,超过了“大多数”27019是仲裁节点,没有选举权,27018不向其投票,其票数是0.最终结果,27018成为主节点。具备读写功能。在27018写入数据查看。
db.comment.insert({})
再启动27017节点,发现27017变成了从节点,27018仍保持主节点。登录27017节点,发现是从节点了,数据自动从27018同步。从而实现了高可用。
先关掉仲裁节点27019,关掉现在的主节点27017。
登录27018节点后发现,27018仍然是从节点,副本集中没有主节点了,导致此时副本集是只读状态,无法写入。
为啥不选举了?因为27018的票数,没有获得大多数,即没有大于等于2,它只有默认的一票(优先级是1)如果要触发选举,随便加入一个成员即可。
先关掉仲裁节点27019,关掉现在的副本节点27018。10秒后,27017主节点自动降级为副本节点。(服务降级)副本集不可写数据了,已经故障了。
序号 | 故障类型 | 是否影响使用 |
---|---|---|
1 | 主节点故障 | 不影响正常使用 |
2 | 副本节点故障 | 不影响正常使用 |
3 | 仲裁节点故障 | 不影响正常使用 |
4 | 主节点和仲裁节点故障 | 影响正常使用,需要处理 |
5 | 从节点和仲裁节点故障 | 影响正常使用,需要处理 |
6 | 主节点和从节点故障 | 影响正常使用,需要处理 |
7 | 所有节点故障 | 影响正常使用,需要处理 |
副本集中没有主节点了,导致此时,副本集是只读状态,无法写入。
因为27017的票数,没有获得大多数,即没有大于等于2,它只有默认的一票(优先级是1)
如果要触发选举,随便加入一个成员即可。
此时:影响正常使用,需要处理
10秒后,27017主节点自动降级为副本节点。(服务降级)
副本集不可写数据了,已经故障了。
此时:影响正常使用,需要处理
集群将处于不完全状态,无法执行写操作,因为剩余的副本节点不足以立即选出新的主节点(假设只剩一个副本节点和仲裁节点)。直到至少有一个额外的副本节点在线并同步,以便选举出新的主节点
此时:影响正常使用,需要处理
https://sysin.org/blog/windows/
Windows 7 Ultimate with SP1 x64 简体中文旗舰版 (2025 年 4 月更新),含补丁包:
百度网盘链接:https://pan.baidu.com/s/1PjgDBMgK86uJqj23Vk5l_A?pwd=3oev
Windows Server 2008 R2 Datacenter SP1 x64 简体中文版 (2025 年 4 月更新),含补丁包:
百度网盘链接:https://pan.baidu.com/s/1FdUE8bxugWz2sC7gHKoS3w?pwd=3fq6
MongoDB Plat操作系统支持安装的版本
要在生产环境中
运行,请参阅推荐的平台
以获取操作系统建议。
MongoDB 需要满足以下最低配置要求的 x86_64
微架构:
x86_64
,MongoDB 需要:x86_64
,MongoDB 需要:从 MongoDB 5.0 开始,mongod
、mongos
和旧版 mongo
Shell 不再支持不符合此最低微架构要求的x86_64
平台。
arm64
上的 MongoDB 需要ARMv8.2-A或后来的微架构。
从 MongoDB 5.0 开始,mongod
、mongos
和旧版 mongo
Shell 不再支持不符合此最低微架构要求的arm64
平台。
要使用 ARM v8.4-A 或更高版本的微架构,请使用 MongoDB 版本 7.0 或更高版本。
从 MongoDB 8.0 开始,新的 MongoDB Server 版本(主要版本和次要版本)支持操作系统(OS)供应商定义的最低操作系统次要版本。当操作系统供应商不再支持某个操作系统次要版本之后,MongoDB
会更新 MongoDB
Server,以支持下一个操作系统次要版本。有关详细信息,请参阅 MongoDB 平台支持改进。
MongoDB 8.0 支持以下最低操作系统次要版本:
平台 | 架构 | 版本 | 8.0 | 7.0 | 6.0 | 5.0 |
---|---|---|---|---|---|---|
Amazon Linux 2023 | x86_64 | Enterprise | ✓ | ✓ | ||
Amazon Linux 2023 | x86_64 | Community | ✓ | ✓ | ||
Amazon Linux V2 | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
Amazon Linux V2 | x86_64 | Community | ✓ | ✓ | ✓ | |
Debian 12 | x86_64 | Enterprise | ✓ | ✓ | ||
Debian 12 | x86_64 | Community | ✓ | ✓ | ||
Debian 11 | x86_64 | Enterprise | ✓ | ✓ | 5.0.8+ | |
Debian 11 | x86_64 | Community | ✓ | ✓ | 5.0.8+ | |
Debian 10 | x86_64 | Enterprise | ✓ | ✓ | ||
Debian 10 | x86_64 | Community | ✓ | ✓ | ||
Debian 9 | x86_64 | Enterprise | ✓ | |||
Debian 9 | x86_64 | Community | ✓ | |||
RHEL/Rocky/Alma/Oracle Linux 9.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | 6.0.4+ | |
RHEL/Rocky/Alma/Oracle Linux 9.0+ [1] | x86_64 | Community | ✓ | ✓ | 6.0.4+ | |
RHEL/Rocky/Alma/Oracle Linux 8.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ |
RHEL/Rocky/Alma/Oracle Linux 8.0+ [1] | x86_64 | Community | ✓ | ✓ | ✓ | ✓ |
RHEL/ Oracle Linux 7.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
RHEL/ Oracle Linux 7.0+ [1] | x86_64 | Community | ✓ | ✓ | ✓ | |
SLES 15 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ |
SLES 15 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ |
SLES 12 | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
SLES 12 | x86_64 | Community | ✓ | ✓ | ✓ | |
Ubuntu 24.04 | x86_64 | Enterprise | ✓ | |||
Ubuntu 24.04 | x86_64 | Community | ✓ | |||
Ubuntu 22.04 | x86_64 | Enterprise | ✓ | ✓ | 6.0.4+ | |
Ubuntu 22.04 | x86_64 | Community | ✓ | ✓ | 6.0.4+ | |
Ubuntu 20.04 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ |
Ubuntu 20.04 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ |
Ubuntu 18.04 | x86_64 | Enterprise | ✓ | ✓ | ||
Ubuntu 18.04 | x86_64 | Community | ✓ | ✓ | ||
Windows 11 | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
Windows 11 | x86_64 | Community | ✓ | ✓ | ✓ | |
Windows Server 2022 | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
Windows Server 2022 | x86_64 | Community | ✓ | ✓ | ✓ | |
Windows Server 2019 | x86_64 | Enterprise | ✓ | ✓ | ✓ | |
Windows Server 2019 | x86_64 | Community | ✓ | ✓ | ✓ | |
Windows 10 / Server 2016 | x86_64 | Enterprise | ✓ | ✓ | ||
Windows 10 / Server 2016 | x86_64 | Community | ✓ | ✓ | ||
macOS 14 | x86_64 | Enterprise | ✓ | |||
macOS 14 | x86_64 | Community | ✓ | |||
macOS 13 | x86_64 | Enterprise | ✓ | ✓ | ||
macOS 13 | x86_64 | Community | ✓ | ✓ | ||
macOS 12 | x86_64 | Enterprise | ✓ | ✓ | ||
macOS 12 | x86_64 | Community | ✓ | ✓ | ||
macOS 11 | x86_64 | Enterprise | ✓ | ✓ | ||
macOS 11 | x86_64 | Community | ✓ | ✓ | ||
macOS 10.15 | x86_64 | Enterprise | ✓ | ✓ | ||
macOS 10.15 | x86_64 | Community | ✓ | ✓ | ||
macOS 10.14 | x86_64 | Enterprise | ✓ | |||
macOS 10.14 | x86_64 | Community | ✓ | |||
macOS 14 | arm64 | Enterprise | ✓ | |||
macOS 14 | arm64 | Community | ✓ | |||
macOS 13 | arm64 | Enterprise | ✓ | ✓ | ||
macOS 13 | arm64 | Community | ✓ | ✓ | ||
macOS 12 | arm64 | Enterprise | ✓ | ✓ | ||
macOS 12 | arm64 | Community | ✓ | ✓ | ||
macOS 11 | arm64 | Enterprise | ✓ | ✓ | ||
macOS 11 | arm64 | Community | ✓ | ✓ | ||
Amazon Linux 2023 | arm64 | Enterprise | ✓ | ✓ | ||
Amazon Linux 2023 | arm64 | Community | ✓ | ✓ | ||
Amazon Linux 2 | arm64 | Enterprise | ✓ | ✓ | ✓ | |
Amazon Linux 2 | arm64 | Community | ✓ | ✓ | ✓ | |
RHEL/CentOS/Rocky/Alma 9 | arm64 | Enterprise | ✓ | ✓ | ✓ | |
RHEL/CentOS/Rocky/Alma 9 | arm64 | Community | ✓ | ✓ | ✓ | |
RHEL/CentOS/Rocky/Alma 8 | arm64 | Enterprise | ✓ | ✓ | ✓ | ✓ |
RHEL/CentOS/Rocky/Alma 8 | arm64 | Community | ✓ | ✓ | ✓ | ✓ |
Ubuntu 24.04 | arm64 | Enterprise | ✓ | |||
Ubuntu 24.04 | arm64 | Community | ✓ | |||
Ubuntu 22.04 | arm64 | Enterprise | ✓ | ✓ | 6.0.4+ | |
Ubuntu 22.04 | arm64 | Community | ✓ | ✓ | 6.0.4+ | |
Ubuntu 20.04 | arm64 | Enterprise | ✓ | ✓ | ✓ | ✓ |
Ubuntu 20.04 | arm64 | Community | ✓ | ✓ | ✓ | ✓ |
Ubuntu 18.04 | arm64 | Enterprise | ✓ | ✓ | ||
Ubuntu 18.04 | arm64 | Community | ✓ | ✓ | ||
RHEL/Rocky/Alma 8 [ 5 ] | ppc64le | Enterprise | ✓ | ✓ | ✓ | ✓ |
RHEL/CentOS 7 | ppc64le | Enterprise | 6.0.7+ | ✓ | ||
RHEL/Rocky/Alma 9 | s390x | Enterprise | ✓ | ✓ | ||
RHEL/Rocky/Alma 8 [ 5 ] | s390x | Enterprise | ✓ | ✓ | ✓ | 5.0.9+ |
RHEL/CentOS 7 | s390x | Enterprise | ✓ | ✓ | ||
RHEL/CentOS 7 | s390x | Community | ✓ |
[1] | (1, 2, 3, 4, 5, 6) 在 Oracle Linux 上,MongoDB 仅支持 Red Hat Compatible Kernel。 |
---|---|
[2] | MongoDB 版本 5.0 及更高版本针对 SLES 12 Service Pack 5 进行了测试。MongoDB 的早期版本针对不带服务包的 SLES 12 进行了测试。 |
---|---|
[3] | MongoDB 版本 7.0 及更高版本针对 SLES 12 Service Pack 4 进行测试。早期版本的 MongoDB 针对不带服务包的 SLES 12 进行测试。 |
---|---|
[4] | MongoDB 版本 7.0 针对 RHEL 7.9 进行构建和测试。早期版本的 MongoDB 针对 RHEL 7 进行测试,并假定支持向前兼容。 |
---|---|
[5] | *(1、2)*PPC64LE 和 s390x 上的 RHEL 8 不支持 MongoDB 8.0 及更高版本中使用的 TCMalloc 更新版。在这些架构上,RHEL 8 使用旧版的 TCMalloc。要了解更多信息,请参阅用于自管理部署的 TCMalloc 性能优化。 |
---|---|
[6] | PPC 64LE 上的 RHEL 9 不支持 MongoDB 8.0 及更高版本中使用的 TCMalloc 的更新版本。在此架构上,RHEL 9使用旧版 TCMalloc 版本。要了解更多信息,请参阅用于自管理部署的 TCMalloc 性能优化。 |
---|---|
虽然 MongoDB 支持多种平台,但在 x86_64
架构的生产环境中建议使用以下操作系统:
为获得最佳效果,请运行平台的最新版本。如果运行的是旧版本,请确保其提供程序支持您的版本。
这里面最麻烦的就是要联网登录**[微软账号]
**
,对于没有微软账号或者就是想先验机再激活的玩家来说,上来就联网登录实在不方便。
怎么解决呢?直接快速跳过联网激活,创建本地账户登录就行了。
有好几种办法(并非全部),到底哪个好使,你可以挨个试试看。
在Win11系统首次展开设置到联网界面时,
同时按Shift + F10或Fn + Shift + F10,
在命令窗口CMD
,点击光标录入“oobe\bypassnro”,之后按回车,
等待系统重启后,再次到了联网界面,选择我没有网络再下一步创建本地账户就好了。
【已验证OK】
(前面步骤和方法1类似)在微软账号登录界面,随便输入一个不存在的邮箱地址,密码也是随便输,直到系统提示报错,然后下一步
创建本地账户。
(前面步骤和方法1类似)在命令窗口,点击光标录入“start ms-cxh:localonly”这串命令,之后回车,按提示创建本地账户即可。