0

I tried to use MongoDB cache for Laravel : https://github.com/jenssegers/laravel-mongodb

I have a Docker container for MongoDB and I set all variables :

MONGO_DB_HOST=mongodb
MONGO_DB_PORT=27017
MONGO_DB_DATABASE=cache
MONGO_DB_USERNAME=root
MONGO_DB_PASSWORD=111

and I set :

CACHE_DRIVER=mongodb

When I tried to connect to this MongoDB container :

`# docker exec -it backend curl http://mongodb:27017

It looks like you are trying to access MongoDB over HTTP on the native driver port.`

And when I did docker logs -f mongodb I have : {"t":{"$date":"2022-01-10T08:28:15.554+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1641803295:554092][1:0x7f669bbde700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 9859, snapshot max: 9859 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1345"}}

And in Laravel logs I have: production.ERROR: Maximum execution time of 30 seconds exceeded {"userId":63,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 30 seconds exceeded at /box/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php:88) seems that is related to mongodb connection.

How can I resolve this?

1 Answer 1

1

Mongodb use the protocol mongodb://. Your connection test should be # docker exec -it backend curl mongodb://mongodb:27017

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.