zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
1.02k stars 1.03k forks source link

Single pool with multiple NOMP servers #578

Open mabbas1975 opened 6 years ago

mabbas1975 commented 6 years ago

I am wondering if it possible to run single pool in multiple NOMP servers, and if it possible to share the same MPOS database between multiple NOMP servers

devnull-ed commented 6 years ago

It is possible. Just spawn multiple nodes and connect to the same database.

mooleshacat commented 4 years ago

To add to this idea, use NGINX reverse proxy to load balance to all your servers:

#
# POOL SERVER
#
upstream pool-http-server {
        server 10.1.96.1:8080 weight=3; # POOLNODE 1
        server 10.1.96.2:8080 weight=1; # POOLNODE 2
        server 10.1.96.3:8080 weight=1; # POOLNODE 3
}
server {    

        server_name pool.steaknode.easyx.cc; # managed by Certbot

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Ssl on;

        location / {

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;

                proxy_pass http://pool-http-server;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";

        }

    listen 8079;
        listen [::]:8079;

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot

    ssl_certificate /etc/letsencrypt/live/steaknode.easyx.cc/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/steaknode.easyx.cc/privkey.pem; # managed by Certbot

    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

That way the load can be balanced for the HTTP server.

Then you just have to tell people what the second and third stratum addresses are.