O
O
Otnode
Search…
Incremental Backup
For those who are running multiple nodes, you can automate the process of installing and managing your nodes through utilizing ansible. This section was brought to you by Calvin (@calr0x) and you can find the latest version of his work and tools on his github here: https://github.com/calr0x. Should you have any questions, feel free to join the dedicated group for advanced node runners at https://t.me/otnodes
First you need a “Control” Server to manage your nodes. You can use your own Windows box, one of your nodes or a Storage VPS you use to store your backups on.
Own Windows server
If you use Windows 10, you can download a Virtual Machine software from Oracle
Once you download it, you need the Ubuntu 20.04 (or whatever is latest) distribution at: https://ubuntu.com/download/desktop
Setup a New Virtual Machine with 2 GB Ram and 10 GB HDD space
New VM Setup
Virtual drive selection
Once the image is setup, right click, settings, general, advanced, select bidirectional for shared clipboard and Drag n drop
Then go to display tab, screen, max out video memory to 128mb
Then Settings -> Storage -> Controller: IDE -> Empty and load the Ubuntu ISO container you downloaded through clicking on the blue disk and selecting “Choose a disk file” and click ok.
Then click the green arrow Start, and click start on the popup.
Then choose Install Ubuntu:
Then choose between normal or minimal installation
Then click Install Now
Then fill details about location and login and finish the installation.
Once the desktop loads, right click on it and choose Open in Terminal
Then follow the commands as you would do on a VPS. If your clipboard is not working, you need to run these three commands first, type them inside the terminal window
1
sudo -iCopy
Copied!
enter your password to confirm, so you can switch to root
1
apt-get updateCopy
Copied!
1
apt-get install virtualbox-guest-x11Copy
Copied!
1
VBoxClient --clipboardCopy
Copied!
Install Ansible
1
sudo apt update -y && sudo apt upgrade -yCopy
Copied!
1
apt-get install git -yCopy
Copied!
Then you need to install Ansible and the relevant tools we will use. These are developed by Calvin (@calr0x) and you can find the latest version of his work and tools on his github here: https://github.com/calr0x
1
apt update && apt install ansibleCopy
Copied!
1
git clone https://github.com/calr0x/OT-Ansible-Files-and-Playbooks.gitCopy
Copied!
If you use SSH to authenticate with your nodes, you need to upload the SSH private key and public key to the control machine (either virtual or VPS). You do that by the following:
From the root directory:
1
cd .ssh/Copy
Copied!
1
nano id_rsaCopy
Copied!
Paste the private key of your SSH, then CTRL + S (to save) and CTRL + X (to exit nano)
1
chmod 700 id_rsaCopy
Copied!
1
nano id_rsa.pubCopy
Copied!
Paste the SSH Public key inside, then CTRL + S (to save) and CTRL + X (to exit nano)
1
cd ..Copy
Copied!
1
nano /etc/ansible/ansible.cfgCopy
Copied!
remove the # in front of host_key_checking = False so it looks like the below, then CTRL + S (to save) and CTRL + X (to exit nano)
Setting up the configuration file with all the nodes
1
cd OT-Ansible-Files-and-PlaybooksCopy
Copied!
1
nano config-otnodes-and-cosmic.ymlCopy
Copied!
File for managing exiting nodes:
Important: Spaces are very important when setting up the configuration file. otnodes: has no spaces in front, hosts: has 2 spaces, the IP below it 4 spaces, the node_name: has 6 spaces. Add as many nodes as you want to manage.
1
otnodes:
2
hosts:
3
xxx.xxx.xxx.xx:
4
node_name: 'XXX'
5
6
xxx.xxx.xxx.xx:
7
node_name: 'XXX'
8
Copy
Copied!
OT Node Watch
This script will monitor if your nodes are bidding every XX minutes (set at 15 by default) and will notify you if a node is not bidding. This would mean the node might have run out of space, or has hanged, and would need a restart
1
git clone https://github.com/calr0x/OT-NodeWatch.gitCopy
Copied!
Generate Telegram Bot token
Send a message to
1
@BotfatherCopy
Copied!
with the message
1
/newbotCopy
Copied!
and choose a name for your bot and you will obtain the token. Then you can choose to either get messages as pms from your bot, or you can add it to a group and get the messages in the group. If you choose PMs, message the following bot:
1
@myidbotCopy
Copied!
and send him the following message and save the number you receive, which is your CHAT_ID
1
/getidCopy
Copied!
If you want to receive the messages in a group, add the above @myidbot in the group and type in the group:
1
/getgroupidCopy
Copied!
Once you have the bot token and chat id noted, from root enter:
1
cd OT-NodeWatch/Copy
Copied!
1
nano config.shCopy
Copied!
Enter these 2 values there and CTRL + S (to save) and CTRL + X (to exit nano)
1
cd ansibleCopy
Copied!
1
nano install-monitors.ymlCopy
Copied!
Could not load image
Change the bidcheck_minute variable to your preference. If you want it to check every hour, set to bidcheck_minute: ‘0’, so you don’t get spam when there is downtime of jobs.
Running playbooks
Once your configuration is ready, you run the following commands form the root directory if you have an SSH with password:
1
ssh-agent bashCopy
Copied!
1
ssh-addCopy
Copied!
Type your password for your SSH
Then from root start:
1
ansible-playbook /root/OT-NodeWatch/ansible/install-monitors.ymlCopy
Copied!
Backups with SmoothBrain ansible playbook
1
git clone https://github.com/calr0x/OT-Smoothbrain-Backup.gitCopy
Copied!
Work in progress
Last modified 3mo ago
Copy link