Skip to content

Server configuration

altvnv edited this page Jun 29, 2018 · 3 revisions

Contents

Machine characheristics

We're using Ubuntu 16.04 xenial.

Processor: Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz
RAM: 128 GB
SSD: 220 GB
HDD: 2 TB

Back and its dependencies are stored on ssd, nodes are on hdd.

Installing dependencies

To download all of the code, clone the Multy-back, Multy-BTC-node-service and Multy-ETH-node-service repository

Install dependency manager (go)

curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

Install nsq:

git clone https://github.com/nsqio/nsq $GOPATH/src/github.com/nsqio/nsq
cd $GOPATH/src/github.com/nsqio/nsq
dep ensure

Then add your $GOPATH/bin to $PATH using export PATH="$PATH:$GOPATH/bin"

Install mongodb:

sudo apt-get install mongodb

Nginx configurations

We're using Nginx in proxing our 2 servers. On the first we've got Nodes + Node services. Another one is used just for running back.

Here're things you should add to your configs:

nginx.conf:

proxy_connect_timeout TIME;
proxy_connect_timeout TIME;   
proxy_send_timeout    TIME;   
proxy_read_timeout    TIME;   
send_timeout          TIME;
fastcgi_read_timeout  TIME;
keepalive_timeout     TIME;
client_header_timeout TIME;
client_body_timeout   TIME;

Your nodes config file:

    proxy_buffering off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header Host $http_host;

    location / {
        grpc_read_timeout TIME;
        grpc_pass grpc://localhost:PORT;

    }

Your proxying config file:

    location /socket.io {
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header Authorization $http_authorization;
        proxy_pass http://your_host_ip:ws_port;
   }

   location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Authorization $http_authorization;
        proxy_http_version 1.1;
        proxy_pass_request_headers on;
        proxy_set_header Connection "keep-alive";
	proxy_store off;
	proxy_pass http://your_host_ip:rest_port;
    }