我在mongo創建了一個用戶,
db.createUser(
{
user: "user",
pwd: "password",
roles: [
{ role: "readWrite", db: "vp_print" }
]
}
)
然后我用MongoTemplate去查詢是能查到資料,但是去insert就失敗了
顯示
org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=.aliyuncs.com:3717, type=REPLICA_SET_SECONDARY, roundTripTime=7.2 ms, state=CONNECTED}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=aliyuncs.com:3717, type=REPLICA_SET_SECONDARY, roundTripTime=7.2 ms, state=CONNECTED}],
然后我用這個賬號去修改mongo里面資料,提示
uj5u.com熱心網友回復:
Timed out after 30000 ms貌似不是帳號的問題吧,你找個賬號試試呢
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/41927.html
標籤:MongoDB
上一篇:MySQL安裝問題,安裝一半手動退出后就成zhe'y'l
下一篇:mysql求助
