我正在尝试使用MongoDB数据库运行最新版本的YCSB。 我曾尝试使用maven构建YCSB,但在构建过程中遇到了很多错误,尽管maven说是SUCCESS。 当我试图运行ycsb它返回一个错误,我在CentOS 6.5上使用maven 3.3.3与java 1.8
[root@hostname YCSB]# ./bin/ycsb
Traceback (most recent call last):
File "./bin/ycsb", line 3, in <module>
import argparse
ImportError: No module named argparse
Maven和Java详细信息:
[root@hostname YCSB]# mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T14:57:37+03:00)
Maven home: /usr/local/maven
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
Maven输出:
/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java:465: 'if' have incorrect indentation level 12, expected level should be 6.
/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java:466: 'if' child have incorrect indentation level 16, expected level should be 8.
/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java:468: 'if rcurly' have incorrect indentation level 12, expected level should be 6.
/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java:469: 'for rcurly' have incorrect indentation level 8, expected level should be 4.
/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java:470: 'method def rcurly' have incorrect indentation level 4, expected level should be 2.
Audit done.
[INFO] There are 653 errors reported by Checkstyle 6.1.1 with checkstyle.xml ruleset.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mongodb-binding ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /YCSB/mongodb/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ mongodb-binding ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /YCSB/mongodb/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mongodb-binding ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /YCSB/mongodb/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ mongodb-binding ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /YCSB/mongodb/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mongodb-binding ---
[INFO] Surefire report directory: /YCSB/mongodb/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.yahoo.ycsb.db.MongoDbClientTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.043 sec
Running com.yahoo.ycsb.db.AsyncMongoDbClientTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0 sec
Running com.yahoo.ycsb.db.OptionsSupportTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Results :
Tests run: 6, Failures: 0, Errors: 0, Skipped: 2
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mongodb-binding ---
[INFO] Building jar: /YCSB/mongodb/target/mongodb-binding-0.3.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-dependency-plugin:2.10:copy-dependencies (stage-dependencies) @ mongodb-binding ---
[INFO] Copying logback-core-1.1.2.jar to /YCSB/mongodb/target/dependency/logback-core-1.1.2.jar
[INFO] Copying mongo-java-driver-3.0.2.jar to /YCSB/mongodb/target/dependency/mongo-java-driver-3.0.2.jar
[INFO] Copying slf4j-api-1.6.4.jar to /YCSB/mongodb/target/dependency/slf4j-api-1.6.4.jar
[INFO] Copying logback-classic-1.1.2.jar to /YCSB/mongodb/target/dependency/logback-classic-1.1.2.jar
[INFO] Copying mongodb-async-driver-2.0.1.jar to /YCSB/mongodb/target/dependency/mongodb-async-driver-2.0.1.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.5.5:single (default) @ mongodb-binding ---
[WARNING] The following patterns were never triggered in this artifact exclusion filter:
o '*:sources'
[INFO] Building tar: /YCSB/mongodb/target/ycsb-mongodb-binding-0.3.0-SNAPSHOT.tar.gz
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] YCSB Root .......................................... SUCCESS [ 0.486 s]
[INFO] Core YCSB .......................................... SUCCESS [ 3.856 s]
[INFO] Per Datastore Binding descriptor ................... SUCCESS [ 0.216 s]
[INFO] YCSB Datastore Binding Parent ...................... SUCCESS [ 0.175 s]
[INFO] MongoDB Binding .................................... SUCCESS [ 1.077 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.946 s
[INFO] Finished at: 2015-06-24T20:10:33+03:00
[INFO] Final Memory: 55M/2369M
[INFO] ------------------------------------------------------------------------
答案 0 :(得分:0)
您缺少名为argparse的Python模块。
您可以使用以下命令安装它:
easy_install argparse
答案 1 :(得分:0)
它是用maven构建的。
但它被python使用。你的python丢失了一个数据包。尝试安装python-argparse或使用python 2.7。 (python2.7包含argparse)