How run multiple meteor servers on different ports
Asked Answered
A

4

19

How can meteor run on multiple ports.For example if the meteor run on 3000 i need another meteor app run on the same terminal.Please help me.

Almanza answered 30/10, 2014 at 7:11 Comment(0)
H
43

You can use the --port parameter:

`meteor run --port 3030`

To learn more about command line parameters, run meteor help <command>, e.g. meteor help run.

I see you've tagged your question . If you're actually using mup, check out the env parameter in the config file.

Hove answered 30/10, 2014 at 7:18 Comment(6)
related question: Is it possible to run same app(two instances) in different ports? I tried to run same app in 3000 and 5000 ports and second one is showing errors related to mongodbQuadrivalent
It's definitely possible; I have several apps that run on my website. Your app instances probably conflict while use the same database though - hence the Mongo errors.Hove
getting this error "Exception in callback of async function: Error: connection closed" @Dan DascalescuAlmanza
How can we run the several apps on the same server please give me example.we are running single app at time.please help me @dan-dascalescuAlmanza
That is a different question; see this and this.Hove
Is there a way to do this with the settings.json file?Subito
C
1

I think the OP was referring to the exceptions caused because of locks on the mongo db. I am only on this platform for last week - and am learning as quick as I can. But when I tried running my application from the same project directory as two different users on two different ports - I got an exception about MongoDB :

Error: EBUSY, unlink 'D:\test\.meteor\local\db\mongod.lock'

The root of the issue isn't running on different ports - it is the shared files between the two instances - Specifically the database.

I don't think any of your answers actually helped him out. And .. neither can I yet.

I see two options -

First -

I am going to experiment with links to see if I can get the two users to use a different folder for the .meteor\local tree ... so both of us can work on the same code at the same time - but not impact each other when testing.

But I doubt if that is what the OP was referring to either (different users same app)...

Second - is trying to identify if I can inject into the run-mongo.js some concept of the URL / port number I am running on, so the mongodb.lock (and db of course) ... are named something like mongodb.lock-3000

I don't like the 2nd option because then I am on my own version of standard scripts.

B

Contrabassoon answered 3/12, 2015 at 17:40 Comment(1)
This doesn't answer the question, it's more appropriate as a few comments.Rhetor
C
0

No, it is mainly used the default port of 3000 or any state at the start, and the following (+1) to Mongo.
That is, the following application can be run through a 2-port, already in 3002, hence the previous 2-port as before - it is 2998.

Check can be very simple (Mac, Linux):

ps|grep meteor
Contour answered 9/9, 2015 at 9:19 Comment(1)
Lord, that distribute cons, please unsubscribe in the comments, what's wrong?Contour
E
0

Just use different db instance (set METEOR_LOCAL_DIR)

 "devOne": "export METEOR_LOCAL_DIR=.meteor/local/db2 && meteor --settings settings1.json --port 3000",
 "devTwo": "meteor --settings settings2.json --port 4000"
Expunction answered 11/8, 2023 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.