Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dp2library 启动时初始化 mongodb 环境方面的改进 #10

Open
DigitalPlatform opened this issue Jan 21, 2016 · 1 comment
Open

Comments

@DigitalPlatform
Copy link
Owner

今天对 dp2library 进行了改进,加强了启动时候初始化 mongodb 环境的功能。当遇到 mongodb 启动比 dp2library 慢的时候,dp2library 启动到需要连接 mongodb 这一步会报错,并处于未初始化完成的状态。前端访问 dp2library 会遇到报错。现在巩固以后,dp2library 的管理线程会稍后自动重新试探初始化 mongodb 相关环境。当然试探也有可能不成功,那么 dp2library 就会每隔 5 分钟自动试探一次。

要测试验证这个功能是否奏效了,可以先手动停止 mongodb 的 Windows Service。然后启动 dp2library。通过 dp2circulation 访问 dp2library,确认错误日志中有报错信息。然后,再手动启动 mongodb 的 service。然后等大约五分钟,再用 dp2circulation 访问 dp2library,就发现可以正常使用了。验证的时候,最好用 dp2circulation 修改保存书目记录然后保存,因为这样对 dp2library 的要求较高,验证效果较好。

@renyh
Copy link
Collaborator

renyh commented Feb 13, 2016

今天对这个问题进行了测试,过程如下:
先在library.xml文件中配置mongodb数据库连接字符串,如
<mongoDB connectionString="mongodb://localhost:27017" instancePrefix="dp2"></mongoDB>
本次连接libraryXE单机版服务器进行测试
1)先手动停止 mongodb 的 Windows Service。
2)然后启动 dp2libraryXE。
3)通过 dp2circulation 访问 dp2libraryXE,登录时报如下图错误。
"针对服务器***获得全部数据库定义过程发生错误:因系统处于维护状态ERR002,本功能暂时不能使用。"
Log目录中错误日志中有下图报错信息。
"2016/2/12 22:30:28 ERR002 首次初始化 mongodb database 失败: 初始化 MongoClient 时出错: Unable to connect to server localhost:27017: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:27017."
4)再手动启动 mongodb 的 service。
5)然后等大约五分钟,再用 dp2circulation 访问 dp2library,成功登录,可以正常使用了。
6)用dp2circulation 修改一条书目记录然后保存正常,再查询修改保存正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants