(1) 修改配置文件
${安装目录}/maco.war/WEB-INF/classes/service-core/spring-data-mongodb.xml
第12行开始将
<mongo:mongo-client id="systemMongo" host="#{dbProp['platform.mongodb.host']}" port="#{dbProp['platform.mongodb.port']}"> <mongo:client-options connections-per-host="50" threads-allowed-to-block-for-connection-multiplier="5" connect-timeout="30000" max-wait-time="30000" socket-keep-alive="true" socket-timeout="30000" write-concern="NORMAL" /> </mongo:mongo-client>
修改为
<mongo:mongo-client id="systemMongo" credentials="#{dbProp['platform.mongodb.credentials']}" host="#{dbProp['platform.mongodb.host']}" port="#{dbProp['platform.mongodb.port']}"> <mongo:client-options connections-per-host="100" threads-allowed-to-block-for-connection-multiplier="50" connect-timeout="30000" max-wait-time="30000" socket-keep-alive="true" socket-timeout="30000" write-concern="NORMAL" /> </mongo:mongo-client>
(2) 修改配置文件
${安装目录}/app_home/conf/db.properties
增加配置:
platform.mongodb.credentials=${用户名}:${密码}@prod_ireport365_enterprise
(3) 重启应用