# Cluster & Nodes

# Cluster Status & Config

#### Cluster Status

Show status of all cluster services on all nodes

```bash
cluster status
nodetool -h 0 ring
acli host.list
```

Start cluster services

```bash
cluster start
```

Show cluster service status

```
cs | grep -v UP
```

Stop cluster services (maintenance only!)

```bash
cluster stop
```

#### Cluster Info

Cluster name, AOS version, and other cluster parameters

```bash
ncli cluster info
```

List all nodes in the cluster

```bash
ncli host list
```

#### Cluster Lifecycle

Destroy the cluster — *irreversible, all data is lost forever. Never run on a production cluster.*

```bash
cluster destroy
```

#### Cluster Config Info

NTP servers configured on the cluster

```bash
ncli cluster get-ntp-servers
```

DNS/name servers configured on the cluster

```bash
ncli cluster get-name-servers
```

Host IP, hypervisor type and CVM IP per node

```bash
ncli managementserver list
```

# Shortcuts & Genesis

#### Useful Shortcuts

Show IPs of all CVMs in the cluster (from a CVM)

```bash
svmips
```

Show IPs of all AHV hosts

```bash
hostips
```

Run a command on all CVMs at once

```bash
allssh "<command>"
```

Run a command on all AHV hosts at once

```bash
hostssh "<command>"
```

#### Genesis

Status of Genesis services on the local CVM

```bash
genesis status
```

Restart the Genesis service (e.g. after a config change)

```bash
genesis restart
```

# Cluster Creation & Upgrades

#### Manual Cluster Creation

Create the cluster manually from a set of CVM IPs

```bash
cluster -s x.x.x.x,x.x.x.x,x.x.x.x create
```

Restart Genesis on all hosts (e.g. after imaging/creation issues)

```bash
cluster restart_genesis
```

Create 2-Node-Cluster

```
cluster -s node1_cvm_ip,node2_cvm_ip --cluster_function_list=two_node_cluster create
```

#### 1-Click Hypervisor Upgrade

Enable/disable automatic install of the downloaded hypervisor during a 1-click upgrade

```bash
cluster --host_upgrade enable_auto_install
cluster --host_upgrade disable_auto_install
```

#### AOS Upgrade

Check current host/AOS upgrade status

```bash
host_upgrade -s
```

Directory where downloaded upgrade packages (AOS, AHV, ...) land

```bash
/home/nutanix/software_downloads
```

Manually push an AOS upgrade to another CVM (run from the CVM that already has the new AOS version)

```bash
/home/nutanix/cluster/bin/cluster -u <new_node_cvm_ip> upgrade_node
```

Watch which node is currently being upgraded

```bash
while [ true ] ; do upgrade_status ; sleep 1 ; done
```

# Disk Space & Foundation

#### Disk Space (CVM)

Find what's eating space on a CVM, sorted ascending

```bash
du -sm ~/* | sort -n
du -sm ~/data/* | sort -n
du -sm ~/data/logs/* | sort -n
```

#### Foundation / Node Discovery

See which unconfigured nodes Foundation/Avahi can discover on the network

```bash
avahi-browse -r -c _nutanix._tcp | grep "+ eth0" | grep IPv6
```

Restart the Avahi daemon if node discovery isn't working

```bash
sudo /etc/init.d/avahi_daemon restart
```

Verify Avahi is running and publishing on port 2100

```bash
ps -ef | grep avahi-publish
```