我在ubuntu服务器上设置了elasticsearch(v6.2),并能够使用mongolastic从该服务器上的本地mongodb创建索引。
但是,当我尝试从远程服务器上的mongodb创建索引时,会出现错误
No server chosen by ReadPreferenceServerSelector
源自
com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed
这是带有虚拟值的mongolastic配置文件:
{
"misc": {
"dindex": {
"name": "clientdata"
},
"ctype": {
"name": "users"
}
},
"mongo": {
"host": "11.11.11.111",
"port": 11111,
"auth": {
"user": client",
"pwd": "abcd",
"source": "admin",
"mechanism": "scram-sha-1"
}
},
"elastic": {
"host": "localhost",
"port": 9300
}
}
虽然在mongo shell中可以使用相同的凭据