How to: Setup an Azure account for a NEM Supernode

This guide will cover the basic setup of an Azure account, including signing up, the creation of a vps, and configuring the network. To create an Azure account you need: - email address - credit card (prepaid cards don't work, [read more](https://docs.microsoft.com/en-us/azure/billing/billing-credit-card-fails-during-azure-sign-up)) - phone number To follow this guide you will need to ([download](http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)) some additional software. - putty.exe for SSH connection - puttygen.exe to create keys for login - pageant.exe to load the created keys ## Key creation Before we start with Azure, let's create our login keys with puttygen.exe ![puttygen](http://imgur.com/u4XUr05.png) 1. Start puttygen.exe, choose RSA and 2048 bits from the bottom. 2. Click on "Generate" 3. Choose a "Key comment" (for example: name of your node) 4. Choose a "Key passphrase" and confirm it 5. Save the public key & private key files 6. Copy the content of the box on the top to a text file, we need this later 7. Close puttygen ## Signup Open the Azure sign up website [https://azure.microsoft.com/free](https://azure.microsoft.com/free) and click start. ![Start](http://imgur.com/3CacjIy.png) Choose "Create a new Microsoft Account" from the bottom of the page. ![sign up](http://imgur.com/OGwdMVW.png) Fill out all the fields, verify your identity, agree to the terms of services and sign up. ![details](http://imgur.com/448CdyE.png) ## Creating a VPS Once you have signed up, you can log into [https://portal.azure.com](https://portal.azure.com). ![dashboard](http://imgur.com/MEyRjvE.png) Go to "New", search for "Debian 8" and select it from the list. ![new](http://imgur.com/Lc8N0Sw.png) Choose "Debian 8 Jessie" and click create. ![debian 8](http://imgur.com/bfuuwGH.png) Fill in the basic information and create a new resource group. **For "Authentication type" choose "SSH public key" and paste in the key you have created with puttygen and saved in a text file. The VPS location is based in the same location as the resource group.** If you want to find out more about resource groups, you can read about it [here](https://www.petri.com/what-are-microsoft-azure-resource-groups). ![create vps](http://imgur.com/AVFa1tN.png) Go to "Size", select "View all" ![create vps](http://imgur.com/9z8FTdS.png) For this guide, we will choose an "A1 Basic" sized VPS. Basically, anything with at least 1 CPU Core and 1.5GB RAM will work. ![create vps](http://imgur.com/LTB4lbf.png) Go to "Settings", leave everything default besides "Public IP Adress". Monitoring is optional. ![create vps](http://imgur.com/Wn76MnS.png) **Click on "Public IP address" and change the assignment to "static". If you leave it to dynamic, the VPS will have a new IP after every shutdown from the Azure Dashboard** ![create vps](http://imgur.com/qKvkMsf.png) Check the "Summary" and click "OK" ![create vps](http://imgur.com/p6YJocL.png) The notification area will show the progress of the deployment. This can take from 5 to 15 minutes. ![create vps](http://imgur.com/96LXeZA.png) If the deployment succeeds, you will be notified. ![create vps](http://imgur.com/ytT9WMw.png) ## Configuring Network The VPS is now created, so let's move on to the network settings. From the left of the dashboard choose "All resources" and click on your "Network Security Group". In this case, the security group is called "Supernode". Choose "Inbound security rules" from the left. ![configuration](http://imgur.com/SXl7mPp.png) Click on "Add" and enter the name, priority, and port similar to the screenshot. ![configuration](http://imgur.com/XpZ0AGB.png) **You have to do this 3 times for NIS, servant, and Lightwallet.** Ports: - 7890 for NIS - 7880 for servant - 7778 for Lightwallet When you are done it should look like: ![configuration](http://imgur.com/Qck3QLY.png) ## Connect to VPS After setting up the network we will try to connect to our VPS. Go to "All resources" again and choose the network interface. **Write down the "Public IP address".** ![connect](http://imgur.com/16TzzE5.png) Start pageant.exe and open "View Keys" from the tray icon. ![pageant](http://imgur.com/4jqZs70.png) ![pageant](http://imgur.com/8XHDltu.png) Click on "Add Key" and select your saved private key (.ppk) you created earlier with puttygen. After the key is loaded, you can minimize pageant to the tray (but don't shut it down, it needs to run in the background). ![pageant](http://imgur.com/JQt950A.png) Start putty and navigate to "Connection - SSH - Auth". Browse for your private key file (.ppk) ![putty](http://imgur.com/ZQrckFo.png) Navigate to "Connection - Data" and input your username in the "Auto-login username" field. ![putty](http://imgur.com/5UXVfNE.png) Go to "Session" and enter your IP in the "Host Name" field. Save the session (optional) and click "Open". ![putty](http://imgur.com/TruvWHE.png) A console will open. Username and password is not needed, it will automatically load your username from putty and your key from pageant! ### Root access By default the user root is deactivated. To activate, log in as a standard user. Type the following in the console: ``` sudo su - ``` Set a root password with: ``` passwd ``` **After setting a password the root user is activated.** To login to your VPS you still need the standard user (with RSA-key login) but as soon as you are logged in, you can change to root with: ``` su ``` ## Install Supernode The VPS is now ready for installation. For the installation, we will use [Paul's guide (click here)](https://forum.nem.io/t/nem-supernode-command-line-tutorial-for-debian-8-4/2211), since it has covered everything. **There is 1 value which you have to change:** 1.3 from: ``` Java -Xms768M -Xmx768M ``` to: ``` Java -Xms1024M -Xmx1024M ``` Other than that you can follow the guide and your supernode will be set up correctly! *The NEM team would like to thank Patrick for this blog.*
2 Likes

German Translation:

Howto: Einrichtung eines Azure Kontos für einen NEM Supernode

Dieser Guide beschreibt die Basiskonfiguration eines Azure Kontos. Angefangen bei der Anmeldung über die Erstellung eines VPS bis zur Netzwerkkonfiguration.

Für die Azure Kontoeinrichtung wird folgendes benötigt:

  • E-Mail-Adresse
  • Kreditkarte (Prepaid-Karten funktionieren nicht, mehr infos dazu hier)
  • Telefonnummer

Um diesen Guide durchzuführen wird folgende Software benötigt (download)

  • putty.exe für SSH-Verbindungen
  • puttygen.exe um Loginschlüssel zu generieren
  • pageant.exe um generierte Schlüssel zu laden

Generierung eines Schlüssels

Bevor mit Azure gestartet wird, erstellen wir einen Login-Schlüssel mit puttygen.exe.
puttygen

    1. Starte puttygen.exe, wähle RSA und 2048 in der rechten unteren Ecke.
    1. Um den Schküssel zu generieren klicke auf “Generate”
    1. Wähle einen Kommentar bei “Key comment” (zum Beispiel: Der Name deiner Node)
    1. Wähle ein Passwort bei “Key passphrase” und bestätige es
    1. Um den öffentlichen und privaten Schlüssel zu speichern, dürcke auf “Save the public key” & “save private key”
    1. Kopiere den Inhalt des oberen Textfelds in eine Textdatei, dieser wird zu einem späteren Zeitpunkt noch benötigt
    1. Schliesse puttygen

Anmeldung

Öffne die Azure Webseite https://azure.microsoft.com/free und drücke auf Start.


Wähle “Create a new Microsoft Account” im unteren Bereich der Seite.


Fülle alle Felder aus, verifiziere deine Identität, stimme den allgemeinen Geschäftsbedinungen zu und melde dich anschliessend an.

Erstellung einer Virtuellen Maschine

Sobald du registriert bist kannst du dich unter folgendem Link anmelden: https://portal.azure.com.


Gehe auf “New” und suche nach “Debian 8” und wähle es aus der Liste aus.


Wähle “Debian 8 Jessie” und klicke auf create.

Fülle die wichtigsten Informationen aus und erstelle eine neue Ressourcen-Gruppe unter “create a new resource group”.

Wähle als “Authenitcation type” “SSH public key” und füge den öffentlichen Schlüssel ein, der zu Beginn des Guides mit Puttygen erstellt und in einem Textfile abgespeichert wurde. Die VPS-Lokation ist am selben Ort wie die Ressourcen-Gruppe gehostet.

Falls du mehr über Ressourcen-Gruppen lesen möchtest, kannst du hier mehr darüber erfahren.

Gehe zu “Size”, wähle “View all”

create vps

Für diesen Guide nehmen eine Virtuelle Maschine mit dem Paket “A1 Basic”. Grundsätzlich sollte jede Maschine mit mindestens einer CPU und 1.5GB RAM ausreichen.

Gehe zu “Settings” und lasse alles auf Standard mit Ausnahme von “Public IP Adress”. “Monitoring” ist optional.

Klicke auf “Public IP address” ändere den Wert bei “Assignment” auf “static”. Wenn die Einstellung auf “dynmaic” gelassen wird, würde die VPS nach jedem herunterfahren über das Azure-Panel eine neue IP-Adresse beziehen

Überprüfe die Zusammenfassung und klicke auf “OK”

Der Benachrichtungsbereich zeigt nun den Fortschritt des Deployments an. Dieser Vorgang kann zwischen 5 bis 15 Minten in Anspruch nehmen.

create vps
Wenn das Deployment erfolgreich abgeschlossen wird, wirst du darüber benachrichtigt.

create vps

Netzwerkkonfiguration

Die virtuelle Maschine wurde nun erstellt, wir fahren nun mit den Netzwerkeinstellungen fort.

Wähle im linken Dashboardbereich “All resources” und klicke auf “Network Security Group”. In diesem Fall ist die Security Group als “Supernode” benannt. Wähle “Inbound security rules” im rechten Bereich.

Klicke auf “Add” und gebe “name”, “priority” und den Port wie auf dem Screenshot ein.


Dieser Vorgang muss drei Mal wiederholt werden. Jeweils für NIS, servant und Lightwallet

Ports:

  • 7890 für NIS
  • 7880 für servant
  • 7778 für Lightwallet

Wenn du ferig bist, sollte es wie im Bild unten aussehen.

Verbindung zur VPS herstellen

Nach der Netzwerkkonfiguration versuchen wir eine Verbindung zu unserer VPS herzustellen.
Gehe nochmals zu “All resources” und wähle “Network interface”. Notier dir die “Public IP address”.

Starte pageant.exe und öffne “View Keys” in der in der Windows-Benachrichtigungsleiste.

pageant
pageant

Klicke auf “Add Key” und wähle deinen zu beginn des Guides mit Puttygen erstellten privaten Schlüssel (“private Key”). Nachdem der Schlüssel geladen wurde kannst du Pageant minimieren (aber nicht beenden, die Anwendung muss im Hintergrund weiterlaufen!)

pageant

Starte putty und navigiere zu “Connection > SSH > Auth”. Wähle dein private key file aus (.ppk)

putty

Navigiere zu “Connection > Data” und füge deinen Benutzernamen in das “Auto-login username”-Feld ein.

putty

Gehe zu “Session” und füge deine VPS IP Adresse in das “Host Name”-Field ein. Speichere die Session (optional) und klicke auf “Open”.

putty

Eine Konsolenfenster wird sich nun öffnen. Benutzername und Passowrt werden nicht benötigt, da der Benutzername und Kennwort automatisch von Putty und Pageant bezogen werden!

Root Zugriff

Standardmässig ist der Root-Benutzer deaktiviert. Um diesen zu aktivieren logge dich als Standard-Benutzer ein.
Gebe folgenden Befehl in die Konsole ein:

sudo su -

Setze ein Rootpasswort mit dem Befehl:

passwd

Nachdem ein Kennwort gesetzt wurde ist der Root-Benutzer aktiv.

Um dich bei deiner VPS anzumelden brauchst du weiterhin den Standard-Benutzer (mit RSA-Key Login). Sobald du eingeloggt bist kannst du mit folgendem Befehl zum Root-Benutzer wechseln:

su

Supernode installieren

Die VPS ist nun bereit für die Installation.
Für die Installation nutzen wir folgende Anleitung: Paul’s guide (klicke hier).

Beachte: Ein Wert muss geändert werden:
1.3 von:

Java -Xms768M -Xmx768M

zu:

Java -Xms1024M -Xmx1024M

Bis auf diese Ausnahme kannst du der Anleitung folgen, um deinen Supernode korrekt einzurichten.