brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.9k stars 2.22k forks source link

Unknown option -cp (using JDBC driver) #1654

Closed driesvd2 closed 1 year ago

driesvd2 commented 1 year ago

The program seems to be running fine, until it gives us the error "unknown option -cp" YCSB is running on windows computer with python 2.7 installed

PS C:\Users\lkwizera\Documents\SDMS\ycsb> bin/ycsb load jdbc -P workloads/workloada -P ./jdbc-binding/conf/db.properties -cp mysql-connector-j-8.0.31.jar

C:\Users\lkwizera\Documents\SDMS\ycsb>"C:\Program Files\Java\jdk-11.0.16.1\bin\java.exe" -classpath "C:\Users\lkwizera\Documents\SDMS\ycsb\conf;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\core-0.17.0.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\HdrHistogram-2.1.4.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\htrace-core4-4.1.0-incubating.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\jackson-core-asl-1.9.4.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\jackson-mapper-asl-1.9.4.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\lib\mysql-connector-j-8.0.31.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\conf;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\commons-collections-3.2.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\commons-lang-2.4.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\commons-pool-1.5.4.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\geronimo-jms_1.1_spec-1.1.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\geronimo-jta_1.1_spec-1.1.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\jdbc-binding-0.17.0.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\mysql-connector-j-8.0.31.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\openjpa-jdbc-2.1.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\openjpa-kernel-2.1.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\openjpa-lib-2.1.1.jar;C:\Users\lkwizera\Documents\SDMS\ycsb\jdbc-binding\lib\serp-1.13.1.jar" site.ycsb.Client -load -db site.ycsb.db.JdbcDBClient -P workloads/workloada -P ./jdbc-binding/conf/db.properties -cp mysql-connector-j-8.0.31.jar Command line: -load -db site.ycsb.db.JdbcDBClient -P workloads/workloada -P ./jdbc-binding/conf/db.properties -cp mysql-connector-j-8.0.31.jar Usage: java site.ycsb.Client [options] Options: -threads n: execute using n threads (default: 1) - can also be specified as the "threadcount" property using -p -target n: attempt to do n operations per second (default: unlimited) - can also be specified as the "target" property using -p -load: run the loading phase of the workload -t: run the transactions phase of the workload (default) -db dbname: specify the name of the DB to use (default: site.ycsb.BasicDB) - can also be specified as the "db" property using -p -P propertyfile: load properties from the given file. Multiple files can be specified, and will be processed in the order specified -p name=value: specify a property to be passed to the DB and workloads; multiple properties can be specified, and override any values in the propertyfile -s: show status during run (default: no status) -l label: use label for status (e.g. to label one experiment out of a whole batch)

Required properties: workload: the name of the workload class to use (e.g. site.ycsb.workloads.CoreWorkload)

To run the transaction phase from multiple servers, start a separate client on each. To run the load phase from multiple servers, start a separate client on each; additionally, use the "insertcount" and "insertstart" properties to divide up the records to be inserted Unknown option -cp

busbey commented 1 year ago

that output is coming from the windows batch launcher we ship. Windows doesn't recognize the python file as something to run and "helpfully" treats the bare "ycsb" token as equivalent to having a windows batch file with that name.

unfortunately the current windows batch launcher does not support the argument for additional classpath entries.

Best long term option would be to set up the Windows Subsystem for Linux (WSL) and then use that to run the bash script. We don't have any kind of guidance for doing that though, so you're going to have a bit of groundwork to do.

next best option is to switch to using the python launcher instead of the windows batch launcher. To do that you have to expressly launch python with the ycsb python script as an argument. See the "Verifying things work" section of our wiki page on running on windows from a release.

Last, if you need to stick with the windows batch launcher for some reason you can set additions to the CLASSPATH variable in the setenv.bat file as described in the docs for the windows batch launcher:

@REM   Do not set the variables in this script. Instead put them into a script
@REM   setenv.sh in YCSB_HOME/bin to keep your customizations separate.