在示例dirctory中运行KMeans.jar时,存在一些错误,并且版本为flink-0.10.1-bin-hadoop1-scala_2.10 我的运行环境是cygwin64,错误如下:
root@HIH-D /cygdrive/d/Development/flink-0.10.1-bin-hadoop1-scala_2.10/flink-0.10.1/kmeans
运行
# java -cp ../examples/KMeans.jar:../lib/flink-dist-0.10.1.jar org.apache.flink.examples.java.clustering.util.KMeansDataGenerator -points 500 -k 10 -stddev 0.08 -output `pwd`
给出
ClassNotFoundException: org.apache.flink.examples.java.clustering.util.KMeansDataGenerator
答案 0 :(得分:1)
我刚刚在本地尝试了这个并且它有效。
我认为classpath(-cp
)参数设置不正确。
您可以尝试从调用KMeansDataGenerator的目录中执行jar tf ../examples/KMeans.jar
吗? (在:D /cygdrive/d/Development/flink-0.10.1-bin-hadoop1-scala_2.10/flink-0.10.1/kmeans
)。
robert@robert-da ~/incubator-flink/build-target (git)-[flink3003] % mkdir kmeans
robert@robert-da ~/incubator-flink/build-target (git)-[flink3003] % cd kmeans
robert@robert-da ~/incubator-flink/build-target/kmeans (git)-[flink3003] % java -cp ../examples/KMeans.jar:../lib/flink-dist-1.0-SNAPSHOT.jar org.apache.flink.examples.java.clustering.util.KMeansDataGenerator
KMeansDataGenerator -points <num> -k <num clusters> [-output <output-path>] [-stddev <relative stddev>] [-range <centroid range>] [-seed <seed>]