-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[ bug ] 阿里云mongodb无法闯将索引 #1138
Comments
你的版本是多少,实例是怎么配置的?django_q启动了吗?看一下后台日志报错? |
遇到同样的问题,应该是云数据库导致的,获取到的slave信息为云的ip与端口,不能直连 创建补丁 mongo.py.20211117.patch diff --git a/sql/engines/mongo.py b/sql/engines/mongo.py
index 8e7143f..eef5e1a 100644
--- a/sql/engines/mongo.py
+++ b/sql/engines/mongo.py
@@ -295,9 +295,10 @@ class MongoEngine(EngineBase):
slave_msg = self.exec_cmd(sql)
if slave_msg.lower().find('undefined') < 0:
sp_host = slave_msg.replace("\"", "").split(":")
- self.host = sp_host[0]
- self.port = int(sp_host[1])
- return True
+ #self.host = sp_host[0]
+ #self.port = int(sp_host[1])
+ #return True
+ return False
else:
return False 应用补丁 |
我现在升级到archery 1.9.0,还是报上面这个错误,搜了一下issue,原来以前旧版本就有这个问题,应该把你的代码合并到master分支, @weideguo |
经过确认,产生该问题的原因,正是weideguo所说,只有云mongodb才会发生。 获取备节点ip的sql语句是:
对于自建mongodb,是可以正常获取到备节点ip的端口的,如下name字段:
可是,对于云mongodb,获取到的name字段,就不是真实的备节点ip地址了,如下:
看到云mongodb获取到的name值是secondaryNode和hiddenNode,这样archery就办法连上备节点执行sql语句了。 为了解决云mongodb不能创建索引的问题,就按照 @weideguo 的方法,把sql/engines/mongo.py的get_salve函数:
改成
|
重现步骤
提交两个sql报错
单独提交一个sql就没问题:
版本信息
应用版本/分支:
部署方式:Docker、手工部署
The text was updated successfully, but these errors were encountered: