...
启动命令行执行下列命令:
Code Block language js /opt/iReport365/mongodb/bin/mongo >use prod_ireport365_enterprise; >db.createUser({ user: "用户名", pwd: "密码", roles: [ { role: "readWrite", db: "prod_ireport365_enterprise" } ] }); >exit;
修改配置问题:/opt/iReport365/run.sh
将Code Block language actionscript3 /opt/iReport365/mongodb/bin/mongod -port 27017 --dbpath /opt/iReport365/mongodb/data/ --logpath /opt/iReport365/mongodb/log/mongodb.log &
修改为 (增加 --auth )Code Block language actionscript3 /opt/iReport365/mongodb/bin/mongod -port 27017 --auth --dbpath /opt/iReport365/mongodb/data/ --logpath /opt/iReport365/mongodb/log/mongodb.log &
修改配置文件 /opt/iReport365/ireport365.war/WEB-INF/classes/service-core/spring-data-mongodb.xml
将Code Block language xml <mongo:mongo-client id="systemMongo" host="127.0.0.1" port="27017">
修改为: (增加 credentials配置 )Code Block language xml <mongo:mongo-client id="systemMongo" credentials="用户名:密码@dev密码@prod_ireport365_enterprise" host="127.0.0.1" port="27017">
- 运行 /opt/iReport365/stop.sh
- 运行 /opt/iReport365/run.sh