Streamparse wordcount示例

red*_*vil 7 apache-kafka apache-storm streamparse

我一直想使用Apache Storm从Kafka流式传输.我对Python更熟悉,所以我决定使用streamparse(https://github.com/Parsely/streamparse).单词计数示例是介绍性示例.我一直试图让它在我的本地机器上工作.我安装了以下版本的JDK,lein和storm:

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和storm核心版本设置正确.我不确定我哪里出错了.有人可以帮帮我吗?

-谢谢

pos*_*rux 23

这是因为java无法识别https://clojars.org/repo的根证书颁发机构(CA)SSL证书.

解决方案是将该证书添加到java cacerts文件中,以便永久接受它.

第1步:获取https://clojars.org的根证书

  1. 在Chrome浏览器中打开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. 确认你正在执行步骤2的那个给你PKI错误(KAFKA使用的JRE)的jre.如果你试着使用另一个jre问题就是这样.

  2. 只使用JDK内部的一个jre会减少出现问题的机会.

  • 最后一步重新启动 Eclipse :) (3认同)