簡體   English   中英

使用logstash Elasticsearch輸出插件錯誤:NameError:找不到SSLConnectionSocketFactory

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

我試圖使用logstash版本將數據從MySQL導入Elasticsearch。

使用的軟件版本:

  • Java / JRE 1.8
  • Elasticsearch 6.1.0
  • Logstash 6.1.0

我的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" 
    }
}

當我運行logstash時,出現以下錯誤:

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

請提出如何克服這個問題。 謝謝

嘗試將httpclient-VERSION.jarhttpcore-VERSION.jar文件添加到LOGSTASH_HOME/vendor/jruby/lib/文件夾中。

我有同樣的問題,解決方案是:
將我的計算機屬性中的環境變量中的LOGSTASH_HOME變量路徑添加到C:\\ some_path \\ logstash-6.3.0
然后將這些文件添加到C:\\ some_path \\ logstash-6.3.0 \\ logstash-core \\ lib \\ jars

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

這是因為logstash並未隨附ssl jar文件,因此您需要將其添加到jar文件夾並設置環境,以便Logstash可以讀取這些jar文件
並嘗試使用gitbash而不是cmd或powershell!
並嘗試關閉並重新啟動您的logstash和elasticsearch
點擊此鏈接,查看哪個索引即將加入Elasticsearch。
http:// localhost:9200 / _cat / indices?v(如果在diff上運行)。 端口請更改端口號



其他提示
在jdk 10.x上對我不起作用,因此請使用jdk 8.x
甚至安裝程序都無法工作,所以即使解壓縮文件並在bin文件夾中運行elasticsearch.bat和logstash -f cong_filepath \\ configfile.config
Windows用戶可以在路徑頂部鍵入cmd
請確保MySQL正在服務器上運行(並不意味着打開)
了解@ https://www.elastic.co/blog/logstash-jdbc-input-plugin




要自己解決,請執行以下操作:
打開logstash / bin文件夾,然后右鍵單擊和gitbash(需要git)
鍵入“ vi log”,然后按Tab 3次,直到顯示所有Logstahsh文件
將出現一個新行,鍵入“ vi logstash”,然后按Enter鍵打開源文件

您將擁有理解流程的代碼,..如果仔細看一下,Logstash_home和javacmd(在底部)對於執行jar很重要,則應將javacmd設置為jdk8.x的env變量中的java_home變量,並且Logstash_home具有jar的路徑目錄,請更改它或將jar放入此文件夾。
希望這可以幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM