Comments (11)
from emqx.
请问可以提供一下mongo的具体部署方式吗?我们来复现一下。
from emqx.
OK. The automatic version detection does not work quite well with MongoDB v4.
You can however set this flag to make it work:
from emqx.
@zmstone 我需要如何找到此设置?我使用5.6.1 (Open Source)版本。但是操作界面没有这项设置。另外如果mongodb不开启秘钥认证,EMQX是可以正常链接的。mongodb4.0开启秘钥认证才出现的上述现象。
from emqx.
抱歉,认证配置中可能没有包含这个选项。我们会在后续版本中加上
可以试一下这个命令:
emqx eval application:set_env(mongodb,use_legacy_protocol,true).
from emqx.
Hi @zmstone 我成功設置了這個指令後, 是否這個指令直接應用到所有目前的 mongo authentication?
from emqx.
@nikosheng 是的。
from emqx.
Hi @zmstone , 我嘗試了一下, 發現通過emqx ctl 或者修改 config 文件都是不行, 如下是我的 emqx.conf
node {
name = "[email protected]"
cookie = "emqxsecretcookie"
data_dir = "/var/lib/emqx"
}
cluster {
name = emqxcl
discovery_strategy = manual
}
mongodb {
use_legacy_protocol = "true"
}
請問我可以在哪裏可以看到這個 config 已經應用到 emqx 的運行時?
from emqx.
mongodb不能这样配置。
可以这样: 在集群中所有节点都修改: data/config/cluster.hocon
然后重启
authentication = [
{
backend = mongodb
collection = users
database = mqtt
filter {
username = "${username}"
}
mechanism = password_based
mongo_type = single
password_hash_algorithm {name = sha256, salt_position = suffix}
password_hash_field = password_hash
pool_size = 8
salt_field = salt
server = "127.0.0.1:27017"
srv_record = false
ssl {enable = false, verify = verify_peer}
topology {
connect_timeout_ms = "20s"
}
use_legacy_protocol = true # <================ 把这行加上
}
]
from emqx.
Thanks @zmstone
However, I still cannot connect to my mongo v4 after I configure use_legacy_protocol
to true
(after emqx restart).
My mongo version is
Using MongoDB: 4.2.14
Here is the error log
2024-05-24T02:19:43.218437+00:00 [warning] msg: start_resource_failed, id: <<"emqx_authn_mongodb:1">>, reason: {start_pool_failed,<<"emqx_authn_mongodb:1">>,{connect_failed,{saslStart,#{<<"code">> => 18,<<"codeName">> => <<"AuthenticationFailed">>,<<"errmsg">> => <<"Authentication failed.">>}}}}
Here is my cluster.hocon
authentication = [
{
backend = mongodb
collection = users
database = mqtt
enable = true
filter {
username = "${username}"
}
is_superuser_field = is_superuser
mechanism = password_based
mongo_type = single
password = xxx
password_hash_algorithm {name = sha256, salt_position = suffix}
password_hash_field = password_hash
pool_size = 8
salt_field = salt
server = "127.0.0.1:27019"
srv_record = false
ssl {
ciphers = []
depth = 10
enable = false
hibernate_after = 5s
log_level = notice
reuse_sessions = true
secure_renegotiate = true
verify = verify_none
versions = [tlsv1.3, tlsv1.2]
}
topology {
connect_timeout_ms = 20s
heartbeat_frequency_ms = 200s
max_overflow = 0
}
use_legacy_protocol = true
username = eqmx
}
]
from emqx.
Besides, I assume that the original setting auto
can help to decide whether to use the latest mongo api.
use_legacy_protocol
Type | Enum(auto,true,false) |
---|---|
Default | auto |
Description | Whether to use MongoDB's legacy protocol for communicating with the database. The default is to attempt to automatically determine if the newer protocol is supported. |
from emqx.
Related Issues (20)
- Can't add users on touch screen device HOT 7
- Action output to external HTTP server - authorization header issue HOT 2
- The client disconnects after publish message whose topic starts with '$' HOT 2
- Not getting Emqx dashboard HOT 1
- EMQX Clustering - Message Replication HOT 4
- STOMP GW does not send heartbeat to client HOT 4
- EMQX cluster cannot restart after persistence HOT 1
- After STOMP enables authentication, authentication fails when the account password carries a colon
- runq_overload everyday for few minutes HOT 4
- Receive Maximum Not Sent in Bridge CONNACK HOT 4
- ~10ms latency on publishing and receiving message on the same machine on windows HOT 6
- webhook监听上下线事件时,事件时序有误,原因不明(connected and disconnected events may out of order) HOT 3
- Authentication fails periodically and restart fixes it HOT 9
- For my project required kafka and kerberos integration with EMQX opensource,So any how is it possible to do these integration with Emqx OPenSource version HOT 2
- Get acknowledgement from subscriber(s) after publish messages HOT 2
- Restored retained message have no payload HOT 2
- error messages received and MQTT broker keep running up and down, very HOT 4
- Several protocol violations or bugs in EMQX HOT 26
- Upgrade to Openssl 3.0 or higher HOT 7
- LDAP server treated as down due to wrong error returned than expected? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emqx.