LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Set up multiple server instances (https://www.linuxquestions.org/questions/linux-server-73/set-up-multiple-server-instances-4175471793/)

elememental 08-01-2013 07:46 PM

Set up multiple server instances
 
I am using Ubuntu server 12.04 and I want to run multiple instances of Stratum mining proxy and use HAProxy to distribute the load.

My main question is, how can I create multiple instances of the server software(Stratum mining proxy) on my machine?

Since this is my first time doing something like this, am I correct in assuming that: I simply have to create multiple instances of Stratum mining proxy with different ports on the same IP and then use HAProxy to distribute the load over those ports?

Thanks in advance!


EDIT: Just to be clear, its less about the actual software and more about how it is possible to run multiple instances of server software on one machine. This software could be anything (for example a Minecraft server).

unSpawn 08-03-2013 06:58 AM

Quote:

Originally Posted by elememental (Post 5001259)
EDIT: Just to be clear, its less about the actual software and more about how it is possible to run multiple instances of server software on one machine. This software could be anything (for example a Minecraft server).

In that case you would check what configuration changes (network ports, PID files, log / cache directories, etc, etc) and resources (CPU, RAM, storage) the process needs. Common services come with (example) configuration files to copy and edit, some only have command line args and some need none. In your case you'll read its documentation and run 'mining_proxy.py --help' to start with.

elememental 08-03-2013 07:28 AM

Quote:

Originally Posted by unSpawn (Post 5002148)
In that case you would check what configuration changes (network ports, PID files, log / cache directories, etc, etc) and resources (CPU, RAM, storage) the process needs. Common services come with (example) configuration files to copy and edit, some only have command line args and some need none. In your case you'll read its documentation and run 'mining_proxy.py --help' to start with.

I understand how to change the network ports, but how can I run multiple instances (Should I for example use Screen to create multiple sessions on which I could create one instance each?)
I'm sorry if this is a stupid question, I'm fairly new to Linux

unSpawn 08-03-2013 08:46 AM

Commonly daemons run in the background so executing the app with the right args should clear the terminal to run another one. So you would only use screen sessions for daemons that don't background themselves properly or processes that don't expect to be run in the background.

elememental 08-03-2013 09:12 AM

Quote:

Originally Posted by unSpawn (Post 5002200)
Commonly daemons run in the background so executing the app with the right args should clear the terminal to run another one. So you would only use screen sessions for daemons that don't background themselves properly or processes that don't expect to be run in the background.

Wow that cleared a lot! (looking back I should have probably posted this in the beginner section)
This particular software doesn't have a daemon option, so I guess I'll either have to code it or use screens!
Thanks a million! :)

unSpawn 08-03-2013 09:19 AM

Quote:

Originally Posted by elememental (Post 5002211)
This particular software doesn't have a daemon option, so I guess I'll either have to code it or use screens!

Kind of depends on if you can decipher the actual command it runs in the end (see with say 'ps axf' or 'pgrep -lf python' if it actually runs a Python process) and if that process doesn't require a terminal. If both conditions can be matched then you can try running the final command from the command line (always good wrt catching errors):
Code:

/path/to/application --whatever-args --you-need
then try to background it and see if it still runs (ps / pgrep):
Code:

/path/to/application --whatever-args --you-need &


All times are GMT -5. The time now is 06:14 AM.