Streamparse字数示例 [英] Streamparse wordcount example

查看:55
本文介绍了Streamparse字数示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想使用Apache Storm从Kafka进行流式传输.我对Python比较满意,因此决定使用streamparse( https://github.com/Parsely/streamparse).单词计数示例是介绍性示例.我一直在尝试使其在我的本地计算机上运行.我安装了以下版本的JDK,lein和storm:

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

在执行streamparse之后,我运行以下步骤:

I run the following steps after following 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文件如下所示:

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"]
  )

因此,我的lein和Storm核心版本设置正确.我不知道我要去哪里错了.有人可以帮我吗?

So, my lein and storm core versions are set correctly. I'm not sure where I am going wrong . Could somebody help me out?

-谢谢

推荐答案

这是因为Java无法识别 https://clojars.org/repo .

This is because java is not recognizing root certificate authority (CA) SSL certificate of https://clojars.org/repo.

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

Solution is to add that certificate to java cacerts file so that it got permanently accepted.

步骤1:获取 https://clojars.org

  1. 在Chrome浏览器中打开 https://clojars.org .
  2. 在地址栏旁边找到锁定"符号,然后单击它.
  3. 查看详细信息
  4. 单击层次结构上最上面的证书,并确认它带有根CA短语.
  5. 拖放您在桌面上看到的书面证书的图像.
  1. Open https://clojars.org in a chrome browser.
  2. locate Lock symbol just besides your address bar and click on it.
  3. view Details
  4. Click on top most certificate on hierarchy and confirm it is tailed with Root CA phrase.
  5. drag and drop that image which you saw written certificate on desktop.

就是这样!您已经获得了根证书!

Thats it! you got your root certificate!

第2步:将该证书添加到java cacerts文件中.

Step 2 : Get that certificate added to java cacerts file.

  1. 在jre bin文件夹中使用keytool.exe.
  2. 执行以下命令将您的证书放入cacerts文件中

keytool –导入–noprompt –trustcacerts –alias ALIASNAME-文件 /PATH/TO/您的/DESKTOP/CertificateName.cer -keystore /PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit

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.

请注意

  1. 请确认正在执行步骤2的jre发生了此PKIX错误(KAFKA使用的JRE).如果尝试其他jre问题,则保持原样.

  1. 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.

请仅在JDK内部使用一个jre,这样可以减少出现问题的机会.

Do use only one jre which is inside JDK it decreases chance to have issues.

这篇关于Streamparse字数示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