Home > database >  Mongo read-only problem
Mongo read-only problem

Time:09-17

I created a user in the mongo,
The createUser (
{
User: "user",
The PWD: "password",
Roles: [
{role: "readWrite", db: "vp_print"}
]
}
)

Then I can use MongoTemplate to query is to check the data, but failed to insert
According to
Org. Springframework. Dao. DataAccessResourceFailureException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. The Client view of cluster state is {type=REPLICA_SET, the servers=[{address=.aliyuncs.com: 3717, type=REPLICA_SET_SECONDARY, roundTripTime=7.2 ms, state=CONNECTED}]. Nested exception is com. Mongo. MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. The Client view of cluster state is {type=REPLICA_SET, the servers=[{address=aliyuncs.com: 3717, type=REPLICA_SET_SECONDARY, roundTripTime=7.2 ms, state=CONNECTED}],
Then I use this account to modify the data inside the mongo, tip

CodePudding user response:

Timed out after 30000 ms
Seemingly not account problem, you try to find an account
  • Related