chaeplin
Well-known member
use following guide to setup one local(cold) - remote(nothing) MN.
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-1-3.240/
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-2-3.241/
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-3-3.262/
Current local - remote setup is 1 local/multiple wallet + multiple NM/multiple instance.
With multiple NM in 1 instance, local - remote setup can be 1 local/multiple wallet + multiple NM/1 instance.
* This guide use ec2 one m3.medium for nothing
+ 5 private ip
+ 5 el ip(restiction : max 5 el ip per region) :
+ 5 user account
+ each user run darkcoind(bind + rpcport + externalip)
* on instance setup, if public ip is assigned automatically, no of public ip can be 6.
1 public ip + 5 el ip. So add 1 more private ip, 1 more user, 1 more port...
* iptables connlimit works well with -d ;D
* iptables "-j REJECT --reject-with tcp-reset" changed to "-j DROP"
Diffrence from one local(cold) - remote(nothing)
1) on EC2 concole
* Step 7: Review Instance Launch
--> Edit instance details ---> select subnet --> Network interfaces --> add ip ( 4 more ) --> launch
* elastic IP --> Allocate New Address --> Max 5 ---> Associate to VM interface ip --> 1:1 mapping.
2) on ec2 instance
* add 5 user
* add ip alias
/etc/rc.local
* add ip tables rule
* if you want to check POSTROUTING, add port 80 rule.
* curl http://ipecho.net/plain && echo
* testing outgoing ip
* at each user :
/etc/sysctl.conf
* darkcoin.conf difference
* user nm01
* user nm02
* user nm03
* nms04
* nm05
This is my sample server pstree
nm01@sv2:~> pstree -u
systemd─┬─agetty
├─cron
├─darkcoind(user)───33*[{darkcoind}]
├─darkcoind(nm01)───28*[{darkcoind}]
├─darkcoind(nm02)───28*[{darkcoind}]
├─darkcoind(nm03)───28*[{darkcoind}]
├─darkcoind(nm04)───28*[{darkcoind}]
├─darkcoind(nm05)───28*[{darkcoind}]
* cpu usage of instance.
I am testing multiple setup with single instance.
https://darkcointalk.org/threads/ec2-multiple-remote-nothing-nm-max-5.1660/
m3.medium and t2.medium. each instance has five RC darkcoind running.
I think t2.medium is good choice for multiple NM with single instance.
m3.medium
t2.medium
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-1-3.240/
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-2-3.241/
https://www.darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-3-3.262/
Current local - remote setup is 1 local/multiple wallet + multiple NM/multiple instance.
With multiple NM in 1 instance, local - remote setup can be 1 local/multiple wallet + multiple NM/1 instance.
* This guide use ec2 one m3.medium for nothing
+ 5 private ip
+ 5 el ip(restiction : max 5 el ip per region) :
+ 5 user account
+ each user run darkcoind(bind + rpcport + externalip)
* on instance setup, if public ip is assigned automatically, no of public ip can be 6.
1 public ip + 5 el ip. So add 1 more private ip, 1 more user, 1 more port...
* iptables connlimit works well with -d ;D
* iptables "-j REJECT --reject-with tcp-reset" changed to "-j DROP"
Diffrence from one local(cold) - remote(nothing)
1) on EC2 concole
* Step 7: Review Instance Launch
--> Edit instance details ---> select subnet --> Network interfaces --> add ip ( 4 more ) --> launch
* elastic IP --> Allocate New Address --> Max 5 ---> Associate to VM interface ip --> 1:1 mapping.
2) on ec2 instance
* add 5 user
Code:
useradd -m nm01
useradd -m nm02
useradd -m nm03
useradd -m nm04
useradd -m nm05
Code:
passwd -l nm01
passwd -l nm02
passwd -l nm03
passwd -l nm04
passwd -l nm05
* add ip alias
/etc/rc.local
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#
/sbin/ifconfig eth0:1 172.31.13.142 netmask 255.255.240.0 up
/sbin/ifconfig eth0:2 172.31.13.143 netmask 255.255.240.0 up
/sbin/ifconfig eth0:3 172.31.13.144 netmask 255.255.240.0 up
/sbin/ifconfig eth0:4 172.31.13.145 netmask 255.255.240.0 up
#
/sbin/iptables-restore < /etc/iptables
#
exit 0
Code:
/et/rc.local
* add ip tables rule
* if you want to check POSTROUTING, add port 80 rule.
* curl http://ipecho.net/plain && echo
Code:
#----------
*nat
:PREROUTING ACCEPT [329861:16309264]
:POSTROUTING ACCEPT [785521:53005289]
:OUTPUT ACCEPT [785521:53005289]
#
-A POSTROUTING -m owner --uid-owner nm01 -p tcp --dport 9999 -j SNAT --to-source 172.31.13.72
-A POSTROUTING -m owner --uid-owner nm02 -p tcp --dport 9999 -j SNAT --to-source 172.31.13.145
-A POSTROUTING -m owner --uid-owner nm03 -p tcp --dport 9999 -j SNAT --to-source 172.31.13.144
-A POSTROUTING -m owner --uid-owner nm04 -p tcp --dport 9999 -j SNAT --to-source 172.31.13.143
-A POSTROUTING -m owner --uid-owner nm05 -p tcp --dport 9999 -j SNAT --to-source 172.31.13.142
#
-A POSTROUTING -m owner --uid-owner nm01 -p tcp --dport 19999 -j SNAT --to-source 172.31.13.72
-A POSTROUTING -m owner --uid-owner nm02 -p tcp --dport 19999 -j SNAT --to-source 172.31.13.145
-A POSTROUTING -m owner --uid-owner nm03 -p tcp --dport 19999 -j SNAT --to-source 172.31.13.144
-A POSTROUTING -m owner --uid-owner nm04 -p tcp --dport 19999 -j SNAT --to-source 172.31.13.143
-A POSTROUTING -m owner --uid-owner nm05 -p tcp --dport 19999 -j SNAT --to-source 172.31.13.142
#
-A POSTROUTING -m owner --uid-owner nm01 -p tcp --dport 80 -j SNAT --to-source 172.31.13.72
-A POSTROUTING -m owner --uid-owner nm02 -p tcp --dport 80 -j SNAT --to-source 172.31.13.145
-A POSTROUTING -m owner --uid-owner nm03 -p tcp --dport 80 -j SNAT --to-source 172.31.13.144
-A POSTROUTING -m owner --uid-owner nm04 -p tcp --dport 80 -j SNAT --to-source 172.31.13.143
-A POSTROUTING -m owner --uid-owner nm05 -p tcp --dport 80 -j SNAT --to-source 172.31.13.142
#
COMMIT
# Completed on Tue Apr 5 16:44:54 2011
# Generated by iptables-save v1.4.8 on Mon Oct 17 18:30:57 2011
*filter
:INPUT ACCEPT [1038:145425]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [434:87191]
#
-A INPUT -i lo -j ACCEPT
#
-A INPUT -p tcp -m tcp --dport 9998 -j REJECT --reject-with tcp-reset
-A INPUT -p tcp -m tcp --dport 9997 -j REJECT --reject-with tcp-reset
-A INPUT -p tcp -m tcp --dport 9996 -j REJECT --reject-with tcp-reset
-A INPUT -p tcp -m tcp --dport 9995 -j REJECT --reject-with tcp-reset
-A INPUT -p tcp -m tcp --dport 9994 -j REJECT --reject-with tcp-reset
#
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.72 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.72 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.145 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.145 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.144 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.144 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.143 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.143 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.142 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp -d 172.31.13.142 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
#
-A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 9999 -j ACCEPT
-A INPUT -p tcp -j ACCEPT
#
-A OUTPUT -o lo -j ACCEPT
#
-A OUTPUT -p tcp -m tcp --sport 9999 -m conntrack --ctstate NEW -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 9999 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 9999 -j ACCEPT
-A OUTPUT -j ACCEPT
COMMIT
#-----
Code:
/sbin/iptables-restore < /etc/iptables
* testing outgoing ip
* at each user :
Code:
curl ipecho.net/plain ; echo
/etc/sysctl.conf
Code:
#
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_syncookies=1
net.ipv4.conf.all.accept_redirects=0
net.ipv6.conf.all.accept_redirects=0
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.all.accept_source_route=0
net.ipv6.conf.all.accept_source_route=0
net.ipv4.conf.all.log_martians=1
net.core.rmem_default=33554432
net.core.wmem_default=33554432
net.core.rmem_max=33554432
net.core.wmem_max=33554432
net.core.optmem_max=33554432
net.ipv4.tcp_rmem=10240 87380 33554432
net.ipv4.tcp_wmem=10240 87380 33554432
net.ipv4.ip_local_port_range=2000 65500
net.core.netdev_max_backlog=100000
net.ipv4.tcp_max_syn_backlog=80000
net.ipv4.tcp_max_tw_buckets=2000000
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_fin_timeout=5
net.ipv4.tcp_slow_start_after_idle=0
net.core.somaxconn=20480
fs.file-max=1000000
vm.swappiness=10
vm.min_free_kbytes=1048576
#
Code:
sysctl -p
* darkcoin.conf difference
* user nm01
Code:
externalip=x.x.9.246
bind=172.31.13.72
rpcport=9998
discover=0
* user nm02
Code:
externalip=x.x.6.15
bind=172.31.13.145
rpcport=9997
discover=0
* user nm03
Code:
externalip=x.x.12.226
bind=172.31.13.144
rpcport=9996
discover=0
* nms04
Code:
externalip=x.x.14.230
bind=172.31.13.143
rpcport=9995
discover=0
* nm05
Code:
externalip=x.x.16.165
bind=172.31.13.142
rpcport=9994
discover=0
This is my sample server pstree
nm01@sv2:~> pstree -u
systemd─┬─agetty
├─cron
├─darkcoind(user)───33*[{darkcoind}]
├─darkcoind(nm01)───28*[{darkcoind}]
├─darkcoind(nm02)───28*[{darkcoind}]
├─darkcoind(nm03)───28*[{darkcoind}]
├─darkcoind(nm04)───28*[{darkcoind}]
├─darkcoind(nm05)───28*[{darkcoind}]
* cpu usage of instance.
I am testing multiple setup with single instance.
https://darkcointalk.org/threads/ec2-multiple-remote-nothing-nm-max-5.1660/
m3.medium and t2.medium. each instance has five RC darkcoind running.
I think t2.medium is good choice for multiple NM with single instance.
m3.medium
t2.medium
Last edited by a moderator: