-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on '127.0.0.1:27017']
#932
Comments
Hi @anggakes By you provided info laradock_mongo_1 show out map port 0.0.0.0:27018, change your php project config to fit. or revert .env set MONGODB_PORT=27017 |
thanks for answer, I have try that, and not fix my problem sir. I just fix my problem because I can connect my mongo container with robomongo,
the problem is, this is not dynamic. |
@anggakes Sorry i made a mistake, your php project is run in php-fpm container. |
@bestlong please check your Gitter messages : ) |
@bestlong thanks for the answer friend :D |
Hey guys, having the same issue all docker instances were fine for some reason I did docker rese and then getting the same problem. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES in my .env file I have set my port to 27012 but either with robo 3t or via shell I cant connect as get following errors (master) % mongo mongodb://127.0.0.1:27012 ******************* even with laravel app ( same code and env file with correct port ) I got this error [MongoDB\Driver\Exception\ConnectionTimeoutException] On gogole search they recommending to bind the ip but I Am not sure how I can do that |
Hey, I just had the same issue on my Vagrant VM, Ubuntu based.
I'm definitly not an expert and i'm not sure it's the same problem, but here is how i fixed it on my case : |
@bestlong that works for me ! Thanks ! |
Hi 👋 this issue has been automatically marked as |
Hi again 👋 we would like to inform you that this issue has been automatically |
SELinux (CentOS7/8) can cause this error, applying the following rule may resolve it:
|
Hi everyone, Had the same issue here, Docker runs on Windows. Above solutions didn't work but i've been able to fix it with hostname host.docker.internal Found solution here : https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach |
Info:
Issue:
I test this :
$client = new Client();
Expected behavior:
result error :
No suitable servers found (
serverSelectionTryOnce
set): [connection refused calling ismaster on '127.0.0.1:27017']this is my docker PS :
` Name Command State Ports
laradock_applica /true Exit 0
tions_1
laradock_mariadb docker- Up 0.0.0.0:33061->3306/tcp
_1 entrypoint.sh
mysqld
laradock_mongo_1 docker- Up 0.0.0.0:27018->27017/tcp
entrypoint.sh
mongod
laradock_nginx_1 nginx Up 0.0.0.0:4430->44
3/tcp, 0.0.0.0:8
100->80/tcp, 0.0
.0.0:820->820/tc
p
laradock_php- docker-php- Up 9000/tcp
fpm_1 entrypoint php-
fpm
laradock_workspa /sbin/my_init Up 0.0.0.0:2222->22
ce_1 /tcp `
The text was updated successfully, but these errors were encountered: