참고
- https://eosio.stackexchange.com/questions/345/how-to-configure-block-producer-to-have-front-end-and-back-end-cluster-nodes
A 서버 -------------------------------------- B 서버 |
$ sudo apt update && sudo apt install tinc
$ sudo mkdir -p /etc/tinc/sample/hosts
$ sudo vim /etc/tinc/sample/tinc.conf
-- A 서버
-------------------------
Name = tinc_a Device = /dev/net/tun AddressFamily = ipv4 Interface = tun0 -------------------------
-- B 서버
Name = tinc_b Device = /dev/net/tun AddressFamily = ipv4 Interface = tun0-------------------------ConnectTo = tinc_a-------------------------
-- A 서버
$ sudo vim /etc/tinc/sample/hosts/tinc_a
------------------------- Address = 172.17.0.2 Subnet = 100.100.100.100 -------------------------
-- B 서버 $ sudo vim /etc/tinc/sample/hosts/tinc_b ------------------------- Address = 172.17.0.3 Subnet = 100.100.100.200 -------------------------
$ sudo tincd -n sample -K 4096
-- A 서버
$ sudo vim /etc/tinc/sample/tinc-up-------------------------#!/bin/sh ip link set $INTERFACE up ip addr add 100.100.100.100 dev $INTERFACE ip route add 100.100.100.0/24 dev $INTERFACE-------------------------$ sudo vim /etc/tinc/sample/tinc-down-------------------------#!/bin/sh ip route del 100.100.100.0/24 dev $INTERFACE ip addr del 100.100.100.100 dev $INTERFACE ip link set $INTERFACE down--------------------------- B 서버$ sudo vim /etc/tinc/sample/tinc-up-------------------------#!/bin/sh ip link set $INTERFACE up ip addr add 100.100.100.200 dev $INTERFACE ip route add 100.100.100.0/24 dev $INTERFACE-------------------------$ sudo vim /etc/tinc/sample/tinc-down-------------------------#!/bin/sh ip route del 100.100.100.0/24 dev $INTERFACE ip addr del 100.100.100.200 dev $INTERFACE ip link set $INTERFACE down-------------------------
$ sudo chmod -v +x /etc/tinc/sample/tinc-{up,down}
$ sudo vim /etc/systemd/system/tinc.service ------------------------- [Unit] Description=Tinc net sample After=network.target [Service] Type=simple WorkingDirectory=/etc/tinc/sample ExecStart=/sbin/tincd -n sample -D -d3 ExecReload=/sbin/tincd -n sample -kHUP TimeoutStopSec=5 Restart=always RestartSec=60 [Install] WantedBy=multi-user.target -------------------------
$ sudo systemctl enable tinc.service
$ sudo systemctl status tinc.service
-- A 서버
$ scp /etc/tinc/sample/hosts/tinc_a user@172.17.0.2:/tmp/ $ ssh -t user@172.17.0.2 sudo mv -v /tmp/tinc_a /etc/tinc/sample/hosts/
-- B 서버
$ scp /etc/tinc/sample/hosts/tinc_b user@172.17.0.3:/tmp/
$ ssh -t user@172.17.0.3 sudo mv -v /tmp/tinc_b /etc/tinc/sample/hosts/
-- A 서버 & B 서버
$ sudo tincd -n sample -D -d3
$ sudo ip a
$ ping 100.100.100.***
$ mkdir -p ~/eosio && cd ~/eosio $ git clone --recursive https://github.com/EOSIO/eos
$ cd ~/eosio/eos
$ git submodule update --init --recursive
$ sudo mkdir -p /home/eosio
$ sudo chown ${USER}:${USER} /home/eosio
$ cd ~/eosio/eos $ ./scripts/eosio_build.sh -i /home/eosio/eos/2.0
$ cd ~/eosio/eos $ sudo ./scripts/eosio_install.sh
$ cd ~/eosio/eos $ sudo ./scripts/eosio_uninstall.sh
$ cd ~/eosio/eos/build $ make test