如何从远程服务器上的mongodb创建elasticsearch索引?

时间:2018-06-21 10:23:35

标签: mongodb elasticsearch

我在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中可以使用相同的凭据

0 个答案:

没有答案