在示例目录中运行KMeans.jar时,出现了一些错误,并且版本为flink-0.10.1-bin-hadop1-scala_2.10我运行的env是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
我只是在本地尝试了一下,结果成功了。我认为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>]