简体   繁体   English

使用logstash Elasticsearch输出插件错误:NameError:找不到SSLConnectionSocketFactory

[英]Using logstash Elasticsearch output plugin error: NameError: SSLConnectionSocketFactory not found

I am trying to import data from MySQL to Elasticsearch using logstash version. 我试图使用logstash版本将数据从MySQL导入Elasticsearch。

Versions of software used: 使用的软件版本:

  • Java/JRE 1.8 Java / JRE 1.8
  • Elasticsearch 6.1.0 Elasticsearch 6.1.0
  • Logstash 6.1.0 Logstash 6.1.0

My conf contents are as follows: 我的conf内容如下:

file: simple-out.conf 文件:simple-out.conf

input {
    jdbc {
        # MySQL jdbc connection string to our database, mydb
        jdbc_connection_string => "jdbc:mysql://valid/validDBNAME?useSSL=false"
        # The user we wish to execute our statement as
        jdbc_user => "MY USER"
        jdbc_password => "MY PWD"
        # The path to our downloaded jdbc driver
        jdbc_driver_library => "C:\JavaDevelopment\TomcatServer\apache-tomcat-8.5.20\lib\mysql-connector-java-5.1.45-bin.jar"
        # The name of the driver class for Postgresql
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        # our query
        statement => "SELECT * from testtable"
        jdbc_paging_enabled => "true"
        jdbc_page_size => "50000"
    }
}
output {
    stdout { codec => json_lines }
    elasticsearch {     
        hosts => "http://localhost:9200"
        index => "test-migrate" 
        document_type => "data" 
    }
}

When I run logstash I get the following error: 当我运行logstash时,出现以下错误:

[2017-12-19T16:50:08,055][ERROR][logstash.pipeline        ] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<NameError: SSLConnectionSocketFactory not found ERROR 

Please suggest how to get past this. 请提出如何克服这个问题。 Thanks 谢谢

尝试将httpclient-VERSION.jarhttpcore-VERSION.jar文件添加到LOGSTASH_HOME/vendor/jruby/lib/文件夹中。

I had same problem, the solution is: 我有同样的问题,解决方案是:
add LOGSTASH_HOME variable path in environment variables in mycomputer properities to C:\\some_path\\logstash-6.3.0 将我的计算机属性中的环境变量中的LOGSTASH_HOME变量路径添加到C:\\ some_path \\ logstash-6.3.0
then add these files to C:\\some_path\\logstash-6.3.0\\logstash-core\\lib\\jars 然后将这些文件添加到C:\\ some_path \\ logstash-6.3.0 \\ logstash-core \\ lib \\ jars

files: 文件:
httpclient-4.5.2.jar httpclient-4.5.2.jar
log4j-1.2.17.jar log4j-1.2.17.jar
httpcore-VERSION.jar httpcore-VERSION.jar

this is because logstash doesn't come with ssl jar file and you need to add this to jar folder and set the environment so as logstash can read those jar files 这是因为logstash并未随附ssl jar文件,因此您需要将其添加到jar文件夹并设置环境,以便Logstash可以读取这些jar文件
and try using gitbash rather than cmd or powershell! 并尝试使用gitbash而不是cmd或powershell!
and try to close and restart your logstash and elasticsearch 并尝试关闭并重新启动您的logstash和elasticsearch
follow this link to see which index are comming to elasticsearch. 点击此链接,查看哪个索引即将加入Elasticsearch。
http://localhost:9200/_cat/indices?v if you are running on diff. http:// localhost:9200 / _cat / indices?v(如果在diff上运行)。 port please change port number 端口请更改端口号



addidional tips 其他提示
and it didn't work for me on jdk 10.x so use jdk 8.x 在jdk 10.x上对我不起作用,因此请使用jdk 8.x
and maybe installer wont work even so just unzip file and run elasticsearch.bat and logstash -f cong_filepath\\configfile.config in bin folders 甚至安装程序都无法工作,所以即使解压缩文件并在bin文件夹中运行elasticsearch.bat和logstash -f cong_filepath \\ configfile.config
windows user can type cmd in top of path Windows用户可以在路径顶部键入cmd
Please make sure MySQL is running, (doesn't mean open) on server 请确保MySQL正在服务器上运行(并不意味着打开)
Learn @ https://www.elastic.co/blog/logstash-jdbc-input-plugin 了解@ https://www.elastic.co/blog/logstash-jdbc-input-plugin




To resolve it yourself in future: 要自己解决,请执行以下操作:
open logstash/bin folder and right click and gitbash (need git) 打开logstash / bin文件夹,然后右键单击和gitbash(需要git)
type "vi log" and press tab 3 times till all logstahsh files are shown up 键入“ vi log”,然后按Tab 3次,直到显示所有Logstahsh文件
a new line will appear, type "vi logstash" and press enter to open source file 将出现一个新行,键入“ vi logstash”,然后按Enter键打开源文件

you'll have code to understand flow,.. if you look carefully Logstash_home and javacmd (at bottom) are important that execute jar, javacmd should be set to your java_home variable in env variables to jdk8.x and Logstash_home has a path for jar directory, either change it or put you jar to this folder. 您将拥有理解流程的代码,..如果仔细看一下,Logstash_home和javacmd(在底部)对于执行jar很重要,则应将javacmd设置为jdk8.x的env变量中的java_home变量,并且Logstash_home具有jar的路径目录,请更改它或将jar放入此文件夹。
Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM