Skip to content

Add capacity

Adding capacity to your Taubyte-based Cloud means adding more hosts.

To efficiently replicate our initial setup across two additional hosts, we'll first create a configuration template. This approach ensures consistency, particularly concerning the swarm key and domain validation keys.

Exporting the Configuration Template

Initiate the export with the following command, which will encrypt the secrets for added security:

sudo tau config export -s compute --protect

You'll be prompted to enter a password for the encryption:

Password?

Remember this password; it's crucial for the subsequent steps.

The exported configuration will resemble the following (omit the location to let it be automatically determined for the other nodes):

origin:
  shape: compute
  host: host-001-enterprise-starships-ws
  time: 2024-02-12T05:41:25.218338331Z
  protected: true
source:
  swarmkey: PZuGcV96BbfM...2RE8ZEfR2pZoM29z8
  protocols:
  - auth
  - patrick
  - monkey
  - tns
  - hoarder
  - substrate
  - seer
  p2p-listen:
  - /ip4/0.0.0.0/tcp/4242
  p2p-announce:
  - /ip4/34.133.173.124/tcp/4242
  ports:
    main: 4242
    lite: 4247
    ipfs: 4252
  network-fqdn: enterprise.starships.ws
  domains:
    key:
      private: BDN9SEUFsolg...25pUUrUpFxSFhjlCv
      public: cmS5kmov/cJ9...NezzWwcYVj4YVNOg
    generated: e.ftll.ink
  plugins: {}

To facilitate the bootstrap process for the additional nodes, retrieve the first node's multi-address:

sudo tau config show -s compute | grep Announce
The output should provide the address necessary for peer connections:
│ P2PAnnounce │ /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY │

In this case, the multi-address is:

/ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY

Preparing the Additional Hosts

Establish SSH connections to the remaining two hosts, ensuring they are prepared as described in the Preparing the Hosts section. Transfer the compute.tmpl.yaml template (minus the location) and the systemd service file to each.

Installing Tau

On each of the new hosts, install tau using the same command as before:

curl https://get.tau.link/tau | sh

This step lays the foundation for a streamlined expansion of your Taubyte cloud, leveraging the power of configuration templates and ensuring a uniform setup across your infrastructure.

Configuring the Additional Hosts

With the template and necessary preparations in place, proceed to configure the additional hosts:

  • For the Second Host:

    $ sudo tau config gen --ip 34.130.131.76 --use compute.tmpl.yaml  --bootstrap /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY
    

  • For the Third Host:

    $ sudo tau config gen --ip 35.235.122.141 --use compute.tmpl.yaml  --bootstrap /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY
    

Important considerations: - Utilize the correct IP addresses for each host. - The template's encryption password will be required. - Each host is bootstrapped to the initial node, ensuring connectivity and synchronization within the network.

Systemd Setup

After configuration, ensure the tau service will automatically start on each host:

sudo cp ~/tau@.service /lib/systemd/system/tau@.service
sudo systemctl enable tau@compute
sudo systemctl start tau@compute

Verify the service status to confirm active running:

sudo systemctl status tau@compute

DNS Verification

To ensure all nodes are correctly registered and operational, utilize DNS queries:

  1. Enter <protocol>.tau.<domain> and select A to perform the query.

You should observe all three servers listed, indicating successful network integration.

Final Adjustments

With the cloud infrastructure now horizontally expanded and operational, attention turns to ensuring seamless interaction among all hosts and leveraging their capabilities for DNS load balancing.

DNS Adjustments

  • For the Main Domain: Additional A records for each new host need to be added to the DNS configuration.

Running a DNS lookup should now reflect all active hosts:

  • For the Generated Domain: Delegate the specified subdomain to your cloud by adding the appropriate NS entry, enhancing domain management and flexibility.

Bootstrapping for Recovery and Expansion

Ensure all nodes are aware of each other to facilitate network resilience and data consistency:

  1. Collect and share the multi-addresses among all nodes.
  2. Update the peers section in each node's configuration to include all peers.
  3. Validate the configuration for accuracy.

No restart is required as peers are dynamically managed, but ensuring accurate configuration enhances the network's ability to recover and scale effectively.

Configure them

To extend our cloud's reach, we proceed to configure the additional nodes with precision, ensuring a seamless integration into our existing setup. Execute the following commands on the designated hosts to generate their configurations, employing the compute.tmpl.yaml as a blueprint and leveraging the bootstrap mechanism for network connectivity:

  • On the Second Host:

    $ sudo tau config gen --ip 34.130.131.76 --use compute.tmpl.yaml  --bootstrap /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY
    
    [INFO]  ID: 12D3KooWSJZQAPtVaLuusfr3g71FZEeyxr8HdmPcjKeQonHmQXn2
    

  • On the Third Host:

    $ sudo tau config gen --ip 35.235.122.141 --use compute.tmpl.yaml  --bootstrap /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY
    

Important: Use the correct IP addresses for each host and the first node's multi-address for initial discovery. You'll be prompted to enter the password established during the template creation phase—this step is crucial for maintaining security and consistency across your cloud infrastructure.

Setup systemd

To ensure our nodes remain resilient and automatically recover from reboots or unforeseen downtime, we embrace systemd's robustness. On both nodes, execute the following:

sudo cp ~/tau@.service /lib/systemd/system/tau@.service
sudo systemctl enable tau@compute
sudo systemctl start tau@compute

Verify the service's heartbeat:

sudo systemctl status tau@compute

Check with DNS

A litmus test for operational integrity, DNS queries reveal the network's pulse. Employ <protocol>.tau.<domain> and observe:

The triad of servers, now visible, confirms our cloud's expanded horizon.

Final touches

With our cloud now stretching across horizons, it's paramount to ensure inter-node discovery and dynamic load balancing. Our next steps solidify the network's backbone, priming it for seamless scalability.

DNS

Main Domain

Augmenting our DNS configuration to include all nodes under seer.<domain> enriches our network's resilience:

A subsequent dig command unfurls the network's canvas, displaying our nodes in unison:

For those wielding Linux, dig a seer.enterprise.starships.ws +noall +answer yields an ensemble of IPs, signifying our united front.

Generated Domain

Recall our s.ftll.ink domain, a digital expanse awaiting its purpose. An NS entry, pointing to our cloud, bestows it with life:

Bootstrapping

In the realm of distributed systems, autonomy is king. Ensuring each node can independently find its brethren guarantees our network's resilience. With the multi-addresses of all nodes now known, we weave them into each node's fabric:

peers:
  - /ip4/34.133.173.124/tcp/4242/p2p/12D3KooWKv5oNF2a6h9sYzRUPEAaYe6feTbBbcLYZYVFrMDDCHzY
  - /ip4/34.130.131.76/tcp/4242/p2p/12D3KooWHrp2t9npN2TW4dv47uEvJh6qfs6U2ymhkiVVNpcR3cWE
  - /ip4/35.235.122.141/tcp/4242/p2p/12D3KooWKQJfLU74VJzsvhAKUJ8KQidBr1CowMo1e1YRrSb2vTZd

A final validation ensures our network's readiness to face the digital expanse:

sudo tau config check -s compute

No error messages? Then stand back and behold—a cloud, not just built, but crafted, ready to rival the titans.

Restart?

No need for manual restarts. The peer connections are maintained in a persistent database, ensuring that even after recovery or reconfiguration, the nodes automatically recognize each other without intervention.