Stitch - Mongodb SSL 握手失败:<Hostname>: [SSL: UNKNOWN_PROTOCOL] 未知协议 (_ssl.c:645)

问题描述

我用过stitch数据集成工具把MongoDB数据转成stitch。但是在运行它时 出现如下所述的错误

指导我

2021-06-21 12:40:32,381Z   main - INFO Running tap-mongodb version 2.0.1 and target-stitch version 3.2.0
2021-06-21 12:40:33,237Z   main - INFO [smart-services] building smart service producer: topic( com.stitchdata.extractionJobStarted ),use_ssl( true )
2021-06-21 12:40:33,240Z   main - INFO [smart-services] building smart service producer: topic( com.stitchdata.extractionJobFinished ),240Z   main - INFO [smart-services] building smart service producer: topic( com.stitchdata.streamRecordCount ),use_ssl( true )
2021-06-21 12:40:34,246Z   main - INFO [smart-services] event successfully sent to kafka: com.stitchdata.extractionJobStarted [42] at offset None
2021-06-21 12:40:34,246Z   main - INFO Starting tap to discover schemas: tap-env/bin/tap-mongodb --config /tmp/tap_discover_config.json --discover
2021-06-21 12:41:04,706Z    tap - CRITICAL SSL handshake Failed:  <Hostname>:27015: [SSL: UNKNowN_PROTOCOL] unkNown protocol (_ssl.c:645)
2021-06-21 12:41:04,708Z    tap - Traceback (most recent call last):
2021-06-21 12:41:04,708Z    tap -   File "tap-env/bin/tap-mongodb",line 33,in <module>
2021-06-21 12:41:04,708Z    tap -     sys.exit(load_entry_point('tap-mongodb==2.0.1','console_scripts','tap-mongodb')())
2021-06-21 12:41:04,708Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_mongodb/__init__.py",line 394,in main
2021-06-21 12:41:04,708Z    tap -     raise exc
2021-06-21 12:41:04,line 391,708Z    tap -     main_impl()
2021-06-21 12:41:04,line 378,in main_impl
2021-06-21 12:41:04,708Z    tap -     client.server_info().get('version','unkNown'))
2021-06-21 12:41:04,709Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/pymongo/mongo_client.py",line 1658,in server_info
2021-06-21 12:41:04,709Z    tap -     session=session)
2021-06-21 12:41:04,709Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/pymongo/database.py",line 655,in command
2021-06-21 12:41:04,709Z    tap -     read_preference) as (sock_info,slave_ok):
2021-06-21 12:41:04,709Z    tap -   File "/root/.pyenv/versions/3.5.2/lib/python3.5/contextlib.py",line 59,in __enter__
2021-06-21 12:41:04,709Z    tap -     return next(self.gen)
2021-06-21 12:41:04,line 1135,in _socket_for_reads
2021-06-21 12:41:04,709Z    tap -     server = topology.select_server(read_preference)
2021-06-21 12:41:04,709Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/pymongo/topology.py",line 226,in select_server
2021-06-21 12:41:04,709Z    tap -     address))
2021-06-21 12:41:04,line 184,in select_servers
2021-06-21 12:41:04,709Z    tap -     selector,server_timeout,address)
2021-06-21 12:41:04,line 200,in _select_servers_loop
2021-06-21 12:41:04,709Z    tap -     self._error_message(selector))
2021-06-21 12:41:04,709Z    tap - pymongo.errors.ServerSelectionTimeoutError: SSL handshake Failed:  <Hostname>:27015: [SSL: UNKNowN_PROTOCOL] unkNown protocol (_ssl.c:645)
2021-06-21 12:41:05,042Z   main - INFO Tap exited abnormally with status 1
2021-06-21 12:41:06,785Z   main - INFO [smart-services] event successfully sent to kafka: com.stitchdata.extractionJobFinished [4] at offset None
2021-06-21 12:41:06,786Z   main - INFO No tunnel subprocess to tear down
2021-06-21 12:41:06,786Z   main - INFO Exit status is: discovery Failed with code 1 and error message: "SSL handshake Failed: <Hostname>: [SSL: UNKNowN_PROTOCOL] unkNown protocol (_ssl.c:645)".

解决方法

考虑设置 MongoClient 参数 tls=False 或连接字符串参数tls=false

另见https://pymongo.readthedocs.io/en/stable/examples/tls.html

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...