Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to connect to mongodb using mondb+srv connection #1681

Open
anandht2fid opened this issue Jul 15, 2023 · 9 comments
Open

unable to connect to mongodb using mondb+srv connection #1681

anandht2fid opened this issue Jul 15, 2023 · 9 comments

Comments

@anandht2fid
Copy link

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

@seybi87
Copy link
Contributor

seybi87 commented Jul 17, 2023

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.

@anandht2fid
Copy link
Author

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.

@anandht2fid
Copy link
Author

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?.

@seybi87
Copy link
Contributor

seybi87 commented Jul 18, 2023

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.

@anandht2fid
Copy link
Author

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

@seybi87
Copy link
Contributor

seybi87 commented Jul 19, 2023

Well, you are using YCSB Client 0.17.0 and as pointed out here #1681 (comment) 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.

@anandht2fid
Copy link
Author

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?.

@anandht2fid
Copy link
Author

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.

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.

@seybi87
Copy link
Contributor

seybi87 commented Jul 31, 2023

@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 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants