配置文件jdbc.properties:

mongo.hostport=192.168.100.100:28007,192.168.100.110:28008,192.168.100.120:28009
mogo.databaseName=ucmp_dms   
mongo.connectionsPerHost=25
mongo.threadsAllowedToBlockForConnectionMultiplier=4

mongo.connectTimeout=10000
mongo.maxWaitTime=120000
mongo.autoConnectRetry=true
mongo.socketKeepAlive=true
mongo.socketTimeout=120000
mongo.slaveOk=true

 

 

spring-mongodb.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.8.xsd
http://www.springframework.org/schema/data/repository
http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd ">

<!-- 定义mongo对象,对应的是mongodb官方jar包中的Mongo,replica-set设置集群副本的ip地址和端口 -->
<mongo:mongo />
</bean>


</beans>

相关文章:

  • 2021-12-18
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2021-06-30
  • 2021-08-10
  • 2021-06-25
  • 2021-10-21
  • 2021-12-11
相关资源
相似解决方案