Acceleration comes from having many different networks and paths to get from the client to the server.
To support this, we want to have around 10-20 different relays providers in each city, from as many different hosting companies as possible.
This creates a massive diversity in different networks, which is how Network Next is able to find acceleration for you.
Let's see what other sellers have datacenters in Sao Paulo:
next datacenters saopauloYou'll should see something like this:
I recommend that you set up at least the following bare metal providers in Sao Paulo, in addition to the google, amazon and akamai relays already set up:
- datapacket.saopaulo
- gcore.saopaulo
- i3d.saopaulo
- latitude.saopaulo.1
- latitude.saopaulo.2
- phoenixnap.saopaulo
- serversdotcom.saopaulo
- zenlayer.saopaulo
These are all the datacenters in (and near) Sao Paulo that Network Next already knows about.
The sellers above are manual, meaning there is no terraform provider support automatically creating and destroying relays for you. You have to do this manually, and then link the relays to terraform by IP address.
As an example, let's work through this process for latitude.saopaulo.1 and latitude.saopaulo.2
First, sign in to https://latitude.sh and setup an SSH key with the public key set to the contents of ~/secrets/next_ssh.pub and call this SSH key "Network Next".
Then, create two bare metal servers in "Sao Paulo", and "Sao Paulo 2" datacenters respectively, making sure to set them as Ubuntu, and for them to use the "Network Next" SSH key, and hourly billing.
Next, open up terraform/dev/relays/main.tf and change the latitude section to:
# ===============
# LATITUDE RELAYS
# ===============
locals {
latitude_relays = {
"latitude.saopaulo.1" = {
datacenter_name = "latitude.saopaulo.1"
public_address = "189.1.174.29"
},
"latitude.saopaulo.2" = {
datacenter_name = "latitude.saopaulo.2"
public_address = "103.88.232.173"
},
}
}Where you replace the IP addresses with the public IPs of the two latitude.sh bare metal machines you created.
Check in your work:
git commit -am "add latitude relays in sao paulo"
git push originApply your changes via terraform:
cd terraform/dev/relays
terraform applyThen commit your changes to the backend:
cd ~/next
next database
next commitRun next relays and you should see the latitude relays added to the list, but they are currently offline:
Now you can ssh in to the latitude relays:
next ssh latitude.saopaulo.1Inside the SSH session, copy and paste the contents of the file scripts/init_relay.sh to the console and press enter.
Do the same thing for latitude.saopaulo.2 relay.
Next, connect to the VPN and run:
next setup latitudeWait a few minutes, and you should see that both latitude relays are now online:
This is the general process for setting up manual relays in Network Next.
- Create the relay manually on the provider website or portal (or order the bare metal machine)
- Do whatever you need to do so you can SSH into the relay with
~/secrets/next_ssh.pubkey - SSH into the relay via
next ssh [relayname]and runscripts/init_relay.shmanually - Connect to the VPN
- Run
next setup [relayname] - Verify the new relay is up by running
next relays - Wait 5 minutes before the relay is ready to carry traffic
ps. If you cannot SSH in for step #3, it is possible your provider is using a different username for SSH login by default than 'root'.
To fix this, edit the file: terraform/[sellername]/main.tf for your seller and adjust the ssh_user variable.
I made that change for latitude already:
If you need to do this for a seller to work, please let me know so I can make the change in the Network Next git repository for you.
Up next: Spin up relays near you.
