编译安装YCSB
for MongoDB
编译MongoDB版本的YCSB。
mvn -pl site.ycsb:mongodb-binding -am clean package
for RocksDB
以下以RocksDB 6.1.2版本为例
- 修改pom.xml文件。将RocksDB版本修改为要测试的版本。
cd YCSB vim ./pom.xml <rocksdb.version>6.1.2</rocksdb.version>
- 配置环境变量
将编译好的RocksDB的so文件的目录添加到LD_LIBRARY_PATH中。例如RocksDB的源码目录为”“/home/rocksdb””,则动态库文件目录在”“/home/rocksdb/java/target””。
export LD_LIBRARY_PATH=/home/rocksdb/java/target:$LD_LIBRARY_PATH
配置Java环境。默认自带的Java可能编译出错。
export JAVA_HOME=/usr/lib/jvm/java-1.8.0 export PATH=$JAVA_HOME/bin:$PATH
- 代理配置(可选)。创建”“~/.m2/settings.xml””文件,添加以下内容,并根据实际情况添加代码地址和端口。
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- 禁用中央仓库默认HTTPS地址 --> <mirrors> <mirror> <id>insecure-central</id> <name>Insecure Central Repository</name> <url>https://maven.aliyun.com/repository/public</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> <!-- 允许使用HTTP仓库(安全警告) --> <profiles> <profile> <id>allow-insecure-repositories</id> <repositories> <repository> <id>central</id> <url>https://maven.aliyun.com/repository/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>https://maven.aliyun.com/repository/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <properties> <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure> <maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall> </properties> </profile> </profiles> <proxies> <proxy> <id>my-proxy</id> <!-- 代理标识符(任意名称) --> <active>true</active> <!-- 是否启用此代理 --> <protocol>http</protocol> <!-- 代理协议:http/https/socks --> <host>xxx</host> <!-- 代理服务器地址 --> <port>xxx</port> <!-- 代理端口 --> </proxy> </proxies> <!-- 激活配置 --> <activeProfiles> <activeProfile>allow-insecure-repositories</activeProfile> </activeProfiles> </settings> - 编译RocksDB版本的YCSB。
mvn -pl site.ycsb:rocksdb-binding -am clean package
父主题: YCSB 测试指导