mahbd Posted November 1, 2020 Posted November 1, 2020 Hi,I'm trying to run this script to check if MongoDB atlas is working with python. #!/usr/bin/python3.7 import pymongo print("Content-Type: text/html\n\n") mongoLink = "mongodb+srv://username:password@cluster0.wkb1y.mongodb.net/DjCh?retryWrites=true" try: myClient = pymongo.MongoClient(mongoLink) print(myClient.list_database_names()) except Exception as e: print(str(e)) The above script is working fine on my local mechine. I also allowed access from anywhere(0.0.0.0/0). But I'm getting this error on http://mahbd.heliohost.org/cgi-bin/test.py . cluster0-shard-00-02.wkb1y.mongodb.net:27017: [Errno 111] Connection refused,cluster0-shard-00-01.wkb1y.mongodb.net:27017: [Errno 111] Connection refused,cluster0-shard-00-00.wkb1y.mongodb.net:27017: [Errno 111] Connection refused How can I solve this?
Krydos Posted November 2, 2020 Posted November 2, 2020 The port 27017 is blocked in the firewall, but it can be opened for users who are not violating our terms of service. Our systems detected that you might have more than one account. We understand that no one ever reads our terms, but as a reminder, our Terms of Service state that each user is allowed to have only one account. The reason we have to enforce this rule is because our servers are already overloaded the way it is, and it wouldn't be fair to everyone that is turned away each day for you to have more than one when so many others have none. One common reason people create more than one account is to get around our storage limit of 1000 MB. Did you know that we will give you another 1000 MB of storage for each $5 USD donation you make up to 5000 MB total? If you'd like to increase the storage of your account just make a donation and then let us know your transaction ID and username. Another common reason people create more than one account is to host more than one website. Did you know that you can host as many websites on your one account as you want? Unlike a lot of free hosts we offer unlimited alias domains, unlimited addon domains, and unlimited subdomains. If you need any help adding another website to your account just let us know. Another common reason people create more than one account is to try out several servers at once, or to transfer a website between accounts on different servers. Did you know that an admin can move your account for you for as little as a $1 USD donation? This will save you the trouble of signing up again, and deleting your account, etc. Sometimes our systems flags you as possibly having more than one account when you share a computer with family, friends, coworkers, other students, etc. If this is your situation we apologize for the suspension, and we'll be happy to unsuspend all of the involved accounts after you provide proof that each of the accounts belong to a different person. Please delete all accounts in excess of 1. Let us know when that is done and we can see about opening a port in the firewall for you. 1
mahbd Posted November 2, 2020 Author Posted November 2, 2020 I'm extremely sorry for my unawareness. I was just exploring and created two accounts. Now, I read Terms of services and deleted my second account.Again I apologize for my mistake. Can you please unblock it for me again.
Krydos Posted November 2, 2020 Posted November 2, 2020 Thanks for deleting the extra account. Port 27017 to the ip 34.202.76.163 has been opened in the Johnny firewall. Let us know if there is anything else we can help you with. 1
mahbd Posted November 2, 2020 Author Posted November 2, 2020 Thanks a lot for your fast response. Now it is working
mahbd Posted November 2, 2020 Author Posted November 2, 2020 After removing block this message was coming. No replica set members match selector "Primary()" I thought this is my configuration problem. So, I tried all possible solution. But none of them worked. At last I came to this post. https://stackoverflow.com/questions/40765581/pymongo-read-preferences-serverselectiontimeouterror-no-primary-available-for .According to the post replica set members uses its internal IP's. So, I guess unblocking only "34.202.76.163" causing this problem. Will you take a look.Thanks in advance.
mahbd Posted November 2, 2020 Author Posted November 2, 2020 I need these three IP addresses 34.202.76.163:27017 ----> Already added52.44.84.178:2701723.23.60.54:27017
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now