Replica Sets with MongoVUE - mongodb

I want to get MongoVUE set up to work with replica sets. I have followed the instructions found in the link below at step 2(b).
http://www.mongovue.com/2012/03/26/establishing-connections-to-servers-and-replica-sets-using-mongovue/
However all I get is "Connection Refused"
See image: http://snag.gy/PqXmQ.jpg
All instances are running - as windows services if that helps - and as you can see from the image they are all part of a replica set. The notepad at the bottom shows the full text string I have used for the server.
Thanks,
Matt

Short answer: Use IP addresses...
I'm just looking back at issues I've had in the past. This looks like it was resolved quite simply by using IP addresses instead of host names.
HTH

Related

Cannot connect to MongoDB Atlas Cluster: DNSHostNotFound

I created a new cluster in MongoDB Atlas but I can't connect to it thru the mongo shell.
C:\git_symphony\esp8266\SymphonySocket>mongo "mongodb+srv://<clustername>-gy7bf.azure.mongodb.net/test" --username <USERNAME>
DNSHostNotFound: Failed to look up service "":No records found for given DNS query.
try 'mongo --help' for more information
I tried switching regions but it didn't work. I've also tried using Compass on my mac but it just loads indefinitely when I try to connect. What could possibly be wrong?
Turns out, my ISP blocks all connections to MongoDB for some reason. I haven't contacted them yet, but I find this very silly as I racked my brains out trying to solve this when the problem wasn't at all in my control.
I also had this problem with Comcast Xfinity. DHCP sets DNS servers that would not lookup the mongodb connections. I'm running KDE Neon Linux (Ubuntu 18.04). In order to get things working I had to supersede the domain-name-servers supplied through comcast. I used Google's public DNS, but there are others that can be used. I had to edit (you'll need root permissions) the /etc/dhcp/dhclient.conf file, and added to following line:
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
I hope this helps somebody, took me too long to figure it out. :-)
I just found this post by M. Brandao with the fix for Windows users:
Open the Control Panel.
Click View network status and tasks
Click Change adapter settings on the left portion of the window.
Double-click the icon for the Internet connection you're using.
Click the Properties button.
Click and highlight Internet Protocol Version 4 (TCP/IPv4) and click
Properties.
If not already selected, select the Use the following DNS server
addresses option.
Enter the new DNS addresses (see above) and click OK and close out of all otherwindows.
Have you whitelisted your IP address ? IP whitelisting is important otherwise it will not connect.
Have you created this cluster recently and is it in the europe region ?
Is the cluster properly deployed or you are experiencing any issue in the deployment of the cluster ?

Whatsapp Business API production setup not working

I am trying to configure or setup the production environment of whatsapp business api as mentioned in the link https://developers.facebook.com/docs/whatsapp/installation/prod-single-instance
I have done everything mentioned in this my dockers are also running on port:9090 as can be seen in the image
still I can't access it. Whenever I try to call https://localhost:9090 the error with "This site can’t be reached" occurs. Whatsapp business api does not have good documentation or tutorials till now. So this site is the only last way for me.
I had a similar problem which could be your case, I saw the docker containers OK but nothing was working. After a day searching I saw where it happened, my problem was I installed mysql MANUALLY (not docker container) in the same instance where docker is running and in db.env I just used 127.0.0.1, this was passed literally to docker container, then looking at a the wait_on_mysql.sh script, the whastapp docker containers were waiting util the mysql ip has conectivity to actually do something and was printing "MySQL is not up yet - sleeping" each second, of course they wouldn't find any conectivity.
Since my instalation is for development, and I am already using such database to other stuff, my solution was to use the 172.17.0.1(docker gateway of the containers) IP instead, then add two sets of network iptables rules to the host to redirect from the docker containers IP to the IP binded by mysql when using such port (3306, the default in my case). After that everything works well. I think there are better solutions, but I didn't want to go far on it, you should evaluate you case if apply.
check the command:
docker-compose logs > debug_output.txt
That gives you insight about whats happening, hope it can helps someone.
I think your setup is already complete. You just need to start with the registration process and start sending messages. The containers are up and running but calling https://localhost:9090 won't send you any response as this is not any specified API endpoint expected to be used.
Since you're using prod single instance, the documentation can be found here which seems pretty straight forward. https://developers.facebook.com/docs/whatsapp/installation/prod-single-instance
You seem to have completed till the 7 steps. The next step can be to perform a health check to make sure it is healthy. The API endpoint for that would be https://localhost:9090/v1/health https://developers.facebook.com/docs/whatsapp/api/health
Has your db also been setup?
I cannot see it in the docker screenshot.
Also - you have to accept the certificate, as it does not have a public CA issues certificate.

How can I connect to MongoDB Atlas using Robomongo?

