vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 94
声望: 1

这是为何??

Member
avatar
加入于:
帖子: 94
声望: 1

Connection failed.

SERVER [localhost:27017] (Type: UNKNOWN)
|_/ Connection error (MongoSocketOpenException): Exception opening socket
|__/ Socket error: Connection refused: connect

Details:
Timed out after 5000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}]

Member
avatar
加入于:
帖子: 94
声望: 1

这是vnpy设置数据库为mongodb,下载数据时出现的错误:

Traceback (most recent call last):
File "d:\Anaconda3\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 384, in run_downloading
database_manager.save_bar_data(data)
File "d:\Anaconda3\lib\site-packages\vnpy\trader\database\database_mongo.py", line 308, in save_bar_data
DbBarData.objects(
File "d:\Anaconda3\lib\site-packages\mongoengine\queryset\manager.py", line 37, in get
queryset = queryset_class(owner, owner._get_collection())
File "d:\Anaconda3\lib\site-packages\mongoengine\document.py", line 207, in _get_collection
db.client.is_primary:
File "d:\Anaconda3\lib\site-packages\pymongo\mongo_client.py", line 1005, in is_primary
return self._server_property('is_writable')
File "d:\Anaconda3\lib\site-packages\pymongo\mongo_client.py", line 830, in _server_property
writable_server_selector)
File "d:\Anaconda3\lib\site-packages\pymongo\topology.py", line 235, in select_server
address))
File "d:\Anaconda3\lib\site-packages\pymongo\topology.py", line 193, in select_servers
selector, server_timeout, address)
File "d:\Anaconda3\lib\site-packages\pymongo\topology.py", line 209, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

Administrator
avatar
加入于:
帖子: 4122
声望: 229

很明显MongoDB的数据库服务进程没有启动。。。

Member
avatar
加入于:
帖子: 94
声望: 1

用Python的交易员 wrote:

很明显MongoDB的数据库服务进程没有启动。。。

系统服务列表中没有mongdb服务 MongoDB的data和log默认安装目录在哪里?

Administrator
avatar
加入于:
帖子: 4122
声望: 229

data log目录应该是你启动时在命令中指定的,如果不会弄就卸载重装吧,安装步骤中有一步问你要不要注册为系统服务,选上就好

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3