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

[DOCS] Create More Detailed Installation and Usage Instructions #159

Open
jspeed-meyers opened this issue May 23, 2024 · 3 comments
Open

Comments

@jspeed-meyers
Copy link

👋 I'd be grateful for more detailed installation and usage instructions. I've been struggling to use the container that is created from the Dockerfile and I can't figure out if it's my own fault (user error) or a bug. I suspect that part of my confusion stems from sparse installation and usage instructions. Thank you for creating this cool project!

@jspeed-meyers
Copy link
Author

I thought I would provide my intent, the steps I was following, and the error I encountered.

My intent: I am trying to connect the container built with the Dockerfile in this repo to a container running an instance of MongoDB.

The steps I followed:

I create a network for the containers to share.

docker network create my_network

I then start a mongo instance on this network.

docker run --name some-mongo -d -p 27017:27017 --network my_network mongo:latest

I build the image for the testing tool with the Dockerfile.

git clone https://github.com/mongodb/mongo-perf && cd mongo-perf

docker build --tag=mongo-perf/mongo-perf:test . 

I then run the newly created container.

docker run -it --network my_network mongo-perf/mongo-perf:test -f  testcases/simple_insert.js -t 1 2 4 --host localhost

The error:

MongoDB shell version v5.0.8
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server localhost:27017, connection attempt failed: SocketException: Error connecting to localhost:27017 (127.0.0.1:27017) :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:372:17
@(connect):2:6
exception: connect failed
exiting with code 1
Error: Command '['mongo', '--norc', '--host', 'localhost', '--port', '27017', '--eval', "print('db version: ' + db.version()); db.serverBuildInfo().gitVersion;"]' returned non-zero exit status 1.

There’s a connection error. I’ve tried and failed to debug it.

I'm running this on an Apple M1 Pro (Sonoma 14.5) with Docker version 20.10.21, build baeda1f.

@lsantosdemoura
Copy link

Hey pal!

Your host is wrong, you should be using the name of your mongo container as host, in your case should be something like docker run -it --network my_network mongo-perf/mongo-perf:test -f testcases/simple_insert.js -t 1 2 4 --host some-mongo

That's all I can help though, I've been stuck in some other tests here, but as the README said its supposed to be an internal tool, I don't know if they are going to give any support for this

@jspeed-meyers
Copy link
Author

Thank you, @lsantosdemoura!

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