I signed up freely at MongoDB Atlas and created cluster now I want to know how can I create database and connect to that using Robomongo?
1) (Atlas Mongodb console)First of all click on ALLOW ACCESS FROM ANYWHERE(see in below image) and put some random IP address , don't click on Add Current IP Address otherwise it will not connect with robomongo .
2) Now open robomongo ,select connection Tab and then select type Direct Connection , and put your primary cluster in Address [you can get your Primary Cluster Address from Project->Clusters->(choose) Primary Cluster-> "There you will find your Primary Cluster Address"] .
3)now click on Authentication Tab , put database name is admin and put your username and password , Auth Mechanism is SCRAM-SHA-1.
4) select self-signed certificate as Authentication Method
5) Now , click on test,we are done !
The standard Mongo URI connection schema has the form:
mongodb://[username:password#]host1[:port1][,...hostN[:portN]]][/[database][?options]]
Security Reasons
Do not allow access everywhere for security reasons
Restrict to your IP address
Connect via roboMongo 3T using a secondary cluster node from MongoDB Atlas
In case it helps others, Robo3Tversion 1.3 and greater has a "From SRV" field where you can paste the SRV connection string and it fills out the connection options correctly for you. As of 1.3 it looks like this:
As of writing, you can get the connection string by clicking the "connect" button next to your cluster dashboard's graphs, and then clicking "Connect your application", and you get a screen like this with the connection string that you can copy:
#kdblue, It's not working for me. But when I tried using the replica set, I could able to connect successfully.
Robo 3T Version: 1.2.1
Steps followed:
In your MongoDB Atlas(cloud.mongodb.com), copy all the three replica sets name and note it down. (Refer an image for reference, the replica sets denoted in the orange box).
Now, in your Robo 3T, in Connection tab, select type as Replica Set.
Provide a suitable name for your connection.
And now in Members, add all the three copied replica sets. Refer image for details.
Provide authentication, if you have any and follow SSL steps (mandatory) as suggested by #kdblue in the previous answer.
You could able to connect successfully now.
Thank you.
[Updated]
It is now possible to connect to Mongo Atlas 3.4 free cluster with the latest beta: Robomongo 1.1 - Beta version with MongoDB 3.4 Support
Direct connections do not work with Replica Sets and Robo3T.
And the cluster you create on Atlas is a 3-Node replica set.
Select Connection Type: Replica Set on the first tab
To find out 3 members in new Atlas dashboard:
click on Clusters in your Atlas dashboard.
click collections button on the cluster.
click Overview tab on the next menu.
you will see the list of your set (primary and two secondary).
then follow #Balasubramani M's answer.
If you have the "TLS" instead of the "SSL" tab, don't get crazy.
Just do exactly the same that you would do with "SSL":
Mark the "Use TLS protocol" checkbox
Choose the "Self-signed Certificate" authentication method option
And that's all!
Instead of connecting it with robomongo I would recommend you to connect it with COMPASS. That is a opensource GUI tool for connecting to your MongoDB Atlas deployment and it is supported by MongoDB people also.
You can download compass from https://www.mongodb.com/download-center/compass.
Additionally many functionalities are not supported in robomongo.
Robo mongo is the 3rd party tool so even if you go the mongodb people they will not support.
Instruction for connecting your atlas cluster with compass can be found in the documentation https://docs.atlas.mongodb.com/compass-connection/
However, even after following my response you encounter any issue, let me know , I will help you further.
No matter what I tried it wouldn't work, all I had to end up doing was update to the latest version at which point my old connection setup worked fine.
https://robomongo.org/download
Tip: I struggled updating a connection, no dice.
Created one form scratch using above and connected on first attempt.

emails from localhost using mocksmtp

I have been trying to setup email on my local machine. After some advice that it is a rather involved thing to set up, I started to look around for a solution to my problem and came across an app called mocksmtp. I have followed this tutorial to set it up. But i'm getting errors.
of
send-mail: warning: valid_hostname: invalid character 64(decimal): my.email#address.com
send-mail: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: my.email#address.com
Looking at this page I believe the problem is with /etc/postfix/main.cf
myhostname = my.email#address.com
but what value should I change the email address to to make this work? I have tried a few option but nothing has worked for me and in that post the only problem was a period at the end.
The tutorial is a valid and helpful page and would have worked perfectly had telnet localhost 1025 been enabled. Enabling telnet got it working. To do this telnet localhost 1025 worked for me
Looks like you're trying to enter an entire email in a parameter meant only for a host name. You should only have address.com, not my.email#address.com. It's not for a full email. You're setting this up as a server, to catch everything for a host, not just one particular email.

What is the difference between colors of PostgreSQL?

I am trying to set up a local version of PostgreSQL for use with my Rails app on Heroku according to the instructions at https://devcenter.heroku.com/articles/heroku-postgresql#local-setup.
When I grep'd for different heroku configurations
(heroku config | grep HEROKU_POSTGRESQL)
I got the following return:
HEROKU_POSTGRESQL_AQUA_URL: postgres://mzqgqmkhlsgufo:Hk-Nu5SF6amY9mgl2n6u-Yi6U-#ec2-54-243-228-246.compute-1.amazonaws.com:5432/d8jndm2sub3lbt
HEROKU_POSTGRESQL_VIOLET_URL: postgres://nviwubpznhhgkv:siEYPLdOknBWOj1K3HePMn21DS#ec2-54-243-188-54.compute-1.amazonaws.com:5482/ddr1fm1ou7ha9s
Do the different colors have any significance? Would I be better served using one over the other or are they just random colors? Sorry if this is a silly question, but I wasn't about to find a question addressing this.
Without digging into it very much, I think the main difference for you would be the port they listen on. Aqua listens on the PostgreSQL default port of 5432; violet on 5482. They seem to have different IP addresses, too, which might or might not affect you. (I don't recall off the top of my head how apps connect to Heroku.)
If you're installing locally, and you've never installed PostgreSQL before, it will probably listen on the default port, 5432.
The color names don't mean anything to PostgreSQL. That just seems to be a naming convention Heroku uses in managing their services.
Short Answer:
They are random colors.
You only get these colors when you have more than one database added onto your application.
Quoting Heroku:
As part of the provisioning process,a DATABASE_URL config var is added
to your app’s configuration. This contains the URL your app uses to
access the database. If your app already has a Heroku Postgres
database and you’ve just provisioned another one,this config var’s
name instead has the format HEROKU_POSTGRESQL__URL (for
example,HEROKU_POSTGRESQL_YELLOW_URL).
SOURCE:
https://devcenter.heroku.com/articles/heroku-postgresql