MongoDB BI Connector与ODBC Driver兼容性及版本报错咨询
兼容性说明
MongoDB BI Connector 2.14.x版本对ODBC驱动的版本要求高于2.13.x,官方推荐搭配1.2.x及以上版本的MongoDB ODBC Driver。你当前使用的1.1.0版本ODBC驱动属于旧版本,无法与BI Connector 2.14.4兼容,这是导致连接失败的核心原因之一。
报错(OCSP验证失败)解决方案
1. 升级ODBC驱动至兼容版本
将MongoDB ODBC Driver从1.1.0 Unicode版本升级到1.2.0或更高版本(与你之前成功连接的版本一致即可),直接匹配BI Connector 2.14.4的版本要求,从根源解决兼容性及OCSP验证问题。
2. 临时禁用OCSP验证(应急方案)
如果暂时无法升级驱动,可通过修改BI Connector的启动配置跳过OCSP验证:
- 命令行启动时添加参数:
mongosqld --ssl-ocsp-disable - 或在配置文件(如
mongosqld.conf)中添加:sslOCSPDisable: true
注意:此方案会降低连接安全性,仅作为临时应急使用,建议尽快完成驱动升级。
3. 检查网络连通性
确认BI Connector所在主机能够正常访问MongoDB证书对应的OCSP服务器。如果网络存在防火墙或代理限制,需开放OCSP相关端口(通常为443),确保OCSP验证请求能正常发送和接收。
原始报错信息
E NETWORK [initandlisten] connection accepted from 127.0.0.1:., but could not initialize: unable to connect to MongoDB: no servers available: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: cluster0.., Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: OCSP verification failed: no OCSP cache provided }, { Addr: cluster0......., Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: OCSP verification failed: no OCSP cache provided }, { Addr: cluster..., Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: OCSP verification failed: no OCSP cache provided }, ] }
内容的提问来源于stack exchange,提问作者Liber Darius

