#!/bin/bash
function CDAN(){
cat << t
1.加载压测环境
2.纯插入场景
3.纯查询场景
4.纯更新场景
5.50读/50更新场景
t
}
CDAN
read -p 请选择要压测的模式: NUM
expr $NUM + 1 &>/dev/null
if [ "$?" -ne 0 ]
then
echo "请您输入{1|2|3|4|5}"
exit 1
fi
read -p 请输入输出文件的编号: LOG
echo "请确认是否为分片1为是,2为否"
read -p 请输入: SH
if [ "$SH" = "2" ]
then
SH="No"
fi
read -p 请输入线程数: TH
if [ -z "$TH" ]
then
TH="64"
fi
read -p 请输入主机ip和端口: PORT
if [ -z "$PORT" ]
then
PORT="localhost:27017"
fi
read -p 请输入用户: USR
if [ -z "$USR" ]
then
USR="ycsbusr"
fi
read -p 请输入用户密码: PWS
if [ -z "$PWS" ]
then
PWS="Cmb%402018ycsb"
fi
case $NUM in
1)
./bin/ycsb load mongodb -s -P workloads/workloadloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > ycsb.load.log
;;
2)
./bin/ycsb run mongodb -s -P workloads/workloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-insert.$TH.$SH-Sharding.log
;;
3)
./bin/ycsb run mongodb -s -P workloads/workloadread -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-read.$TH.$SH-Sharding.log
;;
4)
./bin/ycsb run mongodb -s -P workloads/workloadupdate -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-update.$TH.$SH-Sharding.log
;;
5)
./bin/ycsb run mongodb -s -P workloads/workload5050 -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.50-50.$TH.$SH-Sharding.log
;;
esac
#!/bin/bash
function CDAN(){
cat << t
1.加载压测环境
2.纯插入场景
3.纯查询场景
4.纯更新场景
5.50读/50更新场景
t
}
CDAN
read -p 请选择要压测的模式: NUM
expr $NUM + 1 &>/dev/null
if [ "$?" -ne 0 ]
then
echo "请您输入{1|2|3|4|5}"
exit 1
fi
read -p 请输入输出文件的编号: LOG
echo "请确认是否为分片1为是,2为否"
read -p 请输入: SH
if [ "$SH" = "2" ]
then
SH="No"
fi
read -p 请输入线程数: TH
if [ -z "$TH" ]
then
TH="64"
fi
read -p 请输入主机ip和端口: PORT
if [ -z "$PORT" ]
then
PORT="localhost:27017"
fi
read -p 请输入用户: USR
if [ -z "$USR" ]
then
USR="ycsbusr"
fi
read -p 请输入用户密码: PWS
if [ -z "$PWS" ]
then
PWS="Cmb%402018ycsb"
fi
case $NUM in
1)
./bin/ycsb load mongodb -s -P workloads/workloadloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > ycsb.load.log
;;
2)
./bin/ycsb run mongodb -s -P workloads/workloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-insert.$TH.$SH-Sharding.log
;;
3)
./bin/ycsb run mongodb -s -P workloads/workloadread -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-read.$TH.$SH-Sharding.log
;;
4)
./bin/ycsb run mongodb -s -P workloads/workloadupdate -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-update.$TH.$SH-Sharding.log
;;
5)
./bin/ycsb run mongodb -s -P workloads/workload5050 -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.50-50.$TH.$SH-Sharding.log
;;
esac
#!/bin/bash
function CDAN(){
cat << t
1.加载压测环境
2.纯插入场景
3.纯查询场景
4.纯更新场景
5.50读/50更新场景
t
}
CDAN
read -p 请选择要压测的模式: NUM
expr $NUM + 1 &>/dev/null
if [ "$?" -ne 0 ]
then
echo "请您输入{1|2|3|4|5}"
exit 1
fi
read -p 请输入输出文件的编号: LOG
echo "请确认是否为分片1为是,2为否"
read -p 请输入: SH
if [ "$SH" = "2" ]
then
SH="No"
fi
read -p 请输入线程数: TH
if [ -z "$TH" ]
then
TH="64"
fi
read -p 请输入主机ip和端口: PORT
if [ -z "$PORT" ]
then
PORT="localhost:27017"
fi
read -p 请输入用户: USR
if [ -z "$USR" ]
then
USR="ycsbusr"
fi
read -p 请输入用户密码: PWS
if [ -z "$PWS" ]
then
PWS="Cmb%402018ycsb"
fi
case $NUM in
1)
./bin/ycsb load mongodb -s -P workloads/workloadloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > ycsb.load.log
;;
2)
./bin/ycsb run mongodb -s -P workloads/workloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-insert.$TH.$SH-Sharding.log
;;
3)
./bin/ycsb run mongodb -s -P workloads/workloadread -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-read.$TH.$SH-Sharding.log
;;
4)
./bin/ycsb run mongodb -s -P workloads/workloadupdate -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-update.$TH.$SH-Sharding.log
;;
5)
./bin/ycsb run mongodb -s -P workloads/workload5050 -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.50-50.$TH.$SH-Sharding.log
;;
esac
#!/bin/bash
function CDAN(){
cat << t
1.加载压测环境
2.纯插入场景
3.纯查询场景
4.纯更新场景
5.50读/50更新场景
t
}
CDAN
read -p 请选择要压测的模式: NUM
expr $NUM + 1 &>/dev/null
if [ "$?" -ne 0 ]
then
echo "请您输入{1|2|3|4|5}"
exit 1
fi
read -p 请输入输出文件的编号: LOG
echo "请确认是否为分片1为是,2为否"
read -p 请输入: SH
if [ "$SH" = "2" ]
then
SH="No"
fi
read -p 请输入线程数: TH
if [ -z "$TH" ]
then
TH="64"
fi
read -p 请输入主机ip和端口: PORT
if [ -z "$PORT" ]
then
PORT="localhost:27017"
fi
read -p 请输入用户: USR
if [ -z "$USR" ]
then
USR="ycsbusr"
fi
read -p 请输入用户密码: PWS
if [ -z "$PWS" ]
then
PWS="Cmb%402018ycsb"
fi
case $NUM in
1)
./bin/ycsb load mongodb -s -P workloads/workloadloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > ycsb.load.log
;;
2)
./bin/ycsb run mongodb -s -P workloads/workloadinsert -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-insert.$TH.$SH-Sharding.log
;;
3)
./bin/ycsb run mongodb -s -P workloads/workloadread -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-read.$TH.$SH-Sharding.log
;;
4)
./bin/ycsb run mongodb -s -P workloads/workloadupdate -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.ALL-update.$TH.$SH-Sharding.log
;;
5)
./bin/ycsb run mongodb -s -P workloads/workload5050 -p mongodb.url=mongodb://$USR:$PWS@$PORT/ycsb?w=1 -threads $TH > T$LOG.50-50.$TH.$SH-Sharding.log
;;
esac
#!/bin/bash
function CDAN(){
cat << t
1.加载压测环境
2.纯插入场景
3.纯查询场景
4.纯更新场景
5.50读/50更新场景
t
}
CDAN
read -p 请选择要压测的模式: NUM
expr $NUM + 1 &>/dev/null
if [ "$?" -ne 0 ]
then
echo "请您输入{1|2|3|4|5}"
exit 1
fi
read -p 请输入输出文件的编号: LOG
echo "请确认是否为分片1为是,2为否"
read -p 请输入: SH
if [ "$SH" = "2" ]
then
SH="No"
fi
read -p 请输入线程数: TH
if [ -z "$TH" ]
then
TH="64"
fi
read -p 请输入主机ip和端口: PORT
if [ -z "$PORT" ]
then
PORT="localhost:27017"
fi
read -p 请输入用户: USR
if [ -z "$USR" ]
then
USR="ycsbusr"
fi
read -p 请输入用户密码: PWS
if [ -z "$PWS" ]
then
PWS="Cmb%40