Need help connecting mongodb replica set

adarshmishra07
PRO

7 months ago

Hey i had created a project with mongodb - but seems like it requires a replica set.

So i started fresh created a new project and used the template for creating the replica set.

How do i now connect this replica set to my primary mongodb instance?

Solved

0 Replies

adarshmishra07
PRO

7 months ago

6a1c0558-f3b6-48a5-8e82-0385da7fbc2b


7 months ago

the same way you connect to a single instance, just use the first node


adarshmishra07
PRO

7 months ago

i am not able to it doesn't have a public URL


adarshmishra07
PRO

7 months ago

and if i try to connect with compass even with direct connection enabled it only gives me read access


7 months ago

it does have a public url though


adarshmishra07
PRO

7 months ago

1319719918291128300


adarshmishra07
PRO

7 months ago

Is it the public networking one ?


adarshmishra07
PRO

7 months ago

i generated it


7 months ago

the templates comes with a public url


adarshmishra07
PRO

7 months ago

i am not able to find it - i am really sorry acting dumb would really appreciate a bit of handholding here


7 months ago

1319720448463736800


7 months ago

that info icon means its public


adarshmishra07
PRO

7 months ago

it connects but again only read access to it


adarshmishra07
PRO

7 months ago

if you see there is not add or + sign in here

1319720682942365700


7 months ago

ill deploy and see what happens


adarshmishra07
PRO

7 months ago

if there's a way maybe we can connect and you can just check on my existing project ?


adarshmishra07
PRO

7 months ago

Normally on a mongodb servie there's a "data" tab as well but this one doesn't have it - am i supposed to connect it to a primary node(create another mongodb) ?


adarshmishra07
PRO

7 months ago

@Brody i think i found the issue - i wasn't connecting to the primary node it worked now will import data connect to the app and check


adarshmishra07
PRO

7 months ago

it worked
Thanks so much for your help ser :))
Really appreciate it

So

  1. Finding the right Primary node

  2. adding ?authSource=admin&replicaSet=rs0&retryWrites=true&w=majority&directConnection=true this to my conection string everything works fine


7 months ago

awsome!


7 months ago

!s


Status changed to Solved brody 7 months ago