Skip to content

Renaming AWS EC2 Hostnames (Optional)

The default hostnames created by AWS are not intuitive for the MemVerge.ai cluster. You can rename your AWS EC2 instances to more intuitive hostnames like mvai-mgmt and mvai-nvgpu01. This will make your cluster management more manageable.

Note: It is recommended that at least the Management

  1. Update the hostname on each instance

SSH into each EC2 instance and run the following commands:

sudo hostnamectl set-hostname new-hostname 

Replace "new-hostname" with your desired hostname (e.g., MemVerge.ai-mgmt, MemVerge.ai-node001).

  1. Update /etc/hosts file

Edit the /etc/hosts file and add a line with the new hostname below the default 127.0.0.1 localhost line:

127.0.0.1 new-hostname
  1. Update DNS settings (Optional)

If you're using Amazon Route 53 or another DNS service, update the DNS records to reflect the new hostnames.

  1. Reboot the host:
sudo systemctl reboot
  1. When the system boots, verify the new hostname is correct:
hostnamectl

Updating /etc/hosts on All Nodes

To ensure proper communication between nodes in your cluster, you must add the hostnames and IP addresses of all nodes to the /etc/hosts file on each system. This step is crucial when not using DNS for hostname resolution. If you use DNS, this step is not required. Ensure your DNS entries are correct.

Follow these steps:

  1. Gather the private IP addresses and hostnames of all nodes in your cluster using ip a.

  2. SSH into each node (management and worker nodes). The default user for Ubuntu Linux is ubuntu:

ssh ubuntu@<node-ip>
  1. On each node, edit the /etc/hosts file:
sudo vim /etc/hosts
  1. Add entries for all nodes in your cluster. The format is:
<private-ip> <hostname>

For example, add these lines:

# MemVerge.ai Cluster IP Addresses and Hostnames
172.31.11.149 mvai-mgmt
172.31.19.68 mvai-nvgpu01

Add an entry for each node in your cluster, including the node you're currently editing.

  1. Save the file and exit the editor (in nano, press Ctrl+X, then Y, then Enter).

  2. Repeat steps 2-5 for each node in your cluster.

  3. Verify the changes by pinging other nodes using their hostnames:

   ping mvai-mgmt
   ping mvai-nvgpu01

Ensure that each node can ping all other nodes using their hostnames.

By adding these entries to /etc/hosts on all systems, you ensure that each node can resolve the hostnames of other nodes in the cluster. This is crucial for Kubernetes and other cluster components to communicate properly.

Remember to update the /etc/hosts file on all nodes whenever you add or remove nodes from your cluster. While this manual process works well for smaller, static clusters, using DNS is generally preferred for larger or more dynamic environments.