<!--
Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->
## Quick Start
This section describes how to run YCSB on MongoDB.
### 1. Start MongoDB
First, download MongoDB and start `mongod`. For example, to start MongoDB
on x86-64 Linux box:
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-x.x.x.tgz
tar xfvz mongodb-linux-x86_64-*.tgz
mkdir /tmp/mongodb
cd mongodb-linux-x86_64-*
./bin/mongod --dbpath /tmp/mongodb
Replace x.x.x above with the latest stable release version for MongoDB.
See http://docs.mongodb.org/manual/installation/ for installation steps for various operating systems.
### 2. Install Java and Maven
Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html
and get the url to download the rpm into your server. For example:
wget http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.rpm?AuthParam=11232426132 -o jdk-7u40-linux-x64.rpm
rpm -Uvh jdk-7u40-linux-x64.rpm
Or install via yum/apt-get
sudo yum install java-devel
Download MVN from http://maven.apache.org/download.cgi
wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
sudo tar xzf apache-maven-*-bin.tar.gz -C /usr/local
cd /usr/local
sudo ln -s apache-maven-* maven
sudo vi /etc/profile.d/maven.sh
Add the following to `maven.sh`
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}
Reload bash and test mvn
bash
mvn -version
### 3. Set Up YCSB
Download the YCSB zip file and compile:
curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.5.0/ycsb-0.5.0.tar.gz
tar xfvz ycsb-0.5.0.tar.gz
cd ycsb-0.5.0
### 4. Run YCSB
Now you are ready to run! First, use the asynchronous driver to load the data:
./bin/ycsb load mongodb-async -s -P workloads/workloada > outputLoad.txt
Then, run the workload:
./bin/ycsb run mongodb-async -s -P workloads/workloada > outputRun.txt
Similarly, to use the synchronous driver from MongoDB Inc. we load the data:
./bin/ycsb load mongodb -s -P workloads/workloada > outputLoad.txt
Then, run the workload:
./bin/ycsb run mongodb -s -P workloads/workloada > outputRun.txt
See the next section for the list of configuration parameters for MongoDB.
## Log Level Control
Due to the mongodb driver defaulting to a log level of DEBUG, a logback.xml file is included with this module that restricts the org.mongodb logging to WARN. You can control this by overriding the logback.xml and defining it in your ycsb command by adding this flag:
```
bin/ycsb run mongodb -jvm-args="-Dlogback.configurationFile=/path/to/logback.xml"
```
## MongoDB Configuration Parameters
- `mongodb.url`
- This should be a MongoDB URI or connection string.
- See http://docs.mongodb.org/manual/reference/connection-string/ for the standard options.
- For the complete set of options for the asynchronous driver see:
- http://www.allanbank.com/mongodb-async-driver/apidocs/index.html?com/allanbank/mongodb/MongoDbUri.html
- For the complete set of options for the synchronous driver see:
- http://api.mongodb.org/java/current/index.html?com/mongodb/MongoClientURI.html
- Default value is `mongodb://localhost:27017/ycsb?w=1`
- Default value of database is `ycsb`
- `mongodb.batchsize`
- Useful for the insert workload as it will submit the inserts in batches inproving throughput.
- Default value is `1`.
- `mongodb.upsert`
- Determines if the insert operation performs an update with the upsert operation or a insert.
Upserts have the advantage that they will continue to work for a partially loaded data set.
- Setting to `true` uses updates, `false` uses insert operations.
- Default value is `false`.
- `mongodb.writeConcern`
- **Deprecated** - Use the `w` and `journal` options on the MongoDB URI provided by the `mongodb.url`.
- Allowed values are :
- `errors_ignored`
- `unacknowledged`
- `acknowledged`
- `journaled`
- `replica_acknowledged`
- `majority`
- Default value is `acknowledged`.
- `mongodb.readPreference`
- **Deprecated** - Use the `readPreference` options on the MongoDB URI provided by the `mongodb.url`.
- Allowed values are :
- `primary`
- `primary_preferred`
- `secondary`
- `secondary_preferred`
- `nearest`
- Default value is `primary`.
- `mongodb.maxconnections`
- **Deprecated** - Use the `maxPoolSize` options on the MongoDB URI provided by the `mongodb.url`.
- Default value is `100`.
- `mongodb.threadsAllowedToBlockForConnectionMultiplier`
- **Deprecated** - Use the `waitQueueMultiple` options on the MongoDB URI provided by the `mongodb.url`.
- Default value is `5`.
For example:
./bin/ycsb load mongodb-async -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0
To run with the synchronous driver from MongoDB Inc.:
./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://localhost:27017/ycsb?w=0
没有合适的资源?快使用搜索试试~ 我知道了~
ycsb-mongodb
共28个文件
jar:12个
txt:2个
ycsb:1个
需积分: 0 0 下载量 104 浏览量
2024-01-18
19:26:30
上传
评论
收藏 7.12MB 7Z 举报
温馨提示
YCSB(Yahoo Cloud Serving Benchmark)是一个开源的性能测试框架,用于评估分布式系统的读写性能。它具有以下优点和缺点: 优点: 简单易用:YCSB提供了简单的API和配置文件,使得性能测试非常容易上手和执行。 可扩展性:YCSB支持多种数据库和存储系统,包括关系型数据库、NoSQL数据库、分布式文件系统等,使得测试可以针对不同的系统进行比较和评估。 客户端压力:YCSB可以模拟大量并发用户并提供各种负载测试模式,可以测试系统在高负载情况下的性能表现。 可自定义:YCSB允许用户通过自定义操作和负载生成器来模拟真实场景的读写操作,并能够根据需求进行灵活的性能测试。 缺点: 功能有限:YCSB主要关注系统的读写性能,但对于其他方面的测试,如连接池管理、事务处理等功能则不够全面。 没有细粒度监控:YCSB提供一些基本的指标和报告,但对于系统内部的细粒度监控和分析能力较弱,无法对系统的具体瓶颈进行深入探究。 侧重点不同:YCSB主要关注于基准性能,对于系统的可用性、容错性等方面的测试则相对较少。 综上所述,YCSB作为一个简单易用的性能测试框架,能够有效评估
资源推荐
资源详情
资源评论
收起资源包目录
ycsb-mongodb-0.17.0-liuyunshengsir.7z (28个子文件)
ycsb-mongodb-0.17.0-liuyunshengsir
lib
jackson-mapper-asl-1.9.4.jar 759KB
logback-classic-1.1.2.jar 264KB
slf4j-api-1.7.25.jar 40KB
snappy-java-1.1.7.1.jar 1.93MB
logback-core-1.1.2.jar 418KB
htrace-core4-4.1.0-incubating.jar 1.43MB
mongodb-async-driver-2.0.1.jar 539KB
core-0.17.0.jar 143KB
HdrHistogram-2.1.4.jar 102KB
mongodb-binding-0.17.0.jar 19KB
jackson-core-asl-1.9.4.jar 223KB
mongo-java-driver-3.8.0.jar 1.94MB
LICENSE.txt 11KB
NOTICE.txt 615B
bin
ycsb 15KB
bindings.properties 3KB
ycsb.sh 9KB
ycsb.bat 8KB
workloads
workload_template 7KB
workloadc 3KB
workloada 3KB
workloadf 3KB
tsworkload_template 12KB
workloade 3KB
tsworkloada 1KB
workloadd 3KB
workloadb 3KB
README.md 6KB
共 28 条
- 1
资源评论
liuyunshengsir
- 粉丝: 9402
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2001~2022年上市公司数字赋能指数.dta
- 2001~2022年上市公司数字赋能指数.xlsx
- 信息办公石大在线财务管理系统(含源码)-shidacaiwu.rar
- 信息办公电信计费系统完整代码-netctossconformity.rar
- matlab实现TD-SCDMA中初始同步捕捉DwPTS下行同步导频时隙的仿真.zip
- 信息办公玉玺学生信息管理系统-webapps.rar
- 信息办公基于struts的图书管理系统-struts-ts.rar
- 管家婆分销ERP V1 V3 A8II TOP V10.0.2最新全版本通用
- 信息办公基于Ajax+J2EE的MicroERP源码下载-microerp-0.1.rar
- 信息办公双鱼林jsp人事工资系统-wagesmanagesystem.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功