YCSB
YCSB copied to clipboard
unable to connect to mongodb using mondb+srv connection
Hello i am using the below connection to test but getting an error /apps/ycsb/ycsb-0.17.0/bin/ycsb load mongodb-async -P ../workloads/workloada -p mongodb.database=YCSB_Testing -p mongodb.url="mongodb+srv://userid:[email protected]/?tls=true&authMechanism=PLAIN&tlsCAFile=/apps/ycsb/YCSB-0.12.0/mongodb/root.pem"
i can connect from compass using same url.
Error: Command line: -db site.ycsb.db.AsyncMongoDbClient -P ../workloads/workloada -p mongodb.database=YCSB_Testing -load YCSB Client 0.17.0
Loading workload... Starting test. java.lang.ClassNotFoundException: site.ycsb.db.AsyncMongoDbClient at java.net.URLClassLoader.findClass(URLClassLoader.java:387) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at site.ycsb.DBFactory.newDB(DBFactory.java:38) at site.ycsb.Client.initDb(Client.java:428) at site.ycsb.Client.main(Client.java:311) Exception in thread "Thread-2" java.lang.NullPointerException at site.ycsb.ClientThread.run(ClientThread.java:91) at java.lang.Thread.run(Thread.java:750) [OVERALL], RunTime(ms), 1 [OVERALL], Throughput(ops/sec), 0.0 [TOTAL_GCS_PS_Scavenge], Count, 0 [TOTAL_GC_TIME_PS_Scavenge], Time(ms), 0 [TOTAL_GC_TIME_%PS_Scavenge], Time(%), 0.0 [TOTAL_GCS_PS_MarkSweep], Count, 0 [TOTAL_GC_TIME_PS_MarkSweep], Time(ms), 0 [TOTAL_GC_TIME%PS_MarkSweep], Time(%), 0.0 [TOTAL_GCs], Count, 0 [TOTAL_GC_TIME], Time(ms), 0 [TOTAL_GC_TIME%], Time(%), 0.0
Please help. Thanks
Hi @anandht2fid
the version 0.17.0
does not support the SRV style connection.
You can either build the YCSB latest 0.18.0-SNAPSHOT
manually or use the IP based connection string with 0.17.0.
Thank you so much. Also after installing i did not see pom.xml file in the install root directory or another one under the mongodb-binding directory. Another file checkstyle.xml was missing which i had to manually copy from windows copy. Did i miss anything in install.
in the 17.0 install (after tar -xvf ycsb-0.17.0.tar.gz) i also dont see folders /mongodb-binding/src/main/java/site/ycsb/db/ where the AsyncMongoDbClient.java resides. is this why i am getting java.lang.ClassNotFoundException: site.ycsb.db.AsyncMongoDbClient?.
I did try connection without a SRV string and got the same error. Does missing pom files and the java files indicate something i missed in install process?.
I am not sure what the state of the async driver. The last update on the YCSB code base for the async driver was already 4 ago.
And it looks like that the respective GitHub repository of the async driver is not maintained anymore.
We only used the synchronous driver for benchmarking MongoDB.
its same error with synchronous driver as well.
YCSB Client 0.17.0
Loading workload... Starting test. java.lang.ClassNotFoundException: site.ycsb.db.MongoDbClient at java.net.URLClassLoader.findClass(URLClassLoader.java:387) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at site.ycsb.DBFactory.newDB(DBFactory.java:38) at site.ycsb.Client.initDb(Client.java:428) at site.ycsb.Client.main(Client.java:311) Exception in thread "Thread-3" java.lang.NullPointerException at site.ycsb.ClientThread.run(ClientThread.java:91) at java.lang.Thread.run(Thread.java:750) 2023-07-18 17:12:47:973 0 sec: 0 operations; est completion in 0 second 2023-07-18 17:12:47:974 0 sec: 0 operations; est completion in 106751991167300 days 15 hours [OVERALL], RunTime(ms), 0 [OVERALL], Throughput(ops/sec), NaN [TOTAL_GCS_PS_Scavenge], Count, 0 [TOTAL_GC_TIME_PS_Scavenge], Time(ms), 0 [TOTAL_GC_TIME_%PS_Scavenge], Time(%), NaN [TOTAL_GCS_PS_MarkSweep], Count, 0 [TOTAL_GC_TIME_PS_MarkSweep], Time(ms), 0 [TOTAL_GC_TIME%PS_MarkSweep], Time(%), NaN [TOTAL_GCs], Count, 0 [TOTAL_GC_TIME], Time(ms), 0 [TOTAL_GC_TIME%], Time(%), NaN
Well, you are using YCSB Client 0.17.0
and as pointed out here https://github.com/brianfrankcooper/YCSB/issues/1681#issuecomment-1637493284 you need to build the current master
and use the resulting snapshot.
We run a lot of MongoDB benchmarks against SRV and IP endpoints using the sync driver from the 0.18.0-SNAPSHOT
and it works without a problem.
trying to build a latest snapshot but get the error [INFO] [INFO] ---------------------< site.ycsb:mongodb-binding >---------------------- [INFO] Building MongoDB Binding 0.18.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for site.ycsb:core:jar:0.18.0-SNAPSHOT is missing, no dependency information available
where is this jar available?.
Hi @anandht2fid the version
0.17.0
does not support the SRV style connection. You can either build the YCSB latest0.18.0-SNAPSHOT
manually or use the IP based connection string with 0.17.0.
Does 0.17.0 recogize TLS parms passed like below:
C:\Users\Xxxxx\Mongosh_1.9.1\mongosh-1.9.1-win32-x64\bin>C:\Users\axxxx\Documents\YCSB-master\bin\ycsb.bat load mongodb -P C:\Users\Xxxxxxxx\Documents\YCSB-master\workloads\workloada -s
-p mongodb.url="mongodb://userid:password@host:27017?tls=true&authMechanism=PLAIN&authSource=%24external&tlsCAFile=C:\Users\Xxxxxxx\Downloads\root.pem" -p mongod
b.database=YCSB_Testing
C:\Program Files\Java\jdk-13.0.1 JAVA_HOME
C:\Users\Xxxxxxx\Documents\YCSB-master\conf;C:\Users\Xxxxxxx.m2\repository\site\ycsb\core\0.17.0;C:\Users\Xxxxxxx
.m2\repository\site\ycsb\core\0.17.0\core-0.17.0.jar;C:\Users\Xxxxxxx.m2\repository\org\apache\maven\maven-artifac
t\3.2.5\maven-artifact-3.2.5.jar;C:\Users\Xxxxxxx.m2\repository\org\apache\htrace\htrace-core4\4.1.0-incubating\ht
race-core4-4.1.0-incubating.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\mongodb-binding-0.17.0.jar;C:
\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\commons-io-2.6.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\javax.activation-api-1.2.0.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\jaxb-api-2.3.1.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\logback-classic-1.1.2.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\logback-core-1.1.2.jar;C:\Users\Xxxxxxx\Do
cuments\YCSB-master\mongodb\target\dependency\maven-shared-utils-3.3.4.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\mongo-java-driver-3.0.3.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependen
cy\mongodb-async-driver-2.0.1.jar;C:\Users\Xxxxxxx\Documents\YCSB-master\mongodb\target\dependency\slf4j-api-1.7.25
.jar
& was unexpected at this time. <<< this is the error i get.
Sorry for checking with 0.17.0. i am unable to use 0.18.0-snapshot due to other issues.
@anandht2fid not sure how you try to build the 0.18.0-snapshot but these commands will work:
git clone https://github.com/brianfrankcooper/YCSB.git
cd YCSB/ && mvn clean package -Dcheckstyle.skip -DskipTests