Streamparse 字数统计示例 [英] Streamparse wordcount example
问题描述
我一直想使用 Apache Storm 从 Kafka 进行流式传输.我更习惯 Python,所以我决定使用 streamparse (https://github.com/Parsely/streamparse一>).字数统计示例是介绍性示例.我一直试图让它在我的本地机器上工作.我安装了以下版本的 JDK、lein 和 Storm:
<前>Java 1.8.0_73 Java HotSpot(TM) 64 位服务器 VM 上的 Leiningen 2.6.1我在遵循 streamparse 之后运行以下步骤:
<前>稀疏快速入门字数光盘字数稀疏运行我收到以下错误:
<前>从中央检索 org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.pom从中央检索 org/apache/storm/storm/0.10.1/storm-0.10.1.pom从中央检索 org/apache/storm/storm-core/0.10.1/storm-core-0.10.1.jar无法从/向 clojars (https://clojars.org/repo/) 传输工件 com.parsely:streamparse:pom:0.0.4-SNAPSHOT:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效认证路径无法将工件 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:无法找到请求目标的有效认证路径这可能是由于 :dependencies 或网络问题中的拼写错误.如果您使用代理,请尝试设置http_proxy"环境变量.我的 project.clj 文件是这样的:
<前>(defproject wordcount "0.0.1-SNAPSHOT":source-paths ["拓扑"]:resource-paths ["_resources"]:目标路径_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 核心版本设置正确.我不确定我哪里出错了.有人可以帮我吗?
-谢谢
这是因为 java 无法识别 https://clojars.org/repo.
解决方案是将该证书添加到 java cacerts 文件中,以便它被永久接受.
第一步:获取https://clojars.org
的根证书- 在 Chrome 浏览器中打开 https://clojars.org.
- 找到地址栏旁边的锁定符号并点击它.
- 查看详情
- 点击层次结构中最上面的证书,并确认它带有根 CA 短语.
- 拖放您在桌面上看到书面证书的图像.
就是这样!您已获得根证书!
第 2 步:将该证书添加到 java cacerts 文件中.
- 在 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 错误(KAFKA 使用的 JRE)的 jre 是您正在执行第 2 步的地方.如果您尝试解决另一个 jre 问题,将会是这样.
请只使用 JDK 中的一个 jre,这样可以减少出现问题的机会.
I have been wanting to use Apache Storm to stream from Kafka. I am more comfortable with Python, so I decided to use streamparse (https://github.com/Parsely/streamparse). The word count example is the introductory example. I have been trying to get it to work on my local machine. I have the following version of JDK, lein and storm installed:
Leiningen 2.6.1 on Java 1.8.0_73 Java HotSpot(TM) 64-Bit Server VM
I run the following steps after following streamparse:
sparse quick start wordcount cd wordcount sparse run
I get the following error:
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.
My project.clj file reads like this :
(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"] )
So, my lein and storm core versions are set correctly. I'm not sure where I am going wrong . Could somebody help me out?
-Thanks
This is because java is not recognizing root certificate authority (CA) SSL certificate of https://clojars.org/repo.
Solution is to add that certificate to java cacerts file so that it got permanently accepted.
Step 1 : Get root certificate of https://clojars.org
- Open https://clojars.org in a chrome browser.
- locate Lock symbol just besides your address bar and click on it.
- view Details
- Click on top most certificate on hierarchy and confirm it is tailed with Root CA phrase.
- drag and drop that image which you saw written certificate on desktop.
Thats it! you got your root certificate!
Step 2 : Get that certificate added to java cacerts file.
- use keytool.exe inside your jre bin folder.
- fire following command to place your certificate inside cacerts file
keytool –import –noprompt –trustcacerts –alias ALIASNAME -file /PATH/TO/YOUR/DESKTOP/CertificateName.cer -keystore /PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit
That is it! you got your problem resolved.
PLEASE NOTE
Do confirm that the jre which is giving you this PKIX error(JRE used by KAFKA) that is where you are performing STEP 2. If you would try with another jre problem would be as it is.
Do use only one jre which is inside JDK it decreases chance to have issues.
这篇关于Streamparse 字数统计示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!