streamparse wordcount示例

wfauudbj  于 2021-06-07  发布在  Kafka
关注(0)|答案(2)|浏览(348)

我一直想用Apache风暴从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核心版本设置正确。我不知道我哪里出错了。有人能帮帮我吗?
-谢谢

c9x0cxw0

c9x0cxw01#

这是因为java无法识别ssl证书的根证书颁发机构(ca)https://clojars.org/repo.
解决方案是将该证书添加到javacacerts文件中,以便它被永久接受。
步骤1:获取的根证书https://clojars.org
打开https://clojars.org in chrome浏览器。
找到地址栏旁边的锁符号并单击它。
查看详细信息
单击层次结构中最上面的证书并确认它以根ca短语结尾。
拖放您在桌面上看到的已写入证书的图像。
就这样!你拿到根证书了!
步骤2:将该证书添加到javacacerts文件中。
在jre bin文件夹中使用keytool.exe。
执行以下命令将证书放入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
就是这样!你的问题解决了。
请注意
一定要确认给你这个pkix错误的jre(kafka使用的jre)就是你执行步骤2的地方。如果你想尝试另一个jre问题将是这样的。
只使用一个jre,它在jdk中,这会减少出现问题的机会。

8xiog9wr

8xiog9wr2#

如果您使用的是debian或ubuntu,您可以执行:

$ sudo update-ca-certificates -f

相关问题