Different apps same database using meteor up?


#1

I have deployed two apps using meteor up : telescope and main app. Meteor up created two different databases for these apps. How can I change it to use only one?

Thanks.


Easy way to deploy two meteor apps running on the same database, with oplog?
#2

In your mup.json there is

"env":{
  "MONGO_URL":"mongodb://user:pass@uri:port/database",
  "MONGO_OPLOG_URL":"...",
  "ROOT_URL": "...",
  "PORT":80,
  "MAIL_URL":"..."
}

Just make sure that your MONGO_URL is the exact same in both mup.json files and you should be good to go.


#3

I tried but It didn’t work.


#4

@arunoda : Can you help, please? Thank you!


#5

If you asked to create a DB via mup. Then there is db running on localhost.
So, use “mongodb://localhost/some-common-db-name” as the MONGO_URL

If this is mupx, use “mongodb://mongodb/some-common-db-name”


#6

Thanks @arunoda , I set up the env for subdomain as

“env”: {
“PORT”: 8000,
“ROOT_URL”: “http://sub.mymaindomain.com”,
“MONGO_URL”: “mongodb://mongodb/main”
}

It still creates a different database with the appname.


Install meteor on remote server
#7

and if I set “setupMongo”: false,

I get Error: failed to connect to [mongodb:27017]
in logs


#8

Can anyone please point out what am I doing wrong? Thanks.


#9

As arunoda have mentioned, set “mongodb://localhost” : "MONGO_URL": "mongodb://localhost/main". Worked for me :slight_smile: