2016-05-23 63 views
4

我一直想使用Apache Storm從Kafka流式傳輸。我更喜歡Python,所以我決定使用streamparse(https://github.com/Parsely/streamparse)。字數統計的例子就是介紹性的例子。我一直試圖讓它在我的本地機器上工作。我已經安裝了JDK,雷音和風暴以下版本:Streamparse wordcount示例

 
Leiningen 2.6.1 on Java 1.8.0_73 Java HotSpot(TM) 64-Bit Server VM 

我運行以下streamparse後執行以下步驟:

 
sparse quick start wordcount 
cd wordcount 
sparse run 

我收到以下錯誤:

 

Retrieving org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.pom from central 
Retrieving org/apache/storm/storm/0.10.1/storm-0.10.1.pom from central 
Retrieving org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.jar from central 
Could not transfer artifact com.parsely:streamparse:pom:0.0.4-SNAPSHOT from/to clojars (https://clojars.org/repo/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 
Could not transfer artifact clojure-complete:clojure-complete:pom:0.2.4 from/to clojars (https://clojars.org/repo/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 
This could be due to a typo in :dependencies or network issues. 
If you are behind a proxy, try setting the 'http_proxy' environment variable. 

我project.clj文件如下所示:

 

    (defproject wordcount "0.0.1-SNAPSHOT" 
     :source-paths ["topologies"] 
     :resource-paths ["_resources"] 
     :target-path "_build" 
     :min-lein-version "2.6.1" 
     :jvm-opts ["-client"] 
     :dependencies [[org.apache.storm/storm-core "0.10.1"] 
        [com.parsely/streamparse "0.0.4-SNAPSHOT"] 
        ] 
     :jar-exclusions  [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"] 
     :uberjar-exclusions [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"] 
) 

因此,我的lein和風暴核心版本設置正確。我不知道我要去哪裏錯。有人能幫我嗎?

-Thanks

回答

10

這是因爲Java是不承認的https://clojars.org/repo根證書頒發機構(CA)的SSL證書。

解決方法是將該證書添加到java cacerts文件,以便它被永久接受。

步驟1:取得的https://clojars.org

  1. 打開https://clojars.org根證書中鉻的瀏覽器。
  2. 找到您的地址欄旁邊的鎖定符號,然後單擊它。
  3. 查看詳情
  4. 點擊層級最高的證書,並確認它帶有根CA證詞。
  5. 拖放您在桌面上看到書面證書的圖像。

那就是它!你有你的根證書!

步驟2:將該證書添加到java cacerts文件。

  1. 在jre bin文件夾中使用keytool.exe。
  2. 火以下命令將裏面的cacerts證書文件

keytool –import –noprompt –trustcacerts –alias ALIASNAME -file /PATH/TO/YOUR/DESKTOP/CertificateName.cer -keystore /PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit

這就是它!你解決了你的問題。

請注意

  1. 請確認這是給你這個PKIX錯誤(JRE卡夫卡使用)的JRE那就是你的執行步驟2.如果您希望與其他JRE問題,嘗試將就這樣。

  2. 只使用JDK中的一個jre,它減少了發生問題的機率。

0

如果您使用的是Debian或Ubuntu,你可以執行:

$ sudo update-ca-certificates -f