我在 documentDB 中创建了一个 mongoDB 集群。我尝试通过 pymongo 的 mongoclient 从本地计算机连接到集群。
cluster endpoint=mongooi.cluster-abcdefghij.us-east-2.docdb.amazonaws.com
client=pymongo.Mongoclient("mongodb://USER:PASSWORD@mongooi.cluster-abcdefghij.us-east-2.docdb.amazonaws.com:27017/?ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false*")
print(client.database_names())
我得到 ServerSelectionTimeoutError:mongooi.cluster-abcdefghij.us-east-2.docdb.amazonaws.com:27017: timed out