启动命令行执行下列命令:
C:\Users\Administrator>d:/ireport365/mongodb/bin/mongo
>use prod_ireport365_enterprise;
>db.createUser({
user:
"用户名"
,
pwd:
"密码"
,
roles: [
{ role:
"readWrite"
, db:
"prod_ireport365_enterprise"
}
]
});
>exit;
修改配置问题:D:\ireport365\安装服务.bat
将d:\ireport365\mongodb\bin\mongod --dbpath d:\ireport365\mongodb\data --logpath d:\ireport365\mongodb\log\mongodb.log --install --serviceName iReport365Database --serviceDisplayName
"iReport365 Database Server"
d:\ireport365\mongodb\bin\mongod --auth --dbpath d:\ireport365\mongodb\data --logpath d:\ireport365\mongodb\log\mongodb.log --install --serviceName iReport365Database --serviceDisplayName
"iReport365 Database Server"
修改配置文件 D:\ireport365\ireport365.war\WEB-INF\classes\service-core\spring-data-mongodb.xml
将
<
mongo:mongo-client
id
=
"systemMongo"
host
=
"127.0.0.1"
port
=
"27017"
>
修改为: (增加 credentials配置 )
<
mongo:mongo-client
id
=
"systemMongo"
credentials
=
"用户名:密码@prod_ireport365_enterprise"
host
=
"127.0.0.1"
port
=
"27017"
>
启动命令行执行下列命令:
/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
将/opt/iReport365/mongodb/bin/mongod -port
27017
--dbpath /opt/iReport365/mongodb/data/ --logpath /opt/iReport365/mongodb/log/mongodb.log &
修改为 (增加 --auth )/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
将<
mongo:mongo-client
id
=
"systemMongo"
host
=
"127.0.0.1"
port
=
"27017"
>
修改为: (增加 credentials配置 )<
mongo:mongo-client
id
=
"systemMongo"
credentials
=
"用户名:密码@dev_ireport365_enterprise"
host
=
"127.0.0.1"
port
=
"27017"
>
- 运行 /opt/iReport365/stop.sh
- 运行 /opt/iReport365/run.sh