ctubio / tribeca

Self-hosted crypto trading bot (automated high frequency market making) in node.js, angular, typescript and c++
https://127.0.0.1:3000
Other
95 stars 26 forks source link

How to run multiple tribeca on one computer ? #40

Closed Camille92 closed 7 years ago

Camille92 commented 7 years ago

Just a technical question,

I run all my tribecas each on small ec2 instances. I think it can be good to have them on the same one but I don't know how to manage that with mongo and the ports that need to be opened.

ctubio commented 7 years ago

Hello Camille¡'

to run the app concurrently multiple times in the same computer:

hope it helps'¡

Camille92 commented 7 years ago

Thanks!

Camille92 commented 7 years ago

I tried to do it using docker, but so far I can't get it running.

In the second dockerfile I just need to change a bit the last world of MongoDbUrl and the web client port. But do I need to run a new Mongo service or use 1 mongo for 2 tribeca ? But then I need to change that right ? ''' docker run -p 3000:3000 --link tribeca-mongo:mongo --name tribeca -d tribeca '''

ctubio commented 7 years ago

Hello Camille, only 1 mongodb server in localhost can store multiple tribeca databases by giving to the databases diferent names.

The database name is defined as the last word of the MongoDbUrl value.

The docker run line, is not setting up any database name, it is setting up docker containers linked together, and the containers happens to have the name "tribeca" and "tribeca-mongo"; do not confuse these container names in docker run line with the MongoDbUrl database name.

So, having multiple tribecas with different MongoDbUrl values, if these are containers, you need also to give to these containers different names, lets say an example could be:

App¡ 1:

App¡ 2:

Or you can make App 2 also like:

that is, for reuse the mongo server/container and just create separated database for each app (recommeneded instead of multiple redundant mongo servers/containers)

If you have the apps in containers, all them can have the same WebClientListenPort.

Hope this helps'¡

ctubio commented 7 years ago

new simplified how to at https://github.com/ctubio/tribeca#multiple-instances-party-time