2 Replies Latest reply on Jun 19, 2012 3:40 PM by Lars Burgess

    How to run several rhoconnect application instances in the same rhoconnect server

      We want to run several rhoconnect application instances in the same rhoconnect server. And we want to know if it is possible to run each instance listening on a different port number (9292, 9293, 9294, ...).

       

      For example, we could have the following situation: one company with a 3 sales departments (Portugal, Spain and France). All of them works in the same way but manage different data. We could have one rhoconnect server with 3 instances, each instance connected to webservices of each department. The mobile terminals can connect to the instance setting the servername and the associated port to the required department (syncserver property).

       

      This is the arquitecture that we want to implement. If it is not possible, what is the best rhoconnect arquitecture to implement our objective?

       

      Thanks,

      Oesia.

        • Re: How to run several rhoconnect application instances in the same rhoconnect server

          Short answer: you can run many instances of rhoconnect applications.

           

          For each application execute in app directory rackup command:

          $ rackup -p 9292 -s thin config.ru

          $ rackup -p 9293 -s thin config.ru

          ...

          You can also add more options like -D daemonize  option, and --pid FILE to monitor your app.

           

          But you need also 3 instances of redis servers (redis server per app) running on different ports, i.e 6379, 63780, ...

           

          -Alexander

            • Re: How to run several rhoconnect application instances in the same rhoconnect server

              Also make sure you have a separate redis instance (or redis db identifier) for each rhoconnect instance.  RhoConnect assumes full control of the redis database it uses, so multiple RhoConnect instances connecting to the same redis server will cause issues.

               

              The following are both correct examples of separate redis instances used by two RhoConnect servers:

               

               

              Using separate redis processes:

               

              rhoconnect 1:

              redis://localhost:6379

               

              rhoconnect 2:

              redis://localhost:6380

               

               

              Using separate redis databases (share same redis process):

               

              rhoconnect 1:

              redis://localhost:6379:0

               

              rhoconnect 2:

              redis://localhost:6379:1

              1 of 1 people found this helpful