先贴配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>${mongodb.starter.version}</version>
</dependency>
<mongodb.starter.version>2.2.2.RELEASE</mongodb.starter.version>
spring:
data:
mongodb:
host: 192.168.1.3
port: 3000
database: shinemonitor
username: shinemonitor
password: 8a93fb410668219
在贴报错信息:
2019-12-11 10:38:03.957 [main] INFO org.mongodb.driver.cluster - Cluster created with settings {hosts=[192.168.1.3:3000], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2019-12-11 10:38:03.957 [main] INFO org.mongodb.driver.cluster - Adding discovered server 192.168.1.3:3000 to client view of cluster
2019-12-11 10:38:04.021 [cluster-ClusterId{value='5df0568b89f8041bb88b1e46', description='null'}-192.168.1.3:3000] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:1, serverValue:65}] to 192.168.1.3:3000
2019-12-11 10:38:04.024 [cluster-ClusterId{value='5df0568b89f8041bb88b1e46', description='null'}-192.168.1.3:3000] INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=192.168.1.3:3000, type=REPLICA_SET_PRIMARY, state=CONNECTED,